diff options
author | sheldonh <sheldonh@FreeBSD.org> | 1999-08-30 09:55:42 +0000 |
---|---|---|
committer | sheldonh <sheldonh@FreeBSD.org> | 1999-08-30 09:55:42 +0000 |
commit | addfa1409d29fdab711254c22cf82d2ee08b0bdc (patch) | |
tree | 97dcb8295788204086d705956744e7495b2c1bf0 /usr.sbin | |
parent | 903d244211fbbcc99b0aacb7009d0f967bc623d9 (diff) | |
download | FreeBSD-src-addfa1409d29fdab711254c22cf82d2ee08b0bdc.zip FreeBSD-src-addfa1409d29fdab711254c22cf82d2ee08b0bdc.tar.gz |
Only issue a warning for the first occurrence of a UID > USHRT_MAX and
the first occurrence of a GID > USHRT_MAX.
PR: 13344
Reviewed by: bde
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/pwd_mkdb/pw_scan.c | 15 | ||||
-rw-r--r-- | usr.sbin/pwd_mkdb/pwd_mkdb.8 | 8 |
2 files changed, 17 insertions, 6 deletions
diff --git a/usr.sbin/pwd_mkdb/pw_scan.c b/usr.sbin/pwd_mkdb/pw_scan.c index 5190686..e03b49c 100644 --- a/usr.sbin/pwd_mkdb/pw_scan.c +++ b/usr.sbin/pwd_mkdb/pw_scan.c @@ -56,6 +56,9 @@ static const char rcsid[] = #include "pw_scan.h" +static int big_uids = 0; /* Used for legacy max uid_t warning */ +static int big_gids = 0; /* Used for legacy max gid_t warning */ + int pw_scan(bp, pw) char *bp; @@ -84,9 +87,9 @@ pw_scan(bp, pw) warnx("root uid should be 0"); return (0); } - if (id > USHRT_MAX) { - warnx("%s > max uid value (%d)", p, USHRT_MAX); - /*return (0);*/ /* THIS SHOULD NOT BE FATAL! */ + if (id > USHRT_MAX && !(big_uids++)) { + warnx("%s > legacy max uid value (%d): " + "no more such warnings", p, USHRT_MAX); } pw->pw_uid = id; @@ -94,9 +97,9 @@ pw_scan(bp, pw) goto fmt; if(p[0]) pw->pw_fields |= _PWF_GID; id = atol(p); - if (id > USHRT_MAX) { - warnx("%s > max gid value (%d)", p, USHRT_MAX); - /* return (0); This should not be fatal! */ + if (id > USHRT_MAX && !(big_gids++)) { + warnx("%s > max gid value (%d): " + "no more such warnings", p, USHRT_MAX); } pw->pw_gid = id; diff --git a/usr.sbin/pwd_mkdb/pwd_mkdb.8 b/usr.sbin/pwd_mkdb/pwd_mkdb.8 index 3223353..c3b68a2 100644 --- a/usr.sbin/pwd_mkdb/pwd_mkdb.8 +++ b/usr.sbin/pwd_mkdb/pwd_mkdb.8 @@ -149,6 +149,14 @@ style databases for the password file but depended on the calling programs to install them. The program was renamed in order that previous users of the program not be surprised by the changes in functionality. +.Pp +The +.Nm +program will produce warnings if it finds a UID or GID larger than the +historical maximum (USHRT_MAX), as these may cause problems for software +which assumes such a maximum. +Only the first such UID and the first such GID will produce a +warning. .Sh SEE ALSO .Xr chpass 1 , .Xr passwd 1 , |