Hello community,

here is the log from the commit of package mariadb for openSUSE:Factory checked 
in at 2020-03-12 22:58:31
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/mariadb (Old)
 and      /work/SRC/openSUSE:Factory/.mariadb.new.3160 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "mariadb"

Thu Mar 12 22:58:31 2020 rev:93 rq:783185 version:10.4.12

Changes:
--------
--- /work/SRC/openSUSE:Factory/mariadb/mariadb.changes  2020-03-01 
21:25:59.368309721 +0100
+++ /work/SRC/openSUSE:Factory/.mariadb.new.3160/mariadb.changes        
2020-03-12 22:58:53.639004788 +0100
@@ -1,0 +2,5 @@
+Wed Feb 26 16:25:55 UTC 2020 - Thorsten Kukuk <ku...@suse.com>
+
+- Cleanup mysql user creation/handling and use sysusers.d
+
+-------------------------------------------------------------------

New:
----
  mysql-user.conf

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

Other differences:
------------------
++++++ mariadb.spec ++++++
--- /var/tmp/diff_new_pack.P8ZDaC/_old  2020-03-12 22:58:56.311005854 +0100
+++ /var/tmp/diff_new_pack.P8ZDaC/_new  2020-03-12 22:58:56.315005855 +0100
@@ -68,6 +68,7 @@
 Source4:        README.debug
 Source5:        suse-test-run
 Source7:        README.install
+Source12:       mysql-user.conf
 Source14:       my.ini
 Source15:       mariadb.service
 Source16:       mariadb.target
@@ -114,7 +115,6 @@
 BuildRequires:  procps
 # Some tests and myrocks_hotbackup script need python3
 BuildRequires:  python3
-BuildRequires:  shadow
 BuildRequires:  sqlite
 BuildRequires:  tcpd-devel
 # Tests requires time and ps and some perl modules
@@ -137,6 +137,12 @@
 BuildRequires:  perl(Time::HiRes)
 # Do not ever switch away from BuildRequires: pkgconfig(libsystemd); 
BuildRequires systemd/systemd-devel causes build cycles
 BuildRequires:  pkgconfig(libsystemd)
+BuildRequires:  sysuser-shadow
+BuildRequires:  sysuser-tools
+# Require mysql user
+Requires(pre):  user(mysql)
+Requires:       user(mysql)
+#!BuildIgnore:  user(mysql)
 # Required by rcmysql
 Requires:       %{name}-client
 Requires:       %{name}-errormessages = %{version}
@@ -147,7 +153,6 @@
 # myrocks_hotbackup needs MySQLdb - if we want to use it under python3, we 
need python3-mysqlclient
 Requires:       python3-mysqlclient
 Requires(post): permissions
-Requires(pre):  shadow
 Recommends:     logrotate
 Conflicts:      mariadb-server
 Conflicts:      mysql
@@ -234,10 +239,10 @@
 Requires:       %{name}-errormessages = %{version}
 # Explicit requires to pull in charsets for errormessages
 Requires:       libmariadb3 >= 3.0
-Requires(pre):  shadow
 Conflicts:      mysql-client
 Provides:       mysql-client = %{version}
 Obsoletes:      mysql-client < %{version}
+%sysusers_requires
 
 %description client
 This package contains the standard clients for MariaDB.
@@ -470,6 +475,8 @@
        -Wno-dev "$@" ..
 make %{?_smp_mflags}
 nm --numeric-sort sql/mysqld > sql/mysqld.sym
+cd ..
+%sysusers_generate_pre %{SOURCE12} mysql
 
 %install
 # Helper function to generate filelist for binaries and their manpages
@@ -690,6 +697,10 @@
 mv %{buildroot}/lib/security/pam_user_map.so %{buildroot}/%{_lib}/security/
 %endif
 
+# Install sysusers.d file
+mkdir -p %{buildroot}%{_sysusersdir}
+install -m 644 %{SOURCE12} %{buildroot}%{_sysusersdir}/
+
 %check
 cd build
 
@@ -719,23 +730,9 @@
 %endif
 
 # client does not require server and needs the user too
-%pre client
-getent group mysql >/dev/null || groupadd -r mysql
-getent passwd mysql >/dev/null || useradd -r -o -g mysql -u 60 -c "MySQL 
database admin" \
-                  -s /bin/false -d %{_localstatedir}/lib/mysql mysql
-# if mysql user is not in mysql group or if mysql user doesn't have 
'/bin/false' shell set, do so
-id -Gn mysql | grep '\bmysql\b' &>/dev/null || usermod -g mysql mysql
-getent passwd mysql | cut -d: -f7 | grep '\b/bin/false\b' &>/dev/null || 
usermod -s /bin/false mysql
-exit 0
+%pre client -f mysql.pre
 
 %pre
-getent group mysql >/dev/null || groupadd -r mysql
-getent passwd mysql >/dev/null || useradd -r -o -g mysql -u 60 -c "MySQL 
database admin" \
-                  -s /bin/false -d %{_localstatedir}/lib/mysql mysql
-# if mysql user is not in mysql group or if mysql user doesn't have 
'/bin/false' shell set, do so
-id -Gn mysql | grep '\bmysql\b' &>/dev/null || usermod -g mysql mysql
-getent passwd mysql | cut -d: -f7 | grep '\b/bin/false\b' &>/dev/null || 
usermod -s /bin/false mysql
-
 %service_add_pre mariadb.service
 
 %post
@@ -893,6 +890,7 @@
 %dir %{_libdir}/mysql
 %dir %{_libdir}/mysql/plugin
 %{_libdir}/mysql/plugin/dialog_examples.so
+%{_sysusersdir}/mysql-user.conf
 
 %files galera -f mariadb-galera.files
 %doc Docs/README.wsrep


++++++ mysql-user.conf ++++++
# Type Name ID GECOS [HOME]
u mysql 60 "MySQL database admin" /var/lib/mysql

Reply via email to