diff options
-rw-r--r-- | chpass/chpass.1 | 6 | ||||
-rw-r--r-- | libc/gen/pw_scan.c | 9 |
2 files changed, 14 insertions, 1 deletions
diff --git a/chpass/chpass.1 b/chpass/chpass.1 index b36ddbb..41595e1 100644 --- a/chpass/chpass.1 +++ b/chpass/chpass.1 @@ -230,6 +230,12 @@ When the editor terminates, the information is re-read and used to update the user database itself. Only the user, or the super-user, may edit the information associated with the user. +.Pp +See +.Xr pwd_mkdb 8 +for an explanation of the impact of setting the +.Ev PW_SCAN_BIG_IDS +environment variable. .Sh NIS INTERACTION .Nm Chpass can also be used in conjunction with NIS, however some restrictions diff --git a/libc/gen/pw_scan.c b/libc/gen/pw_scan.c index 09556a3..849effa 100644 --- a/libc/gen/pw_scan.c +++ b/libc/gen/pw_scan.c @@ -60,8 +60,12 @@ static const char rcsid[] = * Some software assumes that IDs are short. We should emit warnings * for id's which can not be stored in a short, but we are more liberal * by default, warning for IDs greater than USHRT_MAX. + * + * If pw_big_ids_warning is anything other than -1 on entry to pw_scan() + * it will be set based on the existance of PW_SCAN_BIG_IDS in the + * environment. */ -int pw_big_ids_warning = 1; +int pw_big_ids_warning = -1; int pw_scan(bp, pw) @@ -72,6 +76,9 @@ pw_scan(bp, pw) int root; char *p, *sh; + if (pw_big_ids_warning == -1) + pw_big_ids_warning = getenv("PW_SCAN_BIG_IDS") == NULL ? 1 : 0; + pw->pw_fields = 0; if (!(pw->pw_name = strsep(&bp, ":"))) /* login */ goto fmt; |