X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fporterbox%2Ffiles%2Fmail-big-homedirs;h=f5225b5c8982fc61666aa01d1fb68a50b77ff752;hb=refs%2Fheads%2Fmaster;hp=9f86801f9c6d67a9aeb43c81f05d576803b72ba7;hpb=3ff980f9e77c0427741acd2499e3e64117886dd5;p=mirror%2Fdsa-puppet.git diff --git a/modules/porterbox/files/mail-big-homedirs b/modules/porterbox/files/mail-big-homedirs index 9f86801f9..f5225b5c8 100755 --- a/modules/porterbox/files/mail-big-homedirs +++ b/modules/porterbox/files/mail-big-homedirs @@ -125,7 +125,7 @@ class LastlogTimes(dict): record_size_64 = struct.calcsize(self.LASTLOG_STRUCT_64) # some 64bit arches have 32bit-compatible lastlog structures, others don't, # in apparently incoherent ways, so hardcode a list... - if platform.machine() in ('ia64', 'aarch64', 's390x'): + if platform.machine() in ('aarch64', 's390x'): self.LASTLOG_STRUCT = self.LASTLOG_STRUCT_64 record_size = record_size_64 else: @@ -139,6 +139,9 @@ class LastlogTimes(dict): % (len(record), record_size)) uid += 1 # so keep incrementing uid for each record read lastlog_time, _, _ = list(struct.unpack(self.LASTLOG_STRUCT, record)) + if lastlog_time < 0: + raise RuntimeError('unexpected last login time %d for user %s' + % (lastlog_time, pwd.getpwuid(uid).pw_name)) try: self[pwd.getpwuid(uid).pw_name] = lastlog_time except KeyError: