pwd_mkdb: Sort options and update usage message.
Sponsored by: Klara, Inc. Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D39266
This commit is contained in:
parent
138a5dafba
commit
508aee9681
@ -28,7 +28,7 @@
|
||||
.\" @(#)pwd_mkdb.8 8.1 (Berkeley) 6/6/93
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd October 20, 2018
|
||||
.Dd March 25, 2023
|
||||
.Dt PWD_MKDB 8
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -65,6 +65,19 @@ The options are as follows:
|
||||
Check if the password file is in the correct format.
|
||||
Do not
|
||||
change, add, or remove any files.
|
||||
.It Fl d Ar directory
|
||||
Store databases into specified destination directory instead of
|
||||
.Pa /etc .
|
||||
.It Fl i
|
||||
Ignore locking failure of the
|
||||
.Pa master.passwd
|
||||
file.
|
||||
This option is intended to be used to build password files in
|
||||
the release process over NFS where no contention can happen.
|
||||
A non-default directory must also be specified with the
|
||||
.Fl d
|
||||
option for locking to be ignored.
|
||||
Other use of this option is strongly discouraged.
|
||||
.It Fl N
|
||||
Tell
|
||||
.Nm
|
||||
@ -76,24 +89,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 i
|
||||
Ignore locking failure of the
|
||||
.Pa master.passwd
|
||||
file.
|
||||
This option is intended to be used to build password files in
|
||||
the release process over NFS where no contention can happen.
|
||||
A non-default directory must also be specified with the
|
||||
.Fl d
|
||||
option for locking to be ignored.
|
||||
Other use of this option is strongly discouraged.
|
||||
.It Fl d Ar directory
|
||||
Store databases into specified destination directory instead of
|
||||
.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
|
||||
overhead of rebuilding the entire database.
|
||||
.It Fl s Ar cachesize
|
||||
Specify in megabytes the size of the memory cache used by the
|
||||
hashing library.
|
||||
@ -104,6 +99,11 @@ As a rough guide, the memory usage of
|
||||
in megabytes will be a little bit more than twice the figure
|
||||
specified here.
|
||||
The default is 2 megabytes.
|
||||
.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
|
||||
overhead of rebuilding the entire database.
|
||||
.El
|
||||
.Pp
|
||||
The two databases differ in that the secure version contains the user's
|
||||
|
@ -123,14 +123,11 @@ main(int argc, char *argv[])
|
||||
makeold = 0;
|
||||
username = NULL;
|
||||
oldfp = NULL;
|
||||
while ((ch = getopt(argc, argv, "CNd:ips:u:v")) != -1)
|
||||
while ((ch = getopt(argc, argv, "Cd:iNps:u:v")) != -1)
|
||||
switch(ch) {
|
||||
case 'C': /* verify only */
|
||||
Cflag = 1;
|
||||
break;
|
||||
case 'N': /* do not wait for lock */
|
||||
nblock = LOCK_NB; /* will fail if locked */
|
||||
break;
|
||||
case 'd':
|
||||
dflag++;
|
||||
strlcpy(prefix, optarg, sizeof(prefix));
|
||||
@ -138,6 +135,9 @@ main(int argc, char *argv[])
|
||||
case 'i':
|
||||
iflag++;
|
||||
break;
|
||||
case 'N': /* do not wait for lock */
|
||||
nblock = LOCK_NB; /* will fail if locked */
|
||||
break;
|
||||
case 'p': /* create V7 "file.orig" */
|
||||
makeold = 1;
|
||||
break;
|
||||
@ -675,6 +675,6 @@ usage(void)
|
||||
{
|
||||
|
||||
(void)fprintf(stderr,
|
||||
"usage: pwd_mkdb [-BCiLNp] [-d directory] [-s cachesize] [-u username] file\n");
|
||||
"usage: pwd_mkdb [-CiNp] [-d directory] [-s cachesize] [-u username] file\n");
|
||||
exit(1);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user