X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=ud-mailgate;h=1ba2c53412b23158c4a7e1b6f08a88fe77f60449;hb=0539c19e661f05d992fdeb6e05ec9dcf99bb691d;hp=26e4b75d30b1906f200227e6f6f422abac6bdba0;hpb=187d3edfdc561cd4a929811d63f73114e15932e8;p=mirror%2Fuserdir-ldap.git diff --git a/ud-mailgate b/ud-mailgate index 26e4b75..1ba2c53 100755 --- a/ud-mailgate +++ b/ud-mailgate @@ -82,7 +82,6 @@ DelItems = {"c": None, "jpegPhoto": None, "dnsZoneEntry": None, "sshRSAAuthKey": None, - "sshDSAAuthKey": None, "birthDate" : None, "mailGreylisting": None, "mailCallout": None, @@ -453,7 +452,7 @@ def DoRBL(Str,Attrs): # Handle a ConfirmSudoPassword request def DoConfirmSudopassword(Str): - Match = re.compile('^confirm sudopassword ('+UUID_FORMAT+') ([a-z0-9,*]+) ([0-9a-f]{40})$').match(Str.lower()) + Match = re.compile('^confirm sudopassword ('+UUID_FORMAT+') ([a-z0-9.,*]+) ([0-9a-f]{40})$').match(Str) if Match == None: return None @@ -479,7 +478,7 @@ def FinishConfirmSudopassword(l, uid, Attrs): newldap = [] for entry in inldap: - Match = re.compile('^('+UUID_FORMAT+') (confirmed:[0-9a-f]{40}|unconfirmed) ([a-z0-9.,*]+) ([^ ]+)$').match(entry.lower()) + Match = re.compile('^('+UUID_FORMAT+') (confirmed:[0-9a-f]{40}|unconfirmed) ([a-z0-9.,*]+) ([^ ]+)$').match(entry) if Match == None: raise Error, "Could not parse existing sudopasswd entry" uuid = Match.group(1) @@ -491,15 +490,15 @@ def FinishConfirmSudopassword(l, uid, Attrs): confirmedHosts = SudoPasswd[uuid][0] confirmedHmac = SudoPasswd[uuid][1] if status.startswith('confirmed:'): - if status == 'confirmed:'+make_sudopasswd_hmac('password-is-confirmed', uuid, hosts, cryptedpass): + if status == 'confirmed:'+make_passwd_hmac('password-is-confirmed', 'sudo', uid, ,uuid, hosts, cryptedpass): result = result + "Entry %s for sudo password on hosts %s already confirmed.\n"%(uuid, hosts) else: result = result + "Entry %s for sudo password on hosts %s is listed as confirmed, but HMAC does not verify.\n"%(uuid, hosts) elif confirmedHosts != hosts: result = result + "Entry %s hostlist mismatch (%s vs. %s).\n"%(uuid, hosts, confirmedHosts) - elif make_sudopasswd_hmac('confirm-new-password', uuid, hosts, cryptedpass) == confirmedHmac: + elif make_passwd_hmac('confirm-new-password', 'sudo', uid, uuid, hosts, cryptedpass) == confirmedHmac: result = result + "Entry %s for sudo password on hosts %s now confirmed.\n"%(uuid, hosts) - status = 'confirmed:'+make_sudopasswd_hmac('password-is-confirmed', uuid, hosts, cryptedpass) + status = 'confirmed:'+make_passwd_hmac('password-is-confirmed', 'sudo', uid, uuid, hosts, cryptedpass) else: result = result + "Entry %s for sudo password on hosts %s HMAC verify failed.\n"%(uuid, hosts) del SudoPasswd[uuid]