sss_obfuscate revision 73b68aa708e1ffa0e0ab5b021fa93ff3a0f484b1
354c88062085b9c03e4ea164f29c461b2ea842d6vboxsync parser.set_description("sss_obfuscate converts a given password into \
354c88062085b9c03e4ea164f29c461b2ea842d6vboxsync human-unreadable format and places it into \
354c88062085b9c03e4ea164f29c461b2ea842d6vboxsync appropriate domain section of the SSSD config \
354c88062085b9c03e4ea164f29c461b2ea842d6vboxsync file. The password can be passed in by stdin, \
354c88062085b9c03e4ea164f29c461b2ea842d6vboxsync specified on the command-line or entered \
354c88062085b9c03e4ea164f29c461b2ea842d6vboxsync parser.add_option("-s", "--stdin", action="store_true",
354c88062085b9c03e4ea164f29c461b2ea842d6vboxsync help="The domain to use the password in (mandatory)",
354c88062085b9c03e4ea164f29c461b2ea842d6vboxsync help="Set input file to FILE (default: Use system default, usually /etc/sssd/sssd.conf)",
354c88062085b9c03e4ea164f29c461b2ea842d6vboxsync pprompt = lambda: (getpass.getpass("Enter password: "), getpass.getpass("Re-enter password: "))
354c88062085b9c03e4ea164f29c461b2ea842d6vboxsync #Work around bug in Python 2.6
354c88062085b9c03e4ea164f29c461b2ea842d6vboxsync #Work around bug in Python 2.6
354c88062085b9c03e4ea164f29c461b2ea842d6vboxsync print >> sys.stderr, '\nUnexpected end-of-file. Password change aborted'
354c88062085b9c03e4ea164f29c461b2ea842d6vboxsync # Obfuscate the password
354c88062085b9c03e4ea164f29c461b2ea842d6vboxsync # Save the obfuscated password into the domain
4bd3e7685494afe7c303fc131c66e685023b6b4avboxsync print "Cannot read internal configuration files."
354c88062085b9c03e4ea164f29c461b2ea842d6vboxsync print "Permissions error reading config file"
354c88062085b9c03e4ea164f29c461b2ea842d6vboxsync domain.set_option('ldap_default_authtok_type', 'obfuscated_password')
354c88062085b9c03e4ea164f29c461b2ea842d6vboxsync print "The domain %s does not seem to support the required options" % \
6337fd8860ce7d3ae9835f9bee38c15ecbabc86avboxsync # File could not be written
6337fd8860ce7d3ae9835f9bee38c15ecbabc86avboxsync print >> sys.stderr, "Could not write to config file. Check that " \
6337fd8860ce7d3ae9835f9bee38c15ecbabc86avboxsync "you have the appropriate permissions to edit " \
6337fd8860ce7d3ae9835f9bee38c15ecbabc86avboxsync "this file."