diff options
author | 2001-01-31 17:42:25 +0000 | |
---|---|---|
committer | 2001-01-31 17:42:25 +0000 | |
commit | c264c362c67c6e1172dbee5e6cbd1e93669a574e (patch) | |
tree | bc7759efbed5fe3a8773744d732ca03501bce4e8 /lib/libc/gen/pwcache.c | |
parent | OpenBSD does have paddr_t, I can't explain why I thought it didn't; art@ (diff) | |
download | wireguard-openbsd-c264c362c67c6e1172dbee5e6cbd1e93669a574e.tar.xz wireguard-openbsd-c264c362c67c6e1172dbee5e6cbd1e93669a574e.zip |
move utmp to large format, usernames to 32 chars; downsj
Diffstat (limited to 'lib/libc/gen/pwcache.c')
-rw-r--r-- | lib/libc/gen/pwcache.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/libc/gen/pwcache.c b/lib/libc/gen/pwcache.c index 6b1997baced..509bdbb10b5 100644 --- a/lib/libc/gen/pwcache.c +++ b/lib/libc/gen/pwcache.c @@ -32,7 +32,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: pwcache.c,v 1.3 1997/07/09 00:28:23 millert Exp $"; +static char rcsid[] = "$OpenBSD: pwcache.c,v 1.4 2001/01/31 17:42:25 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> @@ -41,7 +41,6 @@ static char rcsid[] = "$OpenBSD: pwcache.c,v 1.3 1997/07/09 00:28:23 millert Exp #include <pwd.h> #include <stdio.h> #include <string.h> -#include <utmp.h> #define NCACHE 64 /* power of 2 */ #define MASK (NCACHE - 1) /* bits to store with */ @@ -53,7 +52,7 @@ user_from_uid(uid, nouser) { static struct ncache { uid_t uid; - char name[UT_NAMESIZE + 1]; + char name[_PW_NAME_LEN + 1]; } c_uid[NCACHE]; static int pwopen; static char nbuf[15]; /* 32 bits == 10 digits */ @@ -73,8 +72,8 @@ user_from_uid(uid, nouser) return (nbuf); } cp->uid = uid; - (void)strncpy(cp->name, pw->pw_name, UT_NAMESIZE); - cp->name[UT_NAMESIZE] = '\0'; + (void)strncpy(cp->name, pw->pw_name, _PW_NAME_LEN); + cp->name[_PW_NAME_LEN] = '\0'; } return (cp->name); } @@ -86,7 +85,7 @@ group_from_gid(gid, nogroup) { static struct ncache { gid_t gid; - char name[UT_NAMESIZE + 1]; + char name[_PW_NAME_LEN + 1]; } c_gid[NCACHE]; static int gropen; static char nbuf[15]; /* 32 bits == 10 digits */ @@ -106,8 +105,8 @@ group_from_gid(gid, nogroup) return (nbuf); } cp->gid = gid; - (void)strncpy(cp->name, gr->gr_name, UT_NAMESIZE); - cp->name[UT_NAMESIZE] = '\0'; + (void)strncpy(cp->name, gr->gr_name, _PW_NAME_LEN); + cp->name[_PW_NAME_LEN] = '\0'; } return (cp->name); } |