sss_obfuscate revision 8d00718b943ab8b326320feb50820f0663031817
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews parser.set_description("sss_obfuscate converts a given password into \
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews human-unreadable format and places it into \
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews appropriate domain section of the SSSD config \
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews file. The password can be passed in by stdin, \
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews specified on the command-line or entered \
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews parser.add_option("-s", "--stdin", action="store_true",
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein help="The domain to use the password in (default: default)",
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein help="Set input file to FILE (default: Use system default, usually /etc/sssd/sssd.conf)",
7b8b5e34b6daf793373580dfb095f56af5e918ceAutomatic Updater pprompt = lambda: (getpass.getpass("Enter password: "), getpass.getpass("Re-enter password: "))
0e27506ce3135f9bd49e12564ad0e15256135118Automatic Updater print('Passwords do not match. Try again')
f5d30e2864e048a42c4dc1134993ae7efdb5d6c3Mark Andrews # Obfuscate the password
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein obfpwd = obfobj.encrypt(password, obfobj.AES_256)
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein # Save the obfuscated password into the domain
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein print "Cannot open config file %s" % options.filename
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein domain.set_option('ldap_default_authtok_type', 'obfuscated_password')
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein domain.set_option('ldap_default_authtok', obfpwd)
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein print "The domain %s does not seem to support the required options" % \