projects
/
mirror
/
dsa-puppet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3ff980f
)
mail-big-homedirs: add sanity check for lastlog parsing
author
Julien Cristau
<jcristau@debian.org>
Wed, 8 Jun 2016 21:58:01 +0000
(23:58 +0200)
committer
Julien Cristau
<jcristau@debian.org>
Wed, 8 Jun 2016 21:58:01 +0000
(23:58 +0200)
If we find a negative timestamp, something's gone wrong, abort.
Signed-off-by: Julien Cristau <jcristau@debian.org>
modules/porterbox/files/mail-big-homedirs
patch
|
blob
|
history
diff --git
a/modules/porterbox/files/mail-big-homedirs
b/modules/porterbox/files/mail-big-homedirs
index
9f86801
..
fc9ad45
100755
(executable)
--- a/
modules/porterbox/files/mail-big-homedirs
+++ b/
modules/porterbox/files/mail-big-homedirs
@@
-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: