]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.sbin/pwd_mkdb/pwd_mkdb.8
This commit was generated by cvs2svn to compensate for changes in r141867,
[FreeBSD/FreeBSD.git] / usr.sbin / pwd_mkdb / pwd_mkdb.8
1 .\" Copyright (c) 1991, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 4. Neither the name of the University nor the names of its contributors
13 .\"    may be used to endorse or promote products derived from this software
14 .\"    without specific prior written permission.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .\" SUCH DAMAGE.
27 .\"
28 .\"     @(#)pwd_mkdb.8  8.1 (Berkeley) 6/6/93
29 .\" $FreeBSD$
30 .\"
31 .Dd June 6, 1993
32 .Dt PWD_MKDB 8
33 .Os
34 .Sh NAME
35 .Nm pwd_mkdb
36 .Nd "generate the password databases"
37 .Sh SYNOPSIS
38 .Nm
39 .Op Fl C
40 .Op Fl N
41 .Op Fl p
42 .Op Fl i
43 .Op Fl d Ar directory
44 .Op Fl s Ar cachesize
45 .Op Fl u Ar username
46 .Ar file
47 .Sh DESCRIPTION
48 The
49 .Nm
50 utility creates
51 .Xr db 3
52 style secure and insecure databases for the specified file.
53 These databases are then installed into
54 .Pa /etc/spwd.db
55 and
56 .Pa /etc/pwd.db
57 respectively.
58 The file is installed into
59 .Pa /etc/master.passwd .
60 The file must be in the correct format (see
61 .Xr passwd 5 ) .
62 It is important to note that the format used in this system is
63 different from the historic Version 7 style format.
64 .Pp
65 The options are as follows:
66 .Bl -tag -width flag
67 .It Fl C
68 Check if the password file is in the correct format.
69 Do not
70 change, add, or remove any files.
71 .It Fl N
72 Tell
73 .Nm
74 to exit with an error if it cannot obtain a lock on the file.
75 By default,
76 we block waiting for a lock on the source file.
77 The lock is held through
78 the rebuilding of the database.
79 .It Fl p
80 Create a Version 7 style password file and install it into
81 .Pa /etc/passwd .
82 .It Fl i
83 Ignore locking failure of the
84 .Pa master.passwd
85 file.
86 This option is intended to be used to build password files in
87 the release process over NFS where no contention can happen.
88 A non-default directory must also be specified with the
89 .Fl d
90 option for locking to be ignored.
91 Other use of this option is strongly discouraged.
92 .It Fl d Ar directory
93 Store databases into specified destination directory instead of
94 .Pa /etc .
95 .It Fl u Ar username
96 Only update the record for the specified user.
97 Utilities that
98 operate on a single user can use this option to avoid the
99 overhead of rebuilding the entire database.
100 .It Fl s Ar cachesize
101 Specify in megabytes the size of the memory cache used by the
102 hashing library.
103 On systems with a large user base, a small cache
104 size can lead to prohibitively long database file rebuild times.
105 As a rough guide, the memory usage of
106 .Nm
107 in megabytes will be a little bit more than twice the figure
108 specified here.
109 The default is 2 megabytes.
110 .El
111 .Pp
112 The two databases differ in that the secure version contains the user's
113 encrypted password and the insecure version has an asterisk (``*'')
114 .Pp
115 The databases are used by the C library password routines (see
116 .Xr getpwent 3 ) .
117 .Pp
118 The
119 .Nm
120 utility exits zero on success, non-zero on failure.
121 .Sh ENVIRONMENT
122 If the
123 .Ev PW_SCAN_BIG_IDS
124 environment variable is set,
125 .Nm
126 will suppress the warning messages that are
127 normally generated for large user and group IDs.
128 Such IDs can cause serious problems with software
129 that makes assumptions about the values of IDs.
130 .Sh FILES
131 .Bl -tag -width Pa -compact
132 .It Pa /etc/pwd.db
133 The insecure password database file.
134 .It Pa /etc/pwd.db.tmp
135 A temporary file.
136 .It Pa /etc/spwd.db
137 The secure password database file.
138 .It Pa /etc/spwd.db.tmp
139 A temporary file.
140 .It Pa /etc/master.passwd
141 The current password file.
142 .It Pa /etc/passwd
143 A Version 7 format password file.
144 .El
145 .Sh COMPATIBILITY
146 Previous versions of the system had a program similar to
147 .Nm ,
148 .Xr mkpasswd 8 ,
149 which built
150 .Xr dbm 3
151 style databases for the password file but depended on the calling programs
152 to install them.
153 The program was renamed in order that previous users of the program
154 not be surprised by the changes in functionality.
155 .Sh SEE ALSO
156 .Xr chpass 1 ,
157 .Xr passwd 1 ,
158 .Xr db 3 ,
159 .Xr getpwent 3 ,
160 .Xr passwd 5 ,
161 .Xr vipw 8
162 .Sh BUGS
163 Because of the necessity for atomic update of the password files,
164 .Nm
165 uses
166 .Xr rename 2
167 to install them.
168 This, however, requires that the file specified on the command line live
169 on the same file system as the
170 .Pa /etc
171 directory.
172 .Pp
173 There are the obvious races with multiple people running
174 .Nm
175 on different password files at the same time.
176 The front-ends to
177 .Nm ,
178 .Xr chpass 1 ,
179 .Xr passwd 1
180 and
181 .Xr vipw 8 ,
182 handle the locking necessary to avoid this problem.