X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=ud-mailgate;h=4fa2edf0f1f3ee6f043d5be7bde8fb8b0a787946;hb=c626017071b2de3c4623df898dcf0e16f25e7272;hp=51942f14289416fec8ad28c423cfc39522ca47b4;hpb=b077ff6ff0a392ea268afeb9b09f2121ab76660e;p=mirror%2Fuserdir-ldap.git diff --git a/ud-mailgate b/ud-mailgate index 51942f1..4fa2edf 100755 --- a/ud-mailgate +++ b/ud-mailgate @@ -30,6 +30,7 @@ SeenList = {} DNS = {} SSHFingerprint = re.compile('^(\d+) ([0-9a-f\:]{47}) (.+)$') +SSHRSA1Match = re.compile('^^(.* )?\d+ \d+ \d+') ArbChanges = {"c": "..", "l": ".*", @@ -238,12 +239,14 @@ def LoadBadSSH(): # [options] 1024 35 13188913666680[..] [comment] def DoSSH(Str, Attrs, badkeys, uid): Match = SSH2AuthSplit.match(Str); + if Match == None: + return None; g = Match.groups() typekey = g[1] if Match == None: - Match = re.compile('^1024 (\d+) ').match(Str) + Match = SSHRSA1Match.match(Str) if Match is not None: - return "SSH1 keys not supported anymore" + return "RSA1 keys not supported anymore" return None; (fd, path) = tempfile.mkstemp(".pub", "sshkeytry", "/tmp") @@ -548,7 +551,8 @@ def HandleChPass(Reply,DnRecord,Key): raise Error, "This account is locked"; # Modify the password - Rec = [(ldap.MOD_REPLACE,"userPassword","{crypt}"+Pass)]; + Rec = [(ldap.MOD_REPLACE,"userPassword","{crypt}"+Pass), + (ldap.MOD_REPLACE,"shadowLastChange",str(int(time.time()/24/60/60)))]; Dn = "uid=" + GetAttr(DnRecord,"uid") + "," + BaseDn; l.modify_s(Dn,Rec);