diff --git a/sysuser-tools.changes b/sysuser-tools.changes index 8e7d40d..ad8c1b7 100644 --- a/sysuser-tools.changes +++ b/sysuser-tools.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Jan 27 16:41:20 UTC 2025 - Thorsten Kukuk + +- 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 diff --git a/sysuser-tools.spec b/sysuser-tools.spec index 35f8a5e..b04daa9 100644 --- a/sysuser-tools.spec +++ b/sysuser-tools.spec @@ -1,7 +1,7 @@ # # spec file for package sysuser-tools # -# Copyright (c) 2024 SUSE LLC +# Copyright (c) 2025 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed diff --git a/sysusers2shadow.sh b/sysusers2shadow.sh index bea119e..24316f5 100644 --- a/sysusers2shadow.sh +++ b/sysusers2shadow.sh @@ -46,7 +46,11 @@ else fi fi ;; - u) + u|u\!) + if [ "${1}" = "u!" ]; then + EXPIRE_DATE="1970-01-02" + fi + shift ARGUMENTS="$1" @@ -89,6 +93,9 @@ else fi 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 if [ -n "$GROUP_ID" ] && [ "$GROUP_ID" != "-" ]; then run $busybox adduser -S -H -g "$3" -G "GROUP_ID" -h "${homedir}" $ARGUMENTS