Allow specification of cache-size to pwd_mkdb
PR: 5193 Reviewed by: phk Submitted by: Nick Hilliard <nick@foobar.org>
This commit is contained in:
parent
3f643d87bb
commit
e6bb224e43
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=35286
@ -42,6 +42,7 @@
|
|||||||
.Op Fl C
|
.Op Fl C
|
||||||
.Op Fl p
|
.Op Fl p
|
||||||
.Op Fl d Ar directory
|
.Op Fl d Ar directory
|
||||||
|
.Op Fl s Ar cachesize
|
||||||
.Op Fl u Ar username
|
.Op Fl u Ar username
|
||||||
.Ar file
|
.Ar file
|
||||||
.Sh DESCRIPTION
|
.Sh DESCRIPTION
|
||||||
@ -76,6 +77,14 @@ Store databases into specified destination directory instead of
|
|||||||
Only update the record for the specified user. Utilities that
|
Only update the record for the specified user. Utilities that
|
||||||
operate on a single user can use this option to avoid the
|
operate on a single user can use this option to avoid the
|
||||||
overhead of rebuilding the entire database.
|
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. On systems with a large user base, a small cache
|
||||||
|
size can lead to prohibitively long database file rebuild times.
|
||||||
|
As a rough guide, the memory usage of
|
||||||
|
.Nm pwd_mkdb
|
||||||
|
in megabytes will be a little bit more than twice the figure
|
||||||
|
specified here. The default is 2 megabytes.
|
||||||
.El
|
.El
|
||||||
.Pp
|
.Pp
|
||||||
The two databases differ in that the secure version contains the user's
|
The two databases differ in that the secure version contains the user's
|
||||||
|
@ -42,7 +42,7 @@ static const char copyright[] =
|
|||||||
static char sccsid[] = "@(#)pwd_mkdb.c 8.5 (Berkeley) 4/20/94";
|
static char sccsid[] = "@(#)pwd_mkdb.c 8.5 (Berkeley) 4/20/94";
|
||||||
#endif
|
#endif
|
||||||
static const char rcsid[] =
|
static const char rcsid[] =
|
||||||
"$Id: pwd_mkdb.c,v 1.23 1998/02/16 19:08:18 guido Exp $";
|
"$Id: pwd_mkdb.c,v 1.24 1998/02/19 08:12:11 guido Exp $";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
@ -114,7 +114,7 @@ main(argc, argv)
|
|||||||
strcpy(prefix, _PATH_PWD);
|
strcpy(prefix, _PATH_PWD);
|
||||||
makeold = 0;
|
makeold = 0;
|
||||||
username = NULL;
|
username = NULL;
|
||||||
while ((ch = getopt(argc, argv, "Cd:pu:v")) != -1)
|
while ((ch = getopt(argc, argv, "Cd:ps:u:v")) != -1)
|
||||||
switch(ch) {
|
switch(ch) {
|
||||||
case 'C': /* verify only */
|
case 'C': /* verify only */
|
||||||
Cflag = 1;
|
Cflag = 1;
|
||||||
@ -125,6 +125,9 @@ main(argc, argv)
|
|||||||
case 'p': /* create V7 "file.orig" */
|
case 'p': /* create V7 "file.orig" */
|
||||||
makeold = 1;
|
makeold = 1;
|
||||||
break;
|
break;
|
||||||
|
case 's': /* change default cachesize */
|
||||||
|
openinfo.cachesize = atoi(optarg) * 1024 * 1024;
|
||||||
|
break;
|
||||||
case 'u': /* only update this record */
|
case 'u': /* only update this record */
|
||||||
username = optarg;
|
username = optarg;
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user