Hi,

in the IRC someone was having issues with 100% CPU use when generating a
password with length 0, I found that read -r -n 0  just keeps on going.
I cannot find this behavior documented if NCHARS is set to 0.

---
diff --git a/src/password-store.sh b/src/password-store.sh
index e3e5659..2afb51b 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -505,7 +505,7 @@ cmd_generate() {
        local path="$1"
        local length="${2:-$GENERATED_LENGTH}"
        check_sneaky_paths "$path"
-       [[ ! $length =~ ^[0-9]+$ ]] && die "Error: pass-length \"$length\"
must be a number."
+       [[ ! $length =~ ^[1-9][0-9]+$ ]] && die "Error: pass-length
\"$length\" must be a number greater 0."
        mkdir -p -v "$PREFIX/$(dirname -- "$path")"
        set_gpg_recipients "$(dirname -- "$path")"
        local passfile="$PREFIX/$path.gpg"

_______________________________________________
Password-Store mailing list
Password-Store@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/password-store

Reply via email to