#!/usr/bin/python # -*- python -*- # Helper for domtool to check if a vmail password matches the stored # password, before allowing the portal to change the password. This # should never be run manually, since it does not suppress echoing of # anything entered. import crypt, getpass, sys def getpasswords (): crypted = raw_input() clear = raw_input() return (crypted, clear) def checkpassword (crypted, clear): return crypt.crypt (clear, crypted) == crypted def main (): (crypted, clear) = getpasswords () if checkpassword (crypted, clear): sys.exit () else: sys.exit (1) if __name__ == "__main__": main ()