m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2012-09-20 18:13:25 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2012-09-20 18:13:25 +0200
commit5bc781bd38ea4141e5e3b9110bf28214773cf1a3 (patch)
tree021cd23165dd3898c5178c947f1e68f15bf3c031 /src
parente12affb8e4b214e84cfbedfe00e4ff358d2e7e86 (diff)
Quit if pwgen returns nothing.
Reported-by: Brian Mattern <rephorm@rephorm.com>
Diffstat (limited to 'src')
-rwxr-xr-xsrc/password-store.sh1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/password-store.sh b/src/password-store.sh
index 5075bb8..9923907 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -312,6 +312,7 @@ case "$command" in
[[ $force -eq 0 && -e $passfile ]] && yesno "An entry already exists for $path. Overwrite it?"
pass="$(pwgen -s $symbols $length 1)"
+ [[ -n $pass ]] || exit 1
$GPG -e -r "$ID" -o "$passfile" $GPG_OPTS <<<"$pass"
git_add_file "$passfile" "Added generated password for $path to store."