PW_COMPACT comment corrected.
[unix-history] / usr.sbin / pwd_mkdb / pwd_mkdb.8
CommitLineData
15637ed4
RG
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
0e7b8dd7 41pwd_mkdb [ \-p ] [ \-d directory ] file
15637ed4
RG
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''.
0e7b8dd7
SW
59.TP
60\-d
61Store databases into specified destination directory instead of ``/etc''.
15637ed4
RG
62.PP
63The two databases differ in that the secure version contains the user's
64encrypted password and the insecure version has an asterisk (``*'')
65.PP
66The databases are used by the C library password routines (see
67.IR getpwent (3)).
68.PP
69.I Pwd_mkdb
70exits zero on success, non-zero on failure.
71.SH FILES
72/var/db/pwd.db The insecure password database file
73.br
74/var/db/pwd.db.tmp A temporary file
75.br
76/var/db/spwd.db The secure password database file
77.br
78/var/db/spwd.db.tmp A temporary file
79.br
80/etc/master.passwd The current password file
81.br
82/etc/passwd A Version 7 format password file
83.SH BUGS
84Because of the necessity for atomic update of the password files,
85.I pwd_mkdb
86uses
87.IR rename (2)
88to install them.
89This, however, requires that the file specified on the command line live
90on the same file system as the ``/etc'' directory.
91.PP
92There are the obvious races with multiple people running
93.I pwd_mkdb
94on different password files at the same time.
95The front-ends to
96.IR pwd_mkdb ,
97.IR chpass (1),
98.IR passwd (1)
99and
100.IR vipw (8),
101handle the locking necessary to avoid this problem.
73b50bb1
AC
102.PP
103Standard database make routines are slow especially for big passwd
abaaaff3
AC
104files. Moreover, *pwd.db bases are too big and waste root space.
105You can have much faster routines with small *pwd.db,
106but loose binary compatibility
73b50bb1
AC
107with previous versions and with other BSD-like systems.
108If you want to setup much faster routines, define
109.B PW_COMPACT
110envirnoment variable (f.e. 'setenv PW_COMPACT' in csh) and use
111.I bootstrappwd
112target into /usr/src/Makefile.
113If you will want to return this changes back, use the same target
114without defining
115.BR PW_COMPACT .
15637ed4
RG
116.SH COMPATIBILITY
117Previous versions of the system had a program similar to
118.I pwd_mkdb,
119.IR mkpasswd (8),
120which built
121.I dbm (3)
122style databases for the password file but depended on the calling programs
123to install them.
124The program was renamed in order that previous users of the program
125not be surprised by the changes in functionality.
126.SH SEE ALSO
127chpass(1), passwd(1), db(3), getpwent(3), passwd(5), vipw(8)