Dominique Leuenberger 2024-07-31 11:27:57 +00:00 committed by Git OBS Bridge
commit 26683fb2a0
4 changed files with 28 additions and 12 deletions

View File

@ -1,7 +1,5 @@
# Disable usage of systemd-sysusers for SLE15 to stay compatible
--- sysusers2shadow.sh.old 2021-09-08 15:06:18.000000000 +0200
+++ sysusers2shadow.sh 2021-11-26 10:37:20.911541368 +0100
--- sysusers2shadow.sh.old 2024-07-04 14:24:01.013092683 +0200
+++ sysusers2shadow.sh 2024-07-04 14:28:06.701540250 +0200
@@ -7,14 +7,6 @@
"$@"
}
@ -14,10 +12,10 @@
- # Use systemd-sysusers and let it read the input directly from stdin
- run /usr/bin/systemd-sysusers $REPLACE_ARG -
-else
# Absolute path to busybox, if found
busybox=
@@ -115,4 +115,3 @@
for i in /bin/busybox /usr/bin/busybox; do [ -x "$i" ] && busybox=$i; done
@@ -126,4 +118,3 @@
;;
esac
done

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Mon Jul 1 15:01:19 UTC 2024 - Johannes Weberhofer <jweberhofer@weberhofer.at>
- Allow setting of UID:GID for as defined in sysusers.d
-------------------------------------------------------------------
Tue Nov 7 10:07:20 UTC 2023 - Dominique Leuenberger <dimstar@opensuse.org>

View File

@ -1,7 +1,7 @@
#
# spec file for package sysuser-tools
#
# Copyright (c) 2023 SUSE LLC
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -17,7 +17,7 @@
Name: sysuser-tools
Version: 3.2
Version: 3.3
Release: 0
Summary: Auto provides for system users
License: MIT

View File

@ -15,7 +15,6 @@ if [ -x /usr/bin/systemd-sysusers ] && [ -e /proc/version ]; then
# Use systemd-sysusers and let it read the input directly from stdin
run /usr/bin/systemd-sysusers $REPLACE_ARG -
else
# Absolute path to busybox, if found
busybox=
for i in /bin/busybox /usr/bin/busybox; do [ -x "$i" ] && busybox=$i; done
@ -48,9 +47,23 @@ else
u)
shift
ARGUMENTS="$1"
if [ -n "${2-}" ] && [ "$2" != "-" ]; then
ARGUMENTS="-u $2 $ARGUMENTS"
# Split user and Group id
userGrouArr=(${2//:/ })
USER_ID=${userGrouArr[0]}
GROUP_ID=${userGrouArr[1]}
if [ -n "$USER_ID" ] && [ "$USER_ID" != "-" ]; then
ARGUMENTS="-u $USER_ID $ARGUMENTS"
fi
if [ -n "$GROUP_ID" ] && [ "$GROUP_ID" != "-" ]; then
ARGUMENTS="-g $GROUP_ID $ARGUMENTS"
else
if [ "$USER_ID" == "-" ]; then
ARGUMENTS="-U $ARGUMENTS"
fi
fi
homedir="/" # If null, empty or '-'
if [ "${4:--}" != "-" ]; then
homedir="$4"
@ -69,7 +82,7 @@ else
if /usr/bin/getent group "$1" >> /dev/null; then
ARGUMENTS="-g $1 $ARGUMENTS"
else
ARGUMENTS="-U $ARGUMENTS"
ARGUMENTS="$ARGUMENTS"
fi
run /usr/sbin/useradd -r -c "$3" -d "${homedir}" $ARGUMENTS