forked from pool/sysuser-tools
Accepting request 917596 from Base:System
- Add support for new shell field [bsc#1189518] (forwarded request 917595 from kukuk) OBS-URL: https://build.opensuse.org/request/show/917596 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/sysuser-tools?expand=0&rev=20
This commit is contained in:
commit
e2411d8fe6
@ -1,3 +1,8 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Sep 8 09:12:05 UTC 2021 - Thorsten Kukuk <kukuk@suse.com>
|
||||||
|
|
||||||
|
- Add support for new shell field [bsc#1189518]
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu Jul 15 06:45:15 UTC 2021 - Thorsten Kukuk <kukuk@suse.com>
|
Thu Jul 15 06:45:15 UTC 2021 - Thorsten Kukuk <kukuk@suse.com>
|
||||||
|
|
||||||
|
@ -56,6 +56,13 @@ else
|
|||||||
homedir="$4"
|
homedir="$4"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Set shell only if not null, empty nor '-'
|
||||||
|
if [ "${5:--}" != "-" ]; then
|
||||||
|
ARGUMENTS="$ARGUMENTS -s $5"
|
||||||
|
else
|
||||||
|
ARGUMENTS="$ARGUMENTS -s /usr/sbin/nologin"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -x /usr/sbin/useradd ]; then
|
if [ -x /usr/sbin/useradd ]; then
|
||||||
if ! /usr/bin/getent passwd "$1" >> /dev/null; then
|
if ! /usr/bin/getent passwd "$1" >> /dev/null; then
|
||||||
# this is useradd/shadow specific
|
# this is useradd/shadow specific
|
||||||
@ -65,13 +72,13 @@ else
|
|||||||
ARGUMENTS="-U $ARGUMENTS"
|
ARGUMENTS="-U $ARGUMENTS"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
run /usr/sbin/useradd -r -s /usr/sbin/nologin -c "$3" -d "${homedir}" $ARGUMENTS
|
run /usr/sbin/useradd -r -c "$3" -d "${homedir}" $ARGUMENTS
|
||||||
fi
|
fi
|
||||||
elif [ -x "$busybox" ]; then
|
elif [ -x "$busybox" ]; then
|
||||||
/usr/bin/getent group "$1" >> /dev/null || $busybox addgroup -S "$1"
|
/usr/bin/getent group "$1" >> /dev/null || $busybox addgroup -S "$1"
|
||||||
|
|
||||||
if ! /usr/bin/getent passwd "$1" >> /dev/null; then
|
if ! /usr/bin/getent passwd "$1" >> /dev/null; then
|
||||||
run $busybox adduser -S -H -s /usr/sbin/nologin -g "$3" -G "$1" -h "${homedir}" $ARGUMENTS
|
run $busybox adduser -S -H -g "$3" -G "$1" -h "${homedir}" $ARGUMENTS
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "ERROR: neither useradd nor busybox found!"
|
echo "ERROR: neither useradd nor busybox found!"
|
||||||
|
Loading…
Reference in New Issue
Block a user