1 .\" $NetBSD: pwd_mkdb.8,v 1.28 2010/08/18 10:00:49 wiz Exp $
3 .\" Copyright (c) 1991, 1993
4 .\" The Regents of the University of California. All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
14 .\" 3. Neither the name of the University nor the names of its contributors
15 .\" may be used to endorse or promote products derived from this software
16 .\" without specific prior written permission.
18 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" from: @(#)pwd_mkdb.8 8.2 (Berkeley) 4/27/95
37 .Nd generate the password databases
50 style secure and insecure databases for the specified file.
51 These databases are then installed into
56 The file is installed into
57 .Dq Pa /etc/master.passwd .
58 The file must be in the correct format (see
60 It is important to note that the format used in this system is
61 different from the historic Version 7 style format.
63 The options are as follows:
66 Store data in big-endian format (see also
69 Specify the size of the memory cache in megabytes used by the
71 On systems with a large user base, a small cache size can lead to
72 prohibitively long database file rebuild times.
73 As a rough guide, the memory usage of
75 in megabytes will be a little bit more than twice the figure
77 If unspecified, this value will be calculated based on the size of
78 the input file up to a maximum of 8 megabytes.
80 Change the root directory of the generated files from
85 Store data in little-endian format (see also
92 Create a Version 7 style password file and install it into
95 Update the secure database only.
96 This is useful when only encrypted passwords have changed.
97 This option negates the effect of any
101 Don't re-build the database files, but instead modify or add entries
102 for the specified user only.
103 This option may only be used when the line number and user name in
104 the password file have not changed, or when adding a new user from
105 the last line in the password file.
107 Upgrade or downgrade databases to the numbered version.
110 is the old format (up to and including
112 with the 4 byte time fields and version
114 is the new format with the 8 byte time fields (greater than
122 can read and write both version
127 By default the databases stay in the version they were before the command
130 Mention when a version change occurs.
132 Print a warning if the system is using old style databases.
135 The two databases differ in that the secure version contains the user's
136 encrypted password and the insecure version has an asterisk
139 The databases are used by the C library password routines (see
142 .Bl -tag -width Pa -compact
143 .It Pa /etc/master.passwd
144 The current password file.
146 A Version 7 format password file.
148 The insecure password database file.
149 .It Pa /etc/pwd.db.tmp
152 The secure password database file.
153 .It Pa /etc/spwd.db.tmp
158 exits zero on success, non-zero on failure.
160 Previous versions of the system had a program similar to
164 style databases for the password file but depended on the calling programs
166 The program was renamed in order that previous users of the program
167 not be surprised by the changes in functionality.
182 Because of the necessity for atomic update of the password files,
187 This, however, requires that the file specified on the command line live
188 on the same file system as the
192 There are the obvious races with multiple people running
194 on different password files at the same time.
203 handle the locking necessary to avoid this problem.
205 The database files are copied when the
208 Real locking would make this unnecessary.
210 Although the DB format is endian-transparent, the data stored in
212 Also, the format doesn't lend itself to insertion or removal of
213 records from arbitrary locations in the password file.
214 This is difficult to fix without breaking compatibility.
218 option on a system where multiple users share the same UID can have