projects
/
mirror
/
userdir-ldap.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
optionally read some configuration items from the environment so we can test ud-gener...
[mirror/userdir-ldap.git]
/
userdir_ldap.py
diff --git
a/userdir_ldap.py
b/userdir_ldap.py
index
109c7ce
..
c76992c
100644
(file)
--- a/
userdir_ldap.py
+++ b/
userdir_ldap.py
@@
-432,9
+432,12
@@
def Group2GID(l, name):
return -1
def make_hmac(str):
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):
return hmac.new(HmacKey, str, sha1_module).hexdigest()
def make_passwd_hmac(status, purpose, uid, uuid, hosts, cryptedpass):