Hello community,

here is the log from the commit of package sysuser-tools for openSUSE:Factory 
checked in at 2017-06-23 09:13:54
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/sysuser-tools (Old)
 and      /work/SRC/openSUSE:Factory/.sysuser-tools.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "sysuser-tools"

Fri Jun 23 09:13:54 2017 rev:4 rq:504694 version:2.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/sysuser-tools/sysuser-tools.changes      
2017-06-07 09:51:15.422010145 +0200
+++ /work/SRC/openSUSE:Factory/.sysuser-tools.new/sysuser-tools.changes 
2017-06-23 09:13:55.648054294 +0200
@@ -1,0 +2,22 @@
+Mon Jun 19 14:07:51 CEST 2017 - ku...@suse.de
+
+- sysuser-tools needs to require sysuser-shadow
+
+-------------------------------------------------------------------
+Mon Jun 19 13:48:34 CEST 2017 - ku...@suse.de
+
+- Add requires for shadow to sysuser-shadow
+
+-------------------------------------------------------------------
+Sun Jun 18 18:07:24 CEST 2017 - ku...@suse.de
+
+- Put helper script into own subpackage
+
+-------------------------------------------------------------------
+Sat Jun 17 09:20:09 CEST 2017 - ku...@suse.de
+
+- Convert sysusers config file to shadow arguments and use
+  shadow suite to create user and groups. Fixes [bsc#1041497] and
+  serveral dependency loops.
+
+-------------------------------------------------------------------

New:
----
  sysusers2shadow.sh

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ sysuser-tools.spec ++++++
--- /var/tmp/diff_new_pack.cB58N0/_old  2017-06-23 09:13:56.327958229 +0200
+++ /var/tmp/diff_new_pack.cB58N0/_new  2017-06-23 09:13:56.327958229 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           sysuser-tools
-Version:        1.1
+Version:        2.0
 Release:        0
 Summary:        Auto provides for system users
 License:        MIT
@@ -26,11 +26,25 @@
 Source1:        sysusers.attr
 Source2:        sysusers-generate-pre
 Source3:        macros.sysusers
+Source4:        sysusers2shadow.sh
 BuildArch:      noarch
+Requires:       sysuser-shadow
+#!BuildIgnore:  sysuser-shadow
+#!BuildIgnore:  sysuser-tools
 
 %description
 Generate auto provides for system users.
 
+%package -n sysuser-shadow
+Summary:        Tool to execute sysusers.d with shadow utilities
+Group:          System/Packages
+Requires:       shadow
+
+%description -n sysuser-shadow
+This package contians a tool, which expects as input a sysusers.d
+configuration file and uses the shadow suite to create the users
+and groups from it like systemd-sysusers would do.
+
 %prep
 %setup -qcT
 
@@ -41,6 +55,7 @@
 install -D -m 644 %{SOURCE1} 
%{buildroot}%{_prefix}/lib/rpm/fileattrs/sysusers.attr
 install -D -m 755 %{SOURCE2} 
%{buildroot}%{_prefix}/lib/rpm/sysusers-generate-pre
 install -D -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/rpm/macros.sysusers
+install -D -m 755 %{SOURCE4} %{buildroot}%{_sbindir}/sysusers2shadow
 
 %files
 %defattr(-,root,root)
@@ -49,4 +64,8 @@
 %{_prefix}/lib/rpm/fileattrs/sysusers.attr
 %{_prefix}/lib/rpm/sysusers-generate-pre
 
+%files -n sysuser-shadow
+%defattr(-,root,root)
+%{_sbindir}/sysusers2shadow
+
 %changelog

++++++ macros.sysusers ++++++
--- /var/tmp/diff_new_pack.cB58N0/_old  2017-06-23 09:13:56.363953143 +0200
+++ /var/tmp/diff_new_pack.cB58N0/_new  2017-06-23 09:13:56.363953143 +0200
@@ -13,8 +13,8 @@
 #
 ###
 
-# This is for systemctl
-%sysusers_requires     Requires(pre): systemd
+# This is for useradd/usermod/groupadd
+%sysusers_requires     Requires(pre): shadow sysuser-shadow
 
 %sysusers_generate_pre()       \
 %{_prefix}/lib/rpm/sysusers-generate-pre  "%1" > "%2".pre

++++++ sysusers-generate-pre ++++++
--- /var/tmp/diff_new_pack.cB58N0/_old  2017-06-23 09:13:56.383950318 +0200
+++ /var/tmp/diff_new_pack.cB58N0/_new  2017-06-23 09:13:56.387949753 +0200
@@ -18,7 +18,7 @@
 lines=`wc -l < "$tmpfile"`
 
 echo '#!/bin/bash'
-echo "tail -n $lines \$0 | /usr/bin/systemd-sysusers -"
+echo "tail -n $lines \$0 | /usr/sbin/sysusers2shadow"
 echo "exit 0"
 echo '######## data below ########'
 cat "$tmpfile"

++++++ sysusers2shadow.sh ++++++
#!/bin/bash

while read LINE
do
    case "$LINE" in
        \#*|"")
            ;;
        g*)
            eval arr=( $LINE )
            ARGUMENTS="${arr[1]}"
            if [ ! -z "${arr[2]}" -a "${arr[2]}" != "-" ]; then
                ARGUMENTS="-g ${arr[2]} $ARGUMENTS"
            fi
            echo "groupadd -r $ARGUMENTS"
            /usr/bin/getent group "${arr[1]}" >> /dev/null || 
/usr/sbin/groupadd -r $ARGUMENTS
            ;;
        u*)
            eval arr=( $LINE )
            ARGUMENTS="${arr[1]}"
            if [ ! -z "${arr[2]}" -a "${arr[2]}" != "-" ]; then
                ARGUMENTS="-u ${arr[2]} $ARGUMENTS"
            fi
            if [ ! -z "${arr[4]}" -a "${arr[4]}" != "-" ]; then
                ARGUMENTS="-d ${arr[4]} $ARGUMENTS"
            fi
            /usr/bin/getent group ${arr[1]} >> /dev/null 
            if [ $? -eq 0 ]; then
                ARGUMENTS="-g ${arr[1]} $ARGUMENTS"
            else
                ARGUMENTS="-U $ARGUMENTS"
            fi
            echo "useradd -r -s /sbin/nologin -c \"${arr[3]}\" $ARGUMENTS"
            /usr/bin/getent passwd ${arr[1]} >> /dev/null || /usr/sbin/useradd 
-r -s /sbin/nologin -c "${arr[3]}" $ARGUMENTS
            ;;
        m*)
            eval arr=( $LINE )
            echo "usermod -a -G ${arr[2]} ${arr[1]}"
            /usr/sbin/usermod -a -G ${arr[2]} ${arr[1]}
            ;;
        r*)
            echo "range option ignored: \"$LINE\""
            ;;
        *)
            echo "Syntax Error: \"$LINE\""
            exit 1
            ;;
    esac
done

Reply via email to