summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pwd_mkdb
diff options
context:
space:
mode:
authorcharnier <charnier@FreeBSD.org>1997-10-10 06:27:07 +0000
committercharnier <charnier@FreeBSD.org>1997-10-10 06:27:07 +0000
commitb93d92dbcd6b74a963fa228fcb3e6c8148017b1a (patch)
tree637981f27cf8061dedd767833027d1860432d104 /usr.sbin/pwd_mkdb
parentc4198a70c7f56d54ec13a8e63e0f03bb8ad51d5d (diff)
downloadFreeBSD-src-b93d92dbcd6b74a963fa228fcb3e6c8148017b1a.zip
FreeBSD-src-b93d92dbcd6b74a963fa228fcb3e6c8148017b1a.tar.gz
Staticize usage(). Cosmetics.
Diffstat (limited to 'usr.sbin/pwd_mkdb')
-rw-r--r--usr.sbin/pwd_mkdb/pw_scan.c7
-rw-r--r--usr.sbin/pwd_mkdb/pwd_mkdb.816
-rw-r--r--usr.sbin/pwd_mkdb/pwd_mkdb.c17
3 files changed, 24 insertions, 16 deletions
diff --git a/usr.sbin/pwd_mkdb/pw_scan.c b/usr.sbin/pwd_mkdb/pw_scan.c
index 00f640b..d474786 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 <err.h>
#include <fcntl.h>
#include <pwd.h>
-#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
@@ -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 ce40d0c..589d0e9 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 4f0e177..c856536 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 <sys/param.h>
@@ -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 <dest dir>] [-u <local username>] file\n");
+ (void)fprintf(stderr,
+"usage: pwd_mkdb [-c] [-p] [-d <dest dir>] [-u <local username>] file\n");
exit(1);
}
OpenPOWER on IntegriCloud