386BSD 0.1 development
[unix-history] / usr / src / usr.sbin / pwd_mkdb / pwd_mkdb.8
CommitLineData
228db66b
WJ
1.\" Copyright (c) 1991 The Regents of the University of California.
2.\" 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.\" 3. All advertising materials mentioning features or use of this software
13.\" must display the following acknowledgement:
14.\" This product includes software developed by the University of
15.\" California, Berkeley and its contributors.
16.\" 4. Neither the name of the University nor the names of its contributors
17.\" may be used to endorse or promote products derived from this software
18.\" without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" @(#)pwd_mkdb.8 5.3 (Berkeley) 6/29/91
33.\"
34.TH PWD_MKDB 8 "June 29, 1991
35.UC 7
36.SH NAME
37pwd_mkdb \- generate the password databases
38.SH SYNOPSIS
39.nf
40.ft B
41pwd_mkdb [ \-p ] file
42.SH DESCRIPTION
43.I Pwd_mkdb
44creates
45.IR db (3)
46style secure and insecure databases for the specified file.
47These databases are then installed into ``/etc/spwd.db'' and
48``/etc/pwd.db'' respectively.
49The file is installed into ``/etc/master.passwd''.
50The file must be in the correct format (see
51.IR passwd (5)).
52It is important to note that the format used in this system is
53different from the historic Version 7 style format.
54.PP
55The options are as follows:
56.TP
57\-p
58Create a Version 7 style password file and install it into ``/etc/password''.
59.PP
60The two databases differ in that the secure version contains the user's
61encrypted password and the insecure version has an asterisk (``*'')
62.PP
63The databases are used by the C library password routines (see
64.IR getpwent (3)).
65.PP
66.I Pwd_mkdb
67exits zero on success, non-zero on failure.
68.SH FILES
69/var/db/pwd.db The insecure password database file
70.br
71/var/db/pwd.db.tmp A temporary file
72.br
73/var/db/spwd.db The secure password database file
74.br
75/var/db/spwd.db.tmp A temporary file
76.br
77/etc/master.passwd The current password file
78.br
79/etc/passwd A Version 7 format password file
80.SH BUGS
81Because of the necessity for atomic update of the password files,
82.I pwd_mkdb
83uses
84.IR rename (2)
85to install them.
86This, however, requires that the file specified on the command line live
87on the same file system as the ``/etc'' directory.
88.PP
89There are the obvious races with multiple people running
90.I pwd_mkdb
91on different password files at the same time.
92The front-ends to
93.IR pwd_mkdb ,
94.IR chpass (1),
95.IR passwd (1)
96and
97.IR vipw (8),
98handle the locking necessary to avoid this problem.
99.SH COMPATIBILITY
100Previous versions of the system had a program similar to
101.I pwd_mkdb,
102.IR mkpasswd (8),
103which built
104.I dbm (3)
105style databases for the password file but depended on the calling programs
106to install them.
107The program was renamed in order that previous users of the program
108not be surprised by the changes in functionality.
109.SH SEE ALSO
110chpass(1), passwd(1), db(3), getpwent(3), passwd(5), vipw(8)