W├╝rgaround for changed chpasswd options
authorUlrich Dangel <uli@spamt.net>
Tue, 16 Jun 2009 13:46:54 +0000 (15:46 +0200)
committerMichael Prokop <mika@grml.org>
Tue, 16 Jun 2009 14:11:05 +0000 (16:11 +0200)
Signed-off-by: Ulrich Dangel <uli@spamt.net>
chroot-script

index 8f545cf..347bead 100755 (executable)
@@ -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