1
0
forked from pool/sysuser-tools
Dominique Leuenberger 2017-10-25 15:43:28 +00:00 committed by Git OBS Bridge
commit 26d5a4d987
3 changed files with 24 additions and 4 deletions

View File

@ -1,3 +1,21 @@
-------------------------------------------------------------------
Mon Oct 9 13:51:42 UTC 2017 - dimstar@opensuse.org
- Furhter enhance sysusers-generate-pre: inside the build
environment, it can be acceptable to be failing to create the
users (e.g when building sysuser-tools or system-user-root, since
those two packages have to be speificallty excluded). Always
return with error code 0 if /.buildenv exists.
-------------------------------------------------------------------
Wed Sep 27 11:06:52 UTC 2017 - dimstar@opensuse.org
- sysusers2shadow.sh: Exit if one of the useradd/groupadd/usermod
call fails: the resulting system is quite undefined if this
should happen.
- sysusers-generate-pre: exit the pre script with the exit code
of sysusers2shadow.sh.
-------------------------------------------------------------------
Mon Jun 19 14:07:51 CEST 2017 - kukuk@suse.de

View File

@ -19,6 +19,8 @@ lines=`wc -l < "$tmpfile"`
echo '#!/bin/bash'
echo "tail -n $lines \$0 | /usr/sbin/sysusers2shadow"
echo "exit 0"
echo 'RET=$?'
echo 'test -f /.buildenv && exit 0'
echo 'exit $RET'
echo '######## data below ########'
cat "$tmpfile"

View File

@ -12,7 +12,7 @@ do
ARGUMENTS="-g ${arr[2]} $ARGUMENTS"
fi
echo "groupadd -r $ARGUMENTS"
/usr/bin/getent group "${arr[1]}" >> /dev/null || /usr/sbin/groupadd -r $ARGUMENTS
/usr/bin/getent group "${arr[1]}" >> /dev/null || /usr/sbin/groupadd -r $ARGUMENTS || exit $?
;;
u*)
eval arr=( $LINE )
@ -30,12 +30,12 @@ do
ARGUMENTS="-U $ARGUMENTS"
fi
echo "useradd -r -s /sbin/nologin -c \"${arr[3]}\" $ARGUMENTS"
/usr/bin/getent passwd ${arr[1]} >> /dev/null || /usr/sbin/useradd -r -s /sbin/nologin -c "${arr[3]}" $ARGUMENTS
/usr/bin/getent passwd ${arr[1]} >> /dev/null || /usr/sbin/useradd -r -s /sbin/nologin -c "${arr[3]}" $ARGUMENTS || exit $?
;;
m*)
eval arr=( $LINE )
echo "usermod -a -G ${arr[2]} ${arr[1]}"
/usr/sbin/usermod -a -G ${arr[2]} ${arr[1]}
/usr/sbin/usermod -a -G ${arr[2]} ${arr[1]} || exit $?
;;
r*)
echo "range option ignored: \"$LINE\""