| 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 |
| 37 | pwd_mkdb \- generate the password databases |
| 38 | .SH SYNOPSIS |
| 39 | .nf |
| 40 | .ft B |
| 41 | pwd_mkdb [ \-p ] file |
| 42 | .SH DESCRIPTION |
| 43 | .I Pwd_mkdb |
| 44 | creates |
| 45 | .IR db (3) |
| 46 | style secure and insecure databases for the specified file. |
| 47 | These databases are then installed into ``/etc/spwd.db'' and |
| 48 | ``/etc/pwd.db'' respectively. |
| 49 | The file is installed into ``/etc/master.passwd''. |
| 50 | The file must be in the correct format (see |
| 51 | .IR passwd (5)). |
| 52 | It is important to note that the format used in this system is |
| 53 | different from the historic Version 7 style format. |
| 54 | .PP |
| 55 | The options are as follows: |
| 56 | .TP |
| 57 | \-p |
| 58 | Create a Version 7 style password file and install it into ``/etc/password''. |
| 59 | .PP |
| 60 | The two databases differ in that the secure version contains the user's |
| 61 | encrypted password and the insecure version has an asterisk (``*'') |
| 62 | .PP |
| 63 | The databases are used by the C library password routines (see |
| 64 | .IR getpwent (3)). |
| 65 | .PP |
| 66 | .I Pwd_mkdb |
| 67 | exits 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 |
| 81 | Because of the necessity for atomic update of the password files, |
| 82 | .I pwd_mkdb |
| 83 | uses |
| 84 | .IR rename (2) |
| 85 | to install them. |
| 86 | This, however, requires that the file specified on the command line live |
| 87 | on the same file system as the ``/etc'' directory. |
| 88 | .PP |
| 89 | There are the obvious races with multiple people running |
| 90 | .I pwd_mkdb |
| 91 | on different password files at the same time. |
| 92 | The front-ends to |
| 93 | .IR pwd_mkdb , |
| 94 | .IR chpass (1), |
| 95 | .IR passwd (1) |
| 96 | and |
| 97 | .IR vipw (8), |
| 98 | handle the locking necessary to avoid this problem. |
| 99 | .SH COMPATIBILITY |
| 100 | Previous versions of the system had a program similar to |
| 101 | .I pwd_mkdb, |
| 102 | .IR mkpasswd (8), |
| 103 | which built |
| 104 | .I dbm (3) |
| 105 | style databases for the password file but depended on the calling programs |
| 106 | to install them. |
| 107 | The program was renamed in order that previous users of the program |
| 108 | not be surprised by the changes in functionality. |
| 109 | .SH SEE ALSO |
| 110 | chpass(1), passwd(1), db(3), getpwent(3), passwd(5), vipw(8) |