1 .\" $OpenBSD: pwd_mkdb.8,v 1.17 2003/06/12 12:59:52 jmc 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.1 (Berkeley) 6/6/93
37 .Nd generate the password databases
49 style secure and insecure databases for the specified file.
50 These databases are then installed into
55 The file is installed into
56 .Pa /etc/master.passwd .
57 The file must be in the correct format (see
59 It is important to note that the format used in this system is
60 different from the historic Version 7 style format.
62 The options are as follows:
66 Check if the password file is in the correct format.
67 Do not change, add, or remove any files.
70 Operate in a base directory other than the default of
72 All absolute paths (including
74 will be made relative to
76 Any directories specified as a part of
79 This option is used to create password databases in directories
87 Create a Version 7 style password file and install it into
91 Only update the secure version of the database.
92 This is most commonly used in conjunction with the
94 flag during a password change.
95 Because the insecure database doesn't contain the password there
96 is no reason to update it if the only change is in the password field.
97 Cannot be used in conjunction with the
102 Only update the record for the specified user.
103 Utilities that operate on a single user can use this option to avoid the
104 overhead of rebuilding the entire database.
105 This option must never be used if the line number of the user's record in
106 .Pa /etc/master.passwd
110 The absolute path to a file in
112 format, as described in
116 The two databases differ in that the secure version contains the user's
117 encrypted password and the insecure version has an asterisk
120 The databases are used by the C library password routines (see
124 exits zero on success, non-zero on failure.
126 .Bl -tag -width /etc/master.passwd -compact
127 .It Pa /etc/master.passwd
128 current password file
130 a Version 7 format password file
132 insecure password database file
133 .It Pa /etc/pwd.db.tmp
136 secure password database file
137 .It Pa /etc/spwd.db.tmp
148 Previous versions of the system had a program similar to
153 style databases for the password file but depended on the calling programs
155 The program was renamed in order that previous users of the program
156 not be surprised by the changes in functionality.
158 Because of the necessity for atomic update of the password files,
163 This, however, requires that the file specified on the command line live
164 on the same file system as the
168 There are the obvious races with multiple people running
170 on different password files at the same time.
177 handle the locking necessary to avoid this problem.