xref: /original-bsd/usr.sbin/pwd_mkdb/pwd_mkdb.8 (revision 0842ddeb)
1.\" Copyright (c) 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" %sccs.include.redist.roff%
5.\"
6.\"	@(#)pwd_mkdb.8	8.2 (Berkeley) 04/27/95
7.\"
8.Dd
9.Dt PWD_MKDB 8
10.Os
11.Sh NAME
12.Nm pwd_mkdb
13.Nd "generate the password databases"
14.Sh SYNOPSIS
15.Nm pwd_mkdb
16.Op Fl p
17.Ar file
18.Sh DESCRIPTION
19.Nm Pwd_mkdb
20creates
21.Xr db 3
22style secure and insecure databases for the specified file.
23These databases are then installed into
24.Dq Pa /etc/spwd.db
25and
26.Dq Pa /etc/pwd.db
27respectively.
28The file is installed into
29.Dq Pa /etc/master.passwd .
30The file must be in the correct format (see
31.Xr passwd 5 ) .
32It is important to note that the format used in this system is
33different from the historic Version 7 style format.
34.Pp
35The options are as follows:
36.Bl -tag -width flag
37.It Fl p
38Create a Version 7 style password file and install it into
39.Dq Pa /etc/passwd .
40.El
41.Pp
42The two databases differ in that the secure version contains the user's
43encrypted password and the insecure version has an asterisk (``*'')
44.Pp
45The databases are used by the C library password routines (see
46.Xr getpwent 3 ) .
47.Pp
48.Nm Pwd_mkdb
49exits zero on success, non-zero on failure.
50.Sh FILES
51.Bl -tag -width Pa -compact
52.It Pa /etc/master.passwd
53The current password file.
54.It Pa /etc/passwd
55A Version 7 format password file.
56.It Pa /etc/pwd.db
57The insecure password database file.
58.It Pa /etc/pwd.db.tmp
59A temporary file.
60.It Pa /etc/spwd.db
61The secure password database file.
62.It Pa /etc/spwd.db.tmp
63A temporary file.
64.El
65.Sh BUGS
66Because of the necessity for atomic update of the password files,
67.Nm pwd_mkdb
68uses
69.Xr rename 2
70to install them.
71This, however, requires that the file specified on the command line live
72on the same file system as the
73.Dq Pa /etc
74directory.
75.Pp
76There are the obvious races with multiple people running
77.Nm pwd_mkdb
78on different password files at the same time.
79The front-ends to
80.Nm pwd_mkdb ,
81.Xr chpass 1 ,
82.Xr passwd 1
83and
84.Xr vipw 8 ,
85handle the locking necessary to avoid this problem.
86.Sh COMPATIBILITY
87Previous versions of the system had a program similar to
88.Nm pwd_mkdb ,
89.Xr mkpasswd 8 ,
90which built
91.Xr dbm 3
92style databases for the password file but depended on the calling programs
93to install them.
94The program was renamed in order that previous users of the program
95not be surprised by the changes in functionality.
96.Sh SEE ALSO
97.Xr chpass 1 ,
98.Xr passwd 1 ,
99.Xr db 3 ,
100.Xr getpwent 3 ,
101.Xr passwd 5 ,
102.Xr vipw 8
103