mdoc version three
[unix-history] / usr / src / usr.sbin / pwd_mkdb / pwd_mkdb.8
CommitLineData
aa18b838
KB
1.\" Copyright (c) 1991 The Regents of the University of California.
2.\" All rights reserved.
3.\"
68895208 4.\" %sccs.include.redist.roff%
aa18b838 5.\"
68895208 6.\" @(#)pwd_mkdb.8 5.4 (Berkeley) %G%
aa18b838 7.\"
68895208
CL
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
aa18b838 20creates
68895208 21.Xr db 3
aa18b838 22style secure and insecure databases for the specified file.
68895208
CL
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 .
aa18b838 30The file must be in the correct format (see
68895208 31.Xr passwd 5 ) .
aa18b838
KB
32It is important to note that the format used in this system is
33different from the historic Version 7 style format.
68895208 34.Pp
aa18b838 35The options are as follows:
68895208
CL
36.Bl -tag -width flag
37.It Fl p
38Create a Version 7 style password file and install it into
39.Dq Pa /etc/password .
40.El
41.Pp
aa18b838
KB
42The two databases differ in that the secure version contains the user's
43encrypted password and the insecure version has an asterisk (``*'')
68895208 44.Pp
aa18b838 45The databases are used by the C library password routines (see
68895208
CL
46.Xr getpwent 3 ) .
47.Pp
48.Nm Pwd_mkdb
aa18b838 49exits zero on success, non-zero on failure.
68895208
CL
50.Sh FILES
51.Bl -tag -width Pa -compact
52.It Pa /var/db/pwd.db
53The insecure password database file.
54.It Pa /var/db/pwd.db.tmp
55A temporary file.
56.It Pa /var/db/spwd.db
57The secure password database file.
58.It Pa /var/db/spwd.db.tmp
59A temporary file.
60.It Pa /etc/master.passwd
61The current password file.
62.It Pa /etc/passwd
63A Version 7 format password file.
64.El
65.Sh BUGS
aa18b838 66Because of the necessity for atomic update of the password files,
68895208 67.Nm pwd_mkdb
aa18b838 68uses
68895208 69.Xr rename 2
aa18b838
KB
70to install them.
71This, however, requires that the file specified on the command line live
68895208
CL
72on the same file system as the
73.Dq Pa /etc
74directory.
75.Pp
aa18b838 76There are the obvious races with multiple people running
68895208 77.Nm pwd_mkdb
aa18b838
KB
78on different password files at the same time.
79The front-ends to
68895208
CL
80.Nm pwd_mkdb ,
81.Xr chpass 1 ,
82.Xr passwd 1
aa18b838 83and
68895208 84.Xr vipw 8 ,
aa18b838 85handle the locking necessary to avoid this problem.
68895208 86.Sh COMPATIBILITY
aa18b838 87Previous versions of the system had a program similar to
68895208
CL
88.Nm pwd_mkdb ,
89.Xr mkpasswd 8 ,
aa18b838 90which built
68895208 91.Xr dbm 3
aa18b838
KB
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.
68895208
CL
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