summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/tools/sss_obfuscate14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/tools/sss_obfuscate b/src/tools/sss_obfuscate
index 506e2c410..5a5742b9c 100644
--- a/src/tools/sss_obfuscate
+++ b/src/tools/sss_obfuscate
@@ -41,12 +41,16 @@ def main():
return 1
if not options.stdin:
- pprompt = lambda: (getpass.getpass("Enter password: "), getpass.getpass("Re-enter password: "))
- p1, p2 = pprompt()
- while p1 != p2:
- print('Passwords do not match. Try again')
+ try:
+ pprompt = lambda: (getpass.getpass("Enter password: "), getpass.getpass("Re-enter password: "))
p1, p2 = pprompt()
- password = p1
+ while p1 != p2:
+ print('Passwords do not match. Try again')
+ p1, p2 = pprompt()
+ password = p1
+ except EOFError:
+ print >> sys.stderr, '\nUnexpected end-of-file. Password change aborted'
+ return 1
else:
try: