7 # If Config.pm $update_pwd_db is set then this script
8 # will be run whenever the passwd database in the jail
9 # has been changed and needs to be updated.
11 # This script will always be passed one or two arguments:
13 # update-pwd-db file [user]
15 # file - always passed. This is the full path to the
16 # file that is about to become the new etc/passwd
17 # file. It will be renamed into place after this
18 # script returns successfully.
20 # user - optionally passed. If passed then the only
21 # change to file involves the username 'user'.
23 [ -n "$1" -a -r "$1" ] ||
{ echo "update-pwd-db: error: no such passwd file: $1" >&2; exit 2; }
26 [ -z "$2" ] || user_only
="-u $2"
28 chmod 0664 etc
/master.passwd etc
/pwd.db etc
/spwd.db ||
:
32 rm -f etc
/master.passwd
33 awk -F ':' '{ print $1 ":" $2 ":" $3 ":" $4 "::0:0:" $5 ":" $6 ":" $7 }' < "$1" > etc
/master.passwd
34 PW_SCAN_BIG_IDS
=1 pwd_mkdb
-d etc
$user_only etc
/master.passwd
2>/dev
/null