X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=userdir_ldap.py;h=c76992c6da3cb20db769040a62a437e02e284f3f;hb=e0b19005ac3c2a0d6112f76af67e5de434ce5458;hp=109c7cec17c40d787d508cbec58b9d730f3b6300;hpb=2dbb95ed55973f4cfbffe44871b9b344179b6fff;p=mirror%2Fuserdir-ldap.git diff --git a/userdir_ldap.py b/userdir_ldap.py index 109c7ce..c76992c 100644 --- a/userdir_ldap.py +++ b/userdir_ldap.py @@ -432,9 +432,12 @@ def Group2GID(l, name): return -1 def make_hmac(str): - File = open(PassDir+"/key-hmac-"+pwd.getpwuid(os.getuid())[0],"r"); - HmacKey = File.readline().strip() - File.close(); + if 'UD_HMAC_KEY' in os.environ: + HmacKey = os.environ['UD_HMAC_KEY'] + else: + File = open(PassDir+"/key-hmac-"+pwd.getpwuid(os.getuid())[0],"r"); + HmacKey = File.readline().strip() + File.close(); return hmac.new(HmacKey, str, sha1_module).hexdigest() def make_passwd_hmac(status, purpose, uid, uuid, hosts, cryptedpass):