diff options
| author | simonb <simonb@NetBSD.org> | 2000-10-17 05:43:10 +0000 |
|---|---|---|
| committer | simonb <simonb@NetBSD.org> | 2000-10-17 05:43:10 +0000 |
| commit | 6dfb84a930561b01916c19cf796c052999a5c6a3 (patch) | |
| tree | 3f15381764c1384f9e5f87a2c7ee8b8f852100c7 | |
| parent | 5114e81f1007f98abeca8e6aa8a88b3c966ba7e5 (diff) | |
For userinfo - if a password change or expiry time_t is 0, print "NEVER"
instead of some date around Jan 1, 1970.
| -rw-r--r-- | usr.sbin/user/user.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/user/user.c b/usr.sbin/user/user.c index 27700c4a21c..3a6ff4f027d 100644 --- a/usr.sbin/user/user.c +++ b/usr.sbin/user/user.c @@ -1,4 +1,4 @@ -/* $NetBSD: user.c,v 1.27 2000/10/17 05:31:50 simonb Exp $ */ +/* $NetBSD: user.c,v 1.28 2000/10/17 05:43:10 simonb Exp $ */ /* * Copyright (c) 1999 Alistair G. Crooks. All rights reserved. @@ -35,7 +35,7 @@ #ifndef lint __COPYRIGHT("@(#) Copyright (c) 1999 \ The NetBSD Foundation, Inc. All rights reserved."); -__RCSID("$NetBSD: user.c,v 1.27 2000/10/17 05:31:50 simonb Exp $"); +__RCSID("$NetBSD: user.c,v 1.28 2000/10/17 05:43:10 simonb Exp $"); #endif #include <sys/types.h> @@ -1725,12 +1725,12 @@ userinfo(int argc, char **argv) } else { (void) printf("groups\t%s %s\n", grp->gr_name, buf); } - (void) printf("change\t%s", ctime(&pwp->pw_change)); + (void) printf("change\t%s", pwp->pw_change ? ctime(&pwp->pw_change) : "NEVER\n"); (void) printf("class\t%s\n", pwp->pw_class); (void) printf("gecos\t%s\n", pwp->pw_gecos); (void) printf("dir\t%s\n", pwp->pw_dir); (void) printf("shell\t%s\n", pwp->pw_shell); - (void) printf("expire\t%s", ctime(&pwp->pw_expire)); + (void) printf("expire\t%s", pwp->pw_expire ? ctime(&pwp->pw_expire) : "NEVER\n"); return EXIT_SUCCESS; } #endif |
