blob: 24409a0fc7c61b7b5f9c2c56784d87bbe85b5ff6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
#!/bin/sh
#
# $NetBSD: linux-mkpwd.sh,v 1.2 2007/07/29 05:18:40 jlam Exp $
#
######################################################################
#
# NAME
# @LINUX_BASE@-mkpwd -- create passwd/group files for COMPAT_LINUX
#
# SYNOPSYS
# @LINUX_BASE@-mkpwd
#
# DESCRIPTION
# @LINUX_BASE@-mkpwd creates passwd and group files and databases
# for a COMPAT_LINUX installation based on the files found in
# /etc, e.g. /etc/passwd, /etc/master.passwd, /etc/group, etc.
#
######################################################################
SRCDIR=/etc
DESTDIR=@EMULDIR@/etc
[ -d $DESTDIR ] || exit 1
umask 22
cd $DESTDIR
cp -f $SRCDIR/passwd .
sed s/^wheel:/root:/ <$SRCDIR/group >group
umask 77
awk -F: '{print($1":"$2":0:0:10000::::")}' <$SRCDIR/master.passwd >shadow
sed s/^wheel:/root:/ <$SRCDIR/group |
awk -F: '{print($1":*:root:root")}' >gshadow
exit 0
|