diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2000-01-03 19:30:01 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2000-01-03 19:30:01 +0000 |
commit | f4181932c9312a9e37208f1f69d9d26428c8ce4d (patch) | |
tree | 9497e885e82f9910ccc83151fd8f6fce7879a4ae /usr.sbin/adduser | |
parent | 371ed72f4420fd048c7a2fa2366724784aa8c9fe (diff) |
Y2K bug in logging function, tm_year is year - 1900, not the last two digits
of year. Two digit years are just a bad idea anyway so convert to
a four digit year in the logfile.
Diffstat (limited to 'usr.sbin/adduser')
-rw-r--r-- | usr.sbin/adduser/adduser.perl | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.sbin/adduser/adduser.perl b/usr.sbin/adduser/adduser.perl index b6c80903138..7076ae5b41e 100644 --- a/usr.sbin/adduser/adduser.perl +++ b/usr.sbin/adduser/adduser.perl @@ -1,6 +1,6 @@ #!/usr/bin/perl # -# $OpenBSD: adduser.perl,v 1.19 1999/09/06 16:48:41 alex Exp $ +# $OpenBSD: adduser.perl,v 1.20 2000/01/03 19:30:00 millert Exp $ # # Copyright (c) 1995-1996 Wolfram Schneider <wosch@FreeBSD.org>. Berlin. # All rights reserved. @@ -1057,9 +1057,10 @@ sub adduser_log { return 1 if $logfile eq "no"; local($sec, $min, $hour, $mday, $mon, $year) = localtime; + $year += 1900; $mon++; - foreach $e ('sec', 'min', 'hour', 'mday', 'mon', 'year') { + foreach $e ('sec', 'min', 'hour', 'mday', 'mon') { # '7' -> '07' eval "\$$e = 0 . \$$e" if (eval "\$$e" < 10); } @@ -1452,7 +1453,7 @@ sub config_write { print C <<EOF; # -# $OpenBSD: adduser.perl,v 1.19 1999/09/06 16:48:41 alex Exp $ +# $OpenBSD: adduser.perl,v 1.20 2000/01/03 19:30:00 millert Exp $ # $config - automatic generated by adduser(8) # # Note: adduser read *and* write this file. |