diff options
author | peter <peter@FreeBSD.org> | 2001-10-27 02:13:41 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2001-10-27 02:13:41 +0000 |
commit | 5a0fafd56a01e4faa2d0c40d2c15bc16c5780149 (patch) | |
tree | 8410ee6d90f1b6ef9efce00a46a15979bf1f4607 /usr.sbin/pwd_mkdb | |
parent | 8972891811456ffcfe6a96c0a9797ae64f8129ab (diff) | |
download | FreeBSD-src-5a0fafd56a01e4faa2d0c40d2c15bc16c5780149.zip FreeBSD-src-5a0fafd56a01e4faa2d0c40d2c15bc16c5780149.tar.gz |
Explicitly use int32_t for on-disk records for pw_change and pw_expire,
since that is what we use now and this insulates us from any time_t
tweaks here. We can define a record format that uses 64 bit times if/when
we need to.
Diffstat (limited to 'usr.sbin/pwd_mkdb')
-rw-r--r-- | usr.sbin/pwd_mkdb/pwd_mkdb.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/usr.sbin/pwd_mkdb/pwd_mkdb.c b/usr.sbin/pwd_mkdb/pwd_mkdb.c index 01e52de..40dc511 100644 --- a/usr.sbin/pwd_mkdb/pwd_mkdb.c +++ b/usr.sbin/pwd_mkdb/pwd_mkdb.c @@ -101,6 +101,7 @@ main(argc, argv) FILE *fp, *oldfp; sigset_t set; int ch, cnt, ypcnt, len, makeold, tfd, yp_enabled = 0; + int32_t pw_change, pw_expire; char *p, *t; char buf[MAX(MAXPATHLEN, LINE_MAX * 2)], tbuf[1024]; char sbuf[MAX(MAXPATHLEN, LINE_MAX * 2)]; @@ -316,6 +317,8 @@ main(argc, argv) #define COMPACT(e) t = e; while ((*p++ = *t++)); if (!is_comment && (!username || (strcmp(username, pwd.pw_name) == 0))) { + pw_change = pwd.pw_change; + pw_expire = pwd.pw_expire; /* Create insecure data. */ p = buf; COMPACT(pwd.pw_name); @@ -324,14 +327,14 @@ main(argc, argv) p += sizeof(int); memmove(p, &pwd.pw_gid, sizeof(pwd.pw_gid)); p += sizeof(int); - memmove(p, &pwd.pw_change, sizeof(time_t)); - p += sizeof(time_t); + memmove(p, &pw_change, sizeof(pw_change)); + p += sizeof(pw_change); COMPACT(pwd.pw_class); COMPACT(pwd.pw_gecos); COMPACT(pwd.pw_dir); COMPACT(pwd.pw_shell); - memmove(p, &pwd.pw_expire, sizeof(time_t)); - p += sizeof(time_t); + memmove(p, &pw_expire, sizeof(pw_expire)); + p += sizeof(pw_expire); memmove(p, &pwd.pw_fields, sizeof pwd.pw_fields); p += sizeof pwd.pw_fields; data.size = p - buf; @@ -344,14 +347,14 @@ main(argc, argv) p += sizeof(int); memmove(p, &pwd.pw_gid, sizeof(pwd.pw_gid)); p += sizeof(int); - memmove(p, &pwd.pw_change, sizeof(time_t)); - p += sizeof(time_t); + memmove(p, &pw_change, sizeof(pw_change)); + p += sizeof(pw_change); COMPACT(pwd.pw_class); COMPACT(pwd.pw_gecos); COMPACT(pwd.pw_dir); COMPACT(pwd.pw_shell); - memmove(p, &pwd.pw_expire, sizeof(time_t)); - p += sizeof(time_t); + memmove(p, &pw_expire, sizeof(pw_expire)); + p += sizeof(pw_expire); memmove(p, &pwd.pw_fields, sizeof pwd.pw_fields); p += sizeof pwd.pw_fields; sdata.size = p - sbuf; |