forked from pool/sysuser-tools
Accepting request 1192187 from Base:System
OBS-URL: https://build.opensuse.org/request/show/1192187 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/sysuser-tools?expand=0&rev=30
This commit is contained in:
commit
814d06b564
@ -1,3 +1,14 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Aug 7 10:04:38 UTC 2024 - Thorsten Kukuk <kukuk@suse.com>
|
||||
|
||||
- usermod: revert renamed arguments
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Aug 5 14:25:14 UTC 2024 - Thorsten Kukuk <kukuk@suse.com>
|
||||
|
||||
- Implement UID:GID support for busybox
|
||||
- Reenable UID:GID support
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat Aug 3 06:09:03 UTC 2024 - Thorsten Kukuk <kukuk@suse.com>
|
||||
|
||||
|
@ -52,12 +52,11 @@ else
|
||||
continue
|
||||
fi
|
||||
|
||||
# Split user and Group id
|
||||
#userGrouArr=(${2//:/ })
|
||||
#USER_ID=${userGrouArr[0]}
|
||||
#GROUP_ID=${userGrouArr[1]}
|
||||
USER_ID=$2
|
||||
GROUP_ID=""
|
||||
# Split user and Group id. Must work with busybox sh.
|
||||
case $2 in
|
||||
(*:*) USER_ID=${2%:*} GROUP_ID=${2##*:};;
|
||||
(*) USER_ID=$2 GROUP_ID="";;
|
||||
esac
|
||||
|
||||
if [ -n "$USER_ID" ] && [ "$USER_ID" != "-" ]; then
|
||||
ARGUMENTS="-u $USER_ID $ARGUMENTS"
|
||||
@ -89,9 +88,13 @@ else
|
||||
|
||||
run /usr/sbin/useradd -r -c "$3" -d "${homedir}" $ARGUMENTS
|
||||
elif [ -x "$busybox" ]; then
|
||||
if [ -n "$GROUP_ID" ] && [ "$GROUP_ID" != "-" ]; then
|
||||
run $busybox adduser -S -H -g "$3" -G "GROUP_ID" -h "${homedir}" $ARGUMENTS
|
||||
else
|
||||
/usr/bin/getent group "$1" >> /dev/null || $busybox addgroup -S "$1"
|
||||
|
||||
run $busybox adduser -S -H -g "$3" -G "$1" -h "${homedir}" $ARGUMENTS
|
||||
fi
|
||||
else
|
||||
echo "ERROR: neither useradd nor busybox found!"
|
||||
exit 1
|
||||
|
Loading…
Reference in New Issue
Block a user