Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/packages/user-setup/user-setup-apply b/packages/user-setup/user-setup-apply
- index 56b2357..173815b 100755
- --- a/packages/user-setup/user-setup-apply
- +++ b/packages/user-setup/user-setup-apply
- @@ -25,10 +25,23 @@ fi
- # Pass in three arguments: the user, the password, and 'true' if the
- # password has been pre-crypted (by preseeding).
- setpassword () {
- - local USER PASSWD OPTS
- + local USER PASSWD OPTS VERSION LEGACY
- USER="$1"
- PASSWD="$2"
- - if [ "$3" = true ]; then
- +
- + # legacy support for versions that aren't using the PAM support
- + VERSION=`$chroot dpkg -s passwd | sed -n '/^Version:/s,^Version: ,,p'`
- + LEGACY=
- + if $chroot dpkg --compare-versions $VERSION lt 1:4.1.4-1; then
- + LEGACY=true
- + if [ "$3" = true ]; then
- + OPTS=-e
- + else
- + OPTS=-m
- + fi
- + fi
- +
- + if [ "$3" = true ] && [ -z "$LEGACY" ]; then
- $chroot $ROOT usermod --password=$PASSWD $USER
- else
- $chroot $ROOT chpasswd $OPTS <<EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement