From 65c58bfa1cc8e90ecfa0d576a64e08a790c57d7e Mon Sep 17 00:00:00 2001 From: Ulrich Dangel Date: Tue, 16 Jun 2009 15:46:54 +0200 Subject: [PATCH] =?utf8?q?W=C3=BCrgaround=20for=20changed=20chpasswd=20opt?= =?utf8?q?ions?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Ulrich Dangel --- chroot-script | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/chroot-script b/chroot-script index 8f545cf..347bead 100755 --- a/chroot-script +++ b/chroot-script @@ -221,8 +221,14 @@ passwords() echo "Activating shadow passwords." shadowconfig on + CHPASSWD_OPTION= + if chpasswd --help 2>&1 | grep -q -- '-m,' ; then + CHPASSWD_OPTION='-m' + fi + + if [ -n "$ROOTPASSWORD" ] ; then - echo root:"$ROOTPASSWORD" | chpasswd -m + echo root:"$ROOTPASSWORD" | chpasswd $CHPASSWD_OPTION export ROOTPASSWORD='' else a='1' @@ -240,7 +246,7 @@ passwords() a='1' b='2' else - echo root:"$a" | chpasswd -m + echo root:"$a" | chpasswd $CHPASSWD_OPTION unset a unset b fi -- 2.1.4