Bugfix for ipa-client-install echo's password in cleartext to stdout https://fedorahosted.org/freeipa/ticket/959

This commit is contained in:
Jr Aquino
2011-02-14 12:00:49 -08:00
committed by Rob Crittenden
parent 309ed42865
commit 72e315c936

View File

@@ -658,8 +658,10 @@ def main():
stdin = options.password
else:
if not options.unattended:
print "Password for %s: " % principal,
sys.stdout.flush()
stdin = getpass.getpass("Password for %s: " % principal)
if not stdin:
sys.exit("Password must be provided for %s. " %
principal)
else:
if sys.stdin.isatty():
sys.exit("Password must be provided in non-interactive mode.\nThis can be done via echo password | ipa-client-install ... or\nwith the -w option.")