12 Commits

Author SHA256 Message Date
ea998dc599 Accepting request 1315006 from Base:System
- Remove dependency on chage

OBS-URL: https://build.opensuse.org/request/show/1315006
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/sysuser-tools?expand=0&rev=37
2025-11-03 17:54:30 +00:00
87b7175668 - Remove dependency on chage
OBS-URL: https://build.opensuse.org/package/show/Base:System/sysuser-tools?expand=0&rev=78
2025-11-01 15:49:03 +00:00
071977fd44 Accepting request 1301825 from Base:System
- Fallback to useradd if systemd is older than v257 [bsc#1248855]

OBS-URL: https://build.opensuse.org/request/show/1301825
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/sysuser-tools?expand=0&rev=36
2025-09-09 18:28:59 +00:00
3d5e218c8a OBS-URL: https://build.opensuse.org/package/show/Base:System/sysuser-tools?expand=0&rev=77 2025-08-28 16:00:53 +00:00
67e57c9e28 OBS-URL: https://build.opensuse.org/package/show/Base:System/sysuser-tools?expand=0&rev=76 2025-08-28 15:33:41 +00:00
04a3e5eebe OBS-URL: https://build.opensuse.org/package/show/Base:System/sysuser-tools?expand=0&rev=75 2025-08-28 15:28:52 +00:00
236b67f108 - Fallback to useradd if systemd is older than v257 [bsc#1248855]
OBS-URL: https://build.opensuse.org/package/show/Base:System/sysuser-tools?expand=0&rev=74
2025-08-28 15:21:11 +00:00
e76575c74c Accepting request 1301527 from Base:System
- Don't set TZ=UTC for chage to avoid dependency on env.

- Use run macro for chage for log files/debugging.

- Generate provides for "u!".

OBS-URL: https://build.opensuse.org/request/show/1301527
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/sysuser-tools?expand=0&rev=35
2025-08-27 19:34:12 +00:00
e6ce448d04 - Don't set TZ=UTC for chage to avoid dependency on env.
OBS-URL: https://build.opensuse.org/package/show/Base:System/sysuser-tools?expand=0&rev=73
2025-08-27 06:58:02 +00:00
d38ba0510d - Use run macro for chage for log files/debugging.
OBS-URL: https://build.opensuse.org/package/show/Base:System/sysuser-tools?expand=0&rev=72
2025-08-26 09:45:34 +00:00
585cbae300 - Generate provides for "u!".
OBS-URL: https://build.opensuse.org/package/show/Base:System/sysuser-tools?expand=0&rev=71
2025-08-25 07:17:57 +00:00
c2853cc7a5 sysusers.prov: support "u!"
OBS-URL: https://build.opensuse.org/package/show/Base:System/sysuser-tools?expand=0&rev=70
2025-08-25 06:19:22 +00:00
4 changed files with 37 additions and 8 deletions

View File

@@ -1,3 +1,28 @@
-------------------------------------------------------------------
Sat Nov 1 15:48:03 UTC 2025 - Thorsten Kukuk <kukuk@suse.com>
- Remove dependency on chage
-------------------------------------------------------------------
Thu Aug 28 15:16:04 UTC 2025 - Thorsten Kukuk <kukuk@suse.com>
- Fallback to useradd if systemd is older than v257 [bsc#1248855]
-------------------------------------------------------------------
Wed Aug 27 06:56:02 UTC 2025 - Thorsten Kukuk <kukuk@suse.com>
- Don't set TZ=UTC for chage to avoid dependency on env.
-------------------------------------------------------------------
Tue Aug 26 09:45:05 UTC 2025 - Thorsten Kukuk <kukuk@suse.com>
- Use run macro for chage for log files/debugging.
-------------------------------------------------------------------
Mon Aug 25 07:17:30 UTC 2025 - Thorsten Kukuk <kukuk@suse.com>
- Generate provides for "u!".
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Jul 23 18:28:04 UTC 2025 - Marcus Meissner <meissner@suse.com> Wed Jul 23 18:28:04 UTC 2025 - Marcus Meissner <meissner@suse.com>

View File

@@ -1,7 +1,7 @@
# #
# spec file for package sysuser-tools # spec file for package sysuser-tools
# #
# Copyright (c) 2025 SUSE LLC # Copyright (c) 2025 SUSE LLC and contributors
# #
# 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

View File

@@ -9,7 +9,7 @@ parse()
set -- $line set -- $line
if [ "$1" = 'g' ]; then if [ "$1" = 'g' ]; then
echo "group($2)" echo "group($2)"
elif [ "$1" = 'u' ]; then elif [ "$1" = 'u' ] || [ "$1" = 'u!' ] ; then
echo "user($2)" echo "user($2)"
echo "group($2)" echo "group($2)"
fi fi

View File

@@ -7,15 +7,19 @@ run() {
"$@" "$@"
} }
SYSTEMD_VERSION=0
if [ -x /usr/bin/systemd-sysusers ] && [ -e /proc/version ]; then if [ -x /usr/bin/systemd-sysusers ] && [ -e /proc/version ]; then
SYSTEMD_VERSION=$(systemd-sysusers --version | head -n1 | sed 's|systemd \([0-9]\+\).*|\1|g')
fi
# "u!" is only supported with systemd-sysusers v257 or newer
if [ -x /usr/bin/systemd-sysusers ] && [ -e /proc/version ] && [ $SYSTEMD_VERSION -ge 257 ]; 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=
@@ -48,7 +52,7 @@ else
;; ;;
u|u\!) u|u\!)
if [ "${1}" = "u!" ]; then if [ "${1}" = "u!" ]; then
EXPIRE_DATE="1970-01-02" LOCK_ACCOUNT=1
fi fi
shift shift
@@ -93,8 +97,8 @@ 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 if [ -n "$LOCK_ACCOUNT" ] && [ -x /usr/sbin/usermod ]; then
TZ=UTC chage -E "$EXPIRE_DATE" "$1" run /usr/sbin/usermod --expiredate 1 "$1"
fi fi
elif [ -x "$busybox" ]; then elif [ -x "$busybox" ]; then
if [ -n "$GROUP_ID" ] && [ "$GROUP_ID" != "-" ]; then if [ -n "$GROUP_ID" ] && [ "$GROUP_ID" != "-" ]; then