busybox: add shadow password support

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2011-08-08 11:22:17 +02:00
parent 4785913640
commit 7e9db72b22
3 changed files with 14 additions and 4 deletions

View File

@ -92,7 +92,16 @@ add_user() {
mkdir -p ${INSTALL}/etc
touch ${INSTALL}/etc/passwd
if [ -z "`grep "$1:" ${INSTALL}/etc/passwd`" ]; then
echo "$1:$2:$3:$4:$5:$6:$7" >> ${INSTALL}/etc/passwd
echo "$1:x:$3:$4:$5:$6:$7" >> ${INSTALL}/etc/passwd
fi
touch ${INSTALL}/etc/shadow
PASSWORD="$2"
if [ "$PASSWORD" = "x" ]; then
PASSWORD="*"
fi
if [ -z "`grep "$1:" ${INSTALL}/etc/shadow`" ]; then
echo "$1:$PASSWORD:::::::" >> ${INSTALL}/etc/shadow
fi
}

View File

@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Busybox version: 1.18.5
# Sat Aug 6 19:21:09 2011
# Sun Aug 7 23:33:27 2011
#
CONFIG_HAVE_DOT_CONFIG=y
@ -432,9 +432,9 @@ CONFIG_INIT_TERMINAL_TYPE=""
#
# CONFIG_ADD_SHELL is not set
# CONFIG_REMOVE_SHELL is not set
# CONFIG_FEATURE_SHADOWPASSWDS is not set
CONFIG_FEATURE_SHADOWPASSWDS=y
CONFIG_USE_BB_PWD_GRP=y
# CONFIG_USE_BB_SHADOW is not set
CONFIG_USE_BB_SHADOW=y
CONFIG_USE_BB_CRYPT=y
CONFIG_USE_BB_CRYPT_SHA=y
# CONFIG_ADDUSER is not set

View File

@ -45,6 +45,7 @@ USER_PWD="`$ROOT/$TOOLCHAIN/bin/cryptpw -m sha512 $USER_PASSWORD`"
mkdir -p $INSTALL/etc
cp $PKG_DIR/config/profile $INSTALL/etc
cp $PKG_DIR/config/httpd.conf $INSTALL/etc
echo "chmod 000 $INSTALL/etc/shadow" >> $FAKEROOT_SCRIPT
# /etc/fstab is needed by...
touch $INSTALL/etc/fstab