diff options
-rw-r--r-- | lib/libc/gen/pw_scan.c | 9 | ||||
-rw-r--r-- | usr.bin/chpass/chpass.1 | 6 | ||||
-rw-r--r-- | usr.sbin/pwd_mkdb/pw_scan.c | 9 | ||||
-rw-r--r-- | usr.sbin/pwd_mkdb/pwd_mkdb.8 | 16 | ||||
-rw-r--r-- | usr.sbin/pwd_mkdb/pwd_mkdb.c | 5 | ||||
-rw-r--r-- | usr.sbin/vipw/vipw.8 | 5 |
6 files changed, 36 insertions, 14 deletions
diff --git a/lib/libc/gen/pw_scan.c b/lib/libc/gen/pw_scan.c index 09556a3..849effa 100644 --- a/lib/libc/gen/pw_scan.c +++ b/lib/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; diff --git a/usr.bin/chpass/chpass.1 b/usr.bin/chpass/chpass.1 index b36ddbb..41595e1 100644 --- a/usr.bin/chpass/chpass.1 +++ b/usr.bin/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/usr.sbin/pwd_mkdb/pw_scan.c b/usr.sbin/pwd_mkdb/pw_scan.c index 09556a3..849effa 100644 --- a/usr.sbin/pwd_mkdb/pw_scan.c +++ b/usr.sbin/pwd_mkdb/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; diff --git a/usr.sbin/pwd_mkdb/pwd_mkdb.8 b/usr.sbin/pwd_mkdb/pwd_mkdb.8 index 1e52b08..b2a5cd6 100644 --- a/usr.sbin/pwd_mkdb/pwd_mkdb.8 +++ b/usr.sbin/pwd_mkdb/pwd_mkdb.8 @@ -43,7 +43,6 @@ .Op Fl C .Op Fl N .Op Fl p -.Op Fl q .Op Fl d Ar directory .Op Fl s Ar cachesize .Op Fl u Ar username @@ -79,12 +78,6 @@ the rebuilding of the database. .It Fl p Create a Version 7 style password file and install it into .Pa /etc/passwd . -.It Fl q -Suppress the warnings that -.Nm -normally generates for large user and group IDs. -Such IDs can cause serious problems with software -that makes assumptions about the values of IDs. .It Fl d Ar directory Store databases into specified destination directory instead of .Pa /etc . @@ -110,6 +103,15 @@ The databases are used by the C library password routines (see .Pp .Nm Pwd_mkdb exits zero on success, non-zero on failure. +.Sh ENVIRONMENT +If the +.Ev PW_SCAN_BIG_IDS +environment variable is set, +.Nm +will suppress the warning messages that are +normally generated for large user and group IDs. +Such IDs can cause serious problems with software +that makes assumptions about the values of IDs. .Sh FILES .Bl -tag -width Pa -compact .It Pa /etc/pwd.db diff --git a/usr.sbin/pwd_mkdb/pwd_mkdb.c b/usr.sbin/pwd_mkdb/pwd_mkdb.c index ef57dc2..5ee9699 100644 --- a/usr.sbin/pwd_mkdb/pwd_mkdb.c +++ b/usr.sbin/pwd_mkdb/pwd_mkdb.c @@ -115,7 +115,7 @@ main(argc, argv) strcpy(prefix, _PATH_PWD); makeold = 0; username = NULL; - while ((ch = getopt(argc, argv, "Cd:pqs:u:vN")) != -1) + while ((ch = getopt(argc, argv, "Cd:ps:u:vN")) != -1) switch(ch) { case 'C': /* verify only */ Cflag = 1; @@ -126,9 +126,6 @@ main(argc, argv) case 'p': /* create V7 "file.orig" */ makeold = 1; break; - case 'q': - pw_big_ids_warning = 0; - break; case 's': /* change default cachesize */ openinfo.cachesize = atoi(optarg) * 1024 * 1024; break; diff --git a/usr.sbin/vipw/vipw.8 b/usr.sbin/vipw/vipw.8 index f14720f..03bb4c0 100644 --- a/usr.sbin/vipw/vipw.8 +++ b/usr.sbin/vipw/vipw.8 @@ -85,12 +85,15 @@ and the new information is not available to programs. .Sh ENVIRONMENT If the following environment variable exists it will be utilized by .Nm Ns : -.Bl -tag -width EDITOR +.Bl -tag -width PW_SCAN_BIG_IDS .It Ev EDITOR The editor specified by the string .Ev EDITOR will be invoked instead of the default editor .Xr vi 1 . +.It Ev PW_SCAN_BIG_IDS +See +.Xr pwd_mkdb 8 . .El .Sh SEE ALSO .Xr chpass 1 , |