Compare commits
No commits in common. "factory" and "devel" have entirely different histories.
22
disable-systemd-sysusers.patch
Normal file
22
disable-systemd-sysusers.patch
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
--- 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 @@
|
||||||
|
"$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
-if [ -x /usr/bin/systemd-sysusers ] && [ -e /proc/version ]; then
|
||||||
|
-
|
||||||
|
- if [ -n "$1" ] && [ "$1" != "%3" ]; then
|
||||||
|
- REPLACE_ARG="--replace=/usr/lib/sysusers.d/$1" ||:
|
||||||
|
- fi
|
||||||
|
- # 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
|
||||||
|
@@ -126,4 +118,3 @@
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
-fi
|
@ -1,31 +1,3 @@
|
|||||||
-------------------------------------------------------------------
|
|
||||||
Mon Jan 27 16:41:20 UTC 2025 - Thorsten Kukuk <kukuk@suse.com>
|
|
||||||
|
|
||||||
- Add support for "u!" with useradd (shadow). busybox has no
|
|
||||||
support for account/password expiration
|
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
|
||||||
Wed Dec 11 11:05:25 UTC 2024 - Thorsten Kukuk <kukuk@suse.com>
|
|
||||||
|
|
||||||
- Directly check return value of systemd-sysusers
|
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
|
||||||
Mon Dec 9 06:30:23 UTC 2024 - Thorsten Kukuk <kukuk@suse.com>
|
|
||||||
|
|
||||||
- Drop SLE15 support and remove disable-systemd-sysusers.patch
|
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
|
||||||
Mon Dec 9 05:59:25 UTC 2024 - Thorsten Kukuk <kukuk@suse.com>
|
|
||||||
|
|
||||||
- sysuser-shadow: remove systemd 238 dependency, this does not
|
|
||||||
work in a single RPM transaction [bsc#1234277]. Call
|
|
||||||
systemd-sysuser instead again without --replace.
|
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
|
||||||
Wed Aug 7 13:42:07 UTC 2024 - Thorsten Kukuk <kukuk@suse.com>
|
|
||||||
|
|
||||||
- Remove check for .buildenv to see failures in OBS
|
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Wed Aug 7 10:04:38 UTC 2024 - Thorsten Kukuk <kukuk@suse.com>
|
Wed Aug 7 10:04:38 UTC 2024 - Thorsten Kukuk <kukuk@suse.com>
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package sysuser-tools
|
# spec file for package sysuser-tools
|
||||||
#
|
#
|
||||||
# Copyright (c) 2025 SUSE LLC
|
# Copyright (c) 2024 SUSE LLC
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@ -27,6 +27,7 @@ Source1: sysusers.attr
|
|||||||
Source2: sysusers-generate-pre
|
Source2: sysusers-generate-pre
|
||||||
Source3: macros.sysusers
|
Source3: macros.sysusers
|
||||||
Source4: sysusers2shadow.sh
|
Source4: sysusers2shadow.sh
|
||||||
|
Patch0: disable-systemd-sysusers.patch
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
Requires: sysuser-shadow
|
Requires: sysuser-shadow
|
||||||
#!BuildIgnore: sysuser-shadow
|
#!BuildIgnore: sysuser-shadow
|
||||||
@ -42,6 +43,12 @@ Group: System/Packages
|
|||||||
Requires(pre): (/usr/sbin/useradd or busybox)
|
Requires(pre): (/usr/sbin/useradd or busybox)
|
||||||
# prefer original shadow over busybox by default
|
# prefer original shadow over busybox by default
|
||||||
Suggests: shadow
|
Suggests: shadow
|
||||||
|
# sysusers2shdow uses sysusers2shadow uses systemd-sysusers if available. And we might pass --replace to it
|
||||||
|
# --replace only appeared in systemd 238,so we want to ensure: if we have systemd, it must be recent enough
|
||||||
|
# the Requires(pre) statement is to ensure we get it at any moment recent enough, not only at the end of
|
||||||
|
# transactions, otherwise upgrades might randomly fail
|
||||||
|
Requires(pre): (systemd >= 238 if systemd)
|
||||||
|
Requires: (systemd >= 238 if systemd)
|
||||||
|
|
||||||
%description -n sysuser-shadow
|
%description -n sysuser-shadow
|
||||||
This package contians a tool, which expects as input a sysusers.d
|
This package contians a tool, which expects as input a sysusers.d
|
||||||
@ -50,6 +57,9 @@ and groups from it like systemd-sysusers would do.
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -qcT
|
%setup -qcT
|
||||||
|
%if 0%{?suse_version} <= 1500
|
||||||
|
patch < %_sourcedir/disable-systemd-sysusers.patch %_sourcedir/sysusers2shadow.sh
|
||||||
|
%endif
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
|
||||||
@ -72,7 +82,7 @@ m me nogroup
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat <<EOFF > expected-account-pre
|
cat <<EOFF > expected-account-pre
|
||||||
/usr/sbin/sysusers2shadow me.conf <<"EOF"
|
/usr/sbin/sysusers2shadow me.conf <<"EOF" || [ -f /.buildenv ]
|
||||||
u me - "myself" /dev/null
|
u me - "myself" /dev/null
|
||||||
m me nogroup
|
m me nogroup
|
||||||
g asdf
|
g asdf
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# pass systemd sysusers config paths as argument to this script.
|
# pass systemd sysusers config paths as argument to this script.
|
||||||
|
|
||||||
echo "/usr/sbin/sysusers2shadow $2 <<\"EOF\""
|
echo "/usr/sbin/sysusers2shadow $2 <<\"EOF\" || [ -f /.buildenv ]"
|
||||||
(while read -r line; do if [[ $line =~ ^\s*[ugmr] ]]; then echo "$line"; fi; done) < "$1"
|
(while read -r line; do if [[ $line =~ ^\s*[ugmr] ]]; then echo "$line"; fi; done) < "$1"
|
||||||
echo 'EOF'
|
echo 'EOF'
|
||||||
|
@ -10,12 +10,10 @@ run() {
|
|||||||
if [ -x /usr/bin/systemd-sysusers ] && [ -e /proc/version ]; then
|
if [ -x /usr/bin/systemd-sysusers ] && [ -e /proc/version ]; then
|
||||||
|
|
||||||
if [ -n "$1" ] && [ "$1" != "%3" ]; then
|
if [ -n "$1" ] && [ "$1" != "%3" ]; then
|
||||||
REPLACE_ARG="--replace=/usr/lib/sysusers.d/$1"
|
REPLACE_ARG="--replace=/usr/lib/sysusers.d/$1" ||:
|
||||||
fi
|
fi
|
||||||
# Use systemd-sysusers and let it read the input directly from stdin
|
# Use systemd-sysusers and let it read the input directly from stdin
|
||||||
if ! run /usr/bin/systemd-sysusers $REPLACE_ARG - ; then
|
run /usr/bin/systemd-sysusers $REPLACE_ARG -
|
||||||
run /usr/bin/systemd-sysusers -
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
# Absolute path to busybox, if found
|
# Absolute path to busybox, if found
|
||||||
busybox=
|
busybox=
|
||||||
@ -46,11 +44,7 @@ else
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
u|u\!)
|
u)
|
||||||
if [ "${1}" = "u!" ]; then
|
|
||||||
EXPIRE_DATE="1970-01-02"
|
|
||||||
fi
|
|
||||||
|
|
||||||
shift
|
shift
|
||||||
ARGUMENTS="$1"
|
ARGUMENTS="$1"
|
||||||
|
|
||||||
@ -93,9 +87,6 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
run /usr/sbin/useradd -r -c "$3" -d "${homedir}" $ARGUMENTS
|
run /usr/sbin/useradd -r -c "$3" -d "${homedir}" $ARGUMENTS
|
||||||
if [ -n "$EXPIRE_DATE" ]; then
|
|
||||||
TZ=UTC chage -E "$EXPIRE_DATE" "$1"
|
|
||||||
fi
|
|
||||||
elif [ -x "$busybox" ]; then
|
elif [ -x "$busybox" ]; then
|
||||||
if [ -n "$GROUP_ID" ] && [ "$GROUP_ID" != "-" ]; then
|
if [ -n "$GROUP_ID" ] && [ "$GROUP_ID" != "-" ]; then
|
||||||
run $busybox adduser -S -H -g "$3" -G "GROUP_ID" -h "${homedir}" $ARGUMENTS
|
run $busybox adduser -S -H -g "$3" -G "GROUP_ID" -h "${homedir}" $ARGUMENTS
|
||||||
|
Loading…
x
Reference in New Issue
Block a user