Commit | Line | Data |
---|---|---|
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 | 20 | creates |
68895208 | 21 | .Xr db 3 |
aa18b838 | 22 | style secure and insecure databases for the specified file. |
68895208 CL |
23 | These databases are then installed into |
24 | .Dq Pa /etc/spwd.db | |
25 | and | |
26 | .Dq Pa /etc/pwd.db | |
27 | respectively. | |
28 | The file is installed into | |
29 | .Dq Pa /etc/master.passwd . | |
aa18b838 | 30 | The file must be in the correct format (see |
68895208 | 31 | .Xr passwd 5 ) . |
aa18b838 KB |
32 | It is important to note that the format used in this system is |
33 | different from the historic Version 7 style format. | |
68895208 | 34 | .Pp |
aa18b838 | 35 | The options are as follows: |
68895208 CL |
36 | .Bl -tag -width flag |
37 | .It Fl p | |
38 | Create a Version 7 style password file and install it into | |
39 | .Dq Pa /etc/password . | |
40 | .El | |
41 | .Pp | |
aa18b838 KB |
42 | The two databases differ in that the secure version contains the user's |
43 | encrypted password and the insecure version has an asterisk (``*'') | |
68895208 | 44 | .Pp |
aa18b838 | 45 | The databases are used by the C library password routines (see |
68895208 CL |
46 | .Xr getpwent 3 ) . |
47 | .Pp | |
48 | .Nm Pwd_mkdb | |
aa18b838 | 49 | exits 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 | |
53 | The insecure password database file. | |
54 | .It Pa /var/db/pwd.db.tmp | |
55 | A temporary file. | |
56 | .It Pa /var/db/spwd.db | |
57 | The secure password database file. | |
58 | .It Pa /var/db/spwd.db.tmp | |
59 | A temporary file. | |
60 | .It Pa /etc/master.passwd | |
61 | The current password file. | |
62 | .It Pa /etc/passwd | |
63 | A Version 7 format password file. | |
64 | .El | |
65 | .Sh BUGS | |
aa18b838 | 66 | Because of the necessity for atomic update of the password files, |
68895208 | 67 | .Nm pwd_mkdb |
aa18b838 | 68 | uses |
68895208 | 69 | .Xr rename 2 |
aa18b838 KB |
70 | to install them. |
71 | This, however, requires that the file specified on the command line live | |
68895208 CL |
72 | on the same file system as the |
73 | .Dq Pa /etc | |
74 | directory. | |
75 | .Pp | |
aa18b838 | 76 | There are the obvious races with multiple people running |
68895208 | 77 | .Nm pwd_mkdb |
aa18b838 KB |
78 | on different password files at the same time. |
79 | The front-ends to | |
68895208 CL |
80 | .Nm pwd_mkdb , |
81 | .Xr chpass 1 , | |
82 | .Xr passwd 1 | |
aa18b838 | 83 | and |
68895208 | 84 | .Xr vipw 8 , |
aa18b838 | 85 | handle the locking necessary to avoid this problem. |
68895208 | 86 | .Sh COMPATIBILITY |
aa18b838 | 87 | Previous versions of the system had a program similar to |
68895208 CL |
88 | .Nm pwd_mkdb , |
89 | .Xr mkpasswd 8 , | |
aa18b838 | 90 | which built |
68895208 | 91 | .Xr dbm 3 |
aa18b838 KB |
92 | style databases for the password file but depended on the calling programs |
93 | to install them. | |
94 | The program was renamed in order that previous users of the program | |
95 | not 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 |