From 5858dabae98f8f87db263c8fa41e2b369cd67800 Mon Sep 17 00:00:00 2001 From: "Manuel Amador (Rudd-O)" Date: Thu, 18 Aug 2022 09:48:16 +0000 Subject: [PATCH] Only validate if passwords match when inputting from tty. --- bin/qvm-pass | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bin/qvm-pass b/bin/qvm-pass index 231cfbc..1fb5c43 100755 --- a/bin/qvm-pass +++ b/bin/qvm-pass @@ -502,9 +502,8 @@ elif opts.subcommand == "insert": contents = promptpw("Enter password for %s: " % (opts.key,)) pw2 = promptpw("Retype password for %s: " % (opts.key,)) - if contents != pw2: - if sys.stdin.isatty(): - print("Error: the entered passwords do not match.", file=sys.stderr) + if sys.stdin.isatty() and contents != pw2: + print("Error: the entered passwords do not match.", file=sys.stderr) sys.exit(1) sys.exit(pass_manage(opts.subcommand, opts.key, str(int(opts.multiline)), contents)) else: