From b93d92dbcd6b74a963fa228fcb3e6c8148017b1a Mon Sep 17 00:00:00 2001 From: charnier Date: Fri, 10 Oct 1997 06:27:07 +0000 Subject: [PATCH] Staticize usage(). Cosmetics. --- lib/libc/gen/pw_scan.c | 7 +++++-- usr.sbin/pwd_mkdb/pw_scan.c | 7 +++++-- usr.sbin/pwd_mkdb/pwd_mkdb.8 | 16 ++++++++-------- usr.sbin/pwd_mkdb/pwd_mkdb.c | 17 +++++++++++------ 4 files changed, 29 insertions(+), 18 deletions(-) diff --git a/lib/libc/gen/pw_scan.c b/lib/libc/gen/pw_scan.c index 00f640bd0e9a..d4747867c94a 100644 --- a/lib/libc/gen/pw_scan.c +++ b/lib/libc/gen/pw_scan.c @@ -32,7 +32,11 @@ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)pw_scan.c 8.3 (Berkeley) 4/2/94"; +#endif +static const char rcsid[] = + "$Id$"; #endif /* not lint */ /* @@ -45,7 +49,6 @@ static char sccsid[] = "@(#)pw_scan.c 8.3 (Berkeley) 4/2/94"; #include #include #include -#include #include #include #include @@ -133,7 +136,7 @@ pw_scan(bp, pw) } if(p[0]) pw->pw_fields |= _PWF_SHELL; - if (p = strsep(&bp, ":")) { /* too many */ + if ((p = strsep(&bp, ":"))) { /* too many */ fmt: warnx("corrupted entry"); return (0); } diff --git a/usr.sbin/pwd_mkdb/pw_scan.c b/usr.sbin/pwd_mkdb/pw_scan.c index 00f640bd0e9a..d4747867c94a 100644 --- a/usr.sbin/pwd_mkdb/pw_scan.c +++ b/usr.sbin/pwd_mkdb/pw_scan.c @@ -32,7 +32,11 @@ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)pw_scan.c 8.3 (Berkeley) 4/2/94"; +#endif +static const char rcsid[] = + "$Id$"; #endif /* not lint */ /* @@ -45,7 +49,6 @@ static char sccsid[] = "@(#)pw_scan.c 8.3 (Berkeley) 4/2/94"; #include #include #include -#include #include #include #include @@ -133,7 +136,7 @@ pw_scan(bp, pw) } if(p[0]) pw->pw_fields |= _PWF_SHELL; - if (p = strsep(&bp, ":")) { /* too many */ + if ((p = strsep(&bp, ":"))) { /* too many */ fmt: warnx("corrupted entry"); return (0); } diff --git a/usr.sbin/pwd_mkdb/pwd_mkdb.8 b/usr.sbin/pwd_mkdb/pwd_mkdb.8 index ce40d0c1bdaa..589d0e98f4dd 100644 --- a/usr.sbin/pwd_mkdb/pwd_mkdb.8 +++ b/usr.sbin/pwd_mkdb/pwd_mkdb.8 @@ -50,12 +50,12 @@ creates .Xr db 3 style secure and insecure databases for the specified file. These databases are then installed into -.Dq Pa /etc/spwd.db +.Pa /etc/spwd.db and -.Dq Pa /etc/pwd.db +.Pa /etc/pwd.db respectively. The file is installed into -.Dq Pa /etc/master.passwd . +.Pa /etc/master.passwd . The file must be in the correct format (see .Xr passwd 5 ) . It is important to note that the format used in this system is @@ -68,10 +68,10 @@ Check if the password file is in the correct format. Do not change, add, or remove any files. .It Fl p Create a Version 7 style password file and install it into -.Dq Pa /etc/passwd . +.Pa /etc/passwd . .It Fl d Ar directory Store databases into specified destination directory instead of -.Dq Pa /etc . +.Pa /etc . .It Fl u Ar username Only update the record for the specified user. Utilities that operate on a single user can use this option to avoid the @@ -103,17 +103,17 @@ A Version 7 format password file. .El .Sh BUGS Because of the necessity for atomic update of the password files, -.Nm pwd_mkdb +.Nm uses .Xr rename 2 to install them. This, however, requires that the file specified on the command line live on the same file system as the -.Dq Pa /etc +.Pa /etc directory. .Pp There are the obvious races with multiple people running -.Nm pwd_mkdb +.Nm on different password files at the same time. The front-ends to .Nm pwd_mkdb , diff --git a/usr.sbin/pwd_mkdb/pwd_mkdb.c b/usr.sbin/pwd_mkdb/pwd_mkdb.c index 4f0e17758cee..c856536d8f54 100644 --- a/usr.sbin/pwd_mkdb/pwd_mkdb.c +++ b/usr.sbin/pwd_mkdb/pwd_mkdb.c @@ -32,13 +32,17 @@ */ #ifndef lint -static char copyright[] = +static const char copyright[] = "@(#) Copyright (c) 1991, 1993, 1994\n\ The Regents of the University of California. All rights reserved.\n"; #endif /* not lint */ #ifndef lint +#if 0 static char sccsid[] = "@(#)pwd_mkdb.c 8.5 (Berkeley) 4/20/94"; +#endif +static const char rcsid[] = + "$Id$"; #endif /* not lint */ #include @@ -85,7 +89,7 @@ void error __P((char *)); void cp __P((char *, char *, mode_t mode)); void mv __P((char *, char *)); int scan __P((FILE *, struct passwd *)); -void usage __P((void)); +static void usage __P((void)); int main(argc, argv) @@ -278,7 +282,7 @@ main(argc, argv) if (!Cflag && (pwd.pw_name[0] == '+' || pwd.pw_name[0] == '-')) yp_enabled = 1; -#define COMPACT(e) t = e; while (*p++ = *t++); +#define COMPACT(e) t = e; while ((*p++ = *t++)); if (!Cflag && (!username || (strcmp(username, pwd.pw_name) == 0))) { /* Create insecure data. */ @@ -538,7 +542,7 @@ error(name) char *name; { - warn(name); + warn("%s", name); cleanup(); exit(1); } @@ -563,10 +567,11 @@ cleanup() } } -void +static void usage() { - (void)fprintf(stderr, "usage: pwd_mkdb [-c] [-p] [-d ] [-u ] file\n"); + (void)fprintf(stderr, +"usage: pwd_mkdb [-c] [-p] [-d ] [-u ] file\n"); exit(1); }