/[smeserver]/rpms/smeserver-mysql/sme10/smeserver-mysql-2.7.0-bz11899-sclo.patch
ViewVC logotype

Contents of /rpms/smeserver-mysql/sme10/smeserver-mysql-2.7.0-bz11899-sclo.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (show annotations) (download)
Mon Mar 14 02:34:44 2022 UTC (2 years, 3 months ago) by jpp
Branch: MAIN
Changes since 1.2: +28 -0 lines
* Sun Mar 13 2022 Jean-Philippe Pialasse <tests@pialasse.com> 2.7.0-4.sme
- fix typo in socket, seen with phpmyadmin [SME: 11899]
- fix permissions for mariadb105 [SME: 11899]

1 diff -Nur --no-dereference smeserver-mysql-2.7.0.old/rootscl/etc/logrotate.d/mariadb_VER_ smeserver-mysql-2.7.0/rootscl/etc/logrotate.d/mariadb_VER_
2 --- smeserver-mysql-2.7.0.old/rootscl/etc/logrotate.d/mariadb_VER_ 2022-03-11 21:34:28.000000000 -0500
3 +++ smeserver-mysql-2.7.0/rootscl/etc/logrotate.d/mariadb_VER_ 2022-03-13 01:33:07.924000000 -0500
4 @@ -7,10 +7,10 @@
5 compress
6 postrotate
7 # just if mysqld is really running
8 - if test -x /opt/rh/rh-mariadb!!!VER!!!/root/usr/bin/mysqladmin && \
9 - /usr/bin/scl enable rh-mariadb!!!VER!!! -- /opt/rh/rh-mariadb!!!VER!!!/root/usr/bin/mysqladmin ping &>/dev/null
10 + if test -x /opt/rh/rh-mariadb!!!VER!!!/root/usr/bin/mysqladmin && \
11 + /usr/bin/scl enable rh-mariadb!!!VER!!! -- /opt/rh/rh-mariadb!!!VER!!!/root/usr/bin/mysqladmin --socket=!!!SOCKET!!! ping &>/dev/null
12 then
13 - /usr/bin/scl enable rh-mariadb!!!VER!!! -- /opt/rh/rh-mariadb!!!VER!!!/root/usr/bin/mysqladmin --local flush-error-log \
14 + /usr/bin/scl enable rh-mariadb!!!VER!!! -- /opt/rh/rh-mariadb!!!VER!!!/root/usr/bin/mysqladmin --socket=!!!SOCKET!!! --local flush-error-log \
15 flush-engine-log flush-general-log flush-slow-log
16 fi
17 endscript
18 diff -Nur --no-dereference smeserver-mysql-2.7.0.old/rootscl/sbin/e-smith/systemd/mariadb_VER_-initialize smeserver-mysql-2.7.0/rootscl/sbin/e-smith/systemd/mariadb_VER_-initialize
19 --- smeserver-mysql-2.7.0.old/rootscl/sbin/e-smith/systemd/mariadb_VER_-initialize 2022-03-12 00:27:43.000000000 -0500
20 +++ smeserver-mysql-2.7.0/rootscl/sbin/e-smith/systemd/mariadb_VER_-initialize 2022-03-13 01:24:53.334000000 -0500
21 @@ -34,8 +34,11 @@
22 fi
23 exit $ret
24 fi
25 - # set root password
26 - /opt/rh/rh-mariadb!!!VER!!!/root/usr/libexec/mysqld --bootstrap --datadir="$datadir" --user="mysql" < /var/lib/mysql/set.password
27 + # set root password , 104 and above have a different syntax and allow root passwordless access
28 + if [ !!!VER!!! -le 103 ]
29 + then
30 + /opt/rh/rh-mariadb!!!VER!!!/root/usr/libexec/mysqld --bootstrap --datadir="$datadir" --user="mysql" < /var/lib/mysql/set.password
31 + fi
32 # upgrade does not need to be run on a fresh datadir
33 #echo "5.7.24" >"$datadir/mysql_upgrade_info"
34 # In case we're running as root, make sure files are owned properly
35 @@ -46,7 +49,10 @@
36 /sbin/e-smith/expand-template /etc/e-smith/sql/init!!!VER!!!/00_restore_dumped_dbs
37 fi
38 else
39 - # else we set root password anyway ! just to be sure !
40 - /opt/rh/rh-mariadb!!!VER!!!/root/usr/libexec/mysqld --bootstrap --datadir="$datadir" --user="mysql" < /var/lib/mysql/set.password
41 -
42 + # else we set root password anyway ! just to be sure ! 104 and above have a different syntax and allow root passwordless access
43 + if [ !!!VER!!! -le 103 ]
44 + then
45 + /opt/rh/rh-mariadb!!!VER!!!/root/usr/libexec/mysqld --bootstrap --datadir="$datadir" --user="mysql" < /var/lib/mysql/set.password
46 + fi
47 + exit 0
48 fi
49 diff -Nur --no-dereference smeserver-mysql-2.7.0.old/rootscl/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/11configMysql_VER_ smeserver-mysql-2.7.0/rootscl/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/11configMysql_VER_
50 --- smeserver-mysql-2.7.0.old/rootscl/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/11configMysql_VER_ 2022-03-12 16:39:10.000000000 -0500
51 +++ smeserver-mysql-2.7.0/rootscl/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/11configMysql_VER_ 2022-03-13 21:14:10.966000000 -0400
52 @@ -3,7 +3,7 @@
53 $cfg['Servers'][$i]['host'] = 'localhost';
54 $cfg['Servers'][$i]['extension'] = 'mysqli';
55 $cfg['Servers'][$i]['connect_type'] = 'socket';
56 -$cfg['Servers'][$i]['socket'] = '/var/lib/mysql/mariadb!!!VER!!!.sock';
57 +$cfg['Servers'][$i]['socket'] = '!!!SOCKET!!!';
58 $cfg['Servers'][$i]['compress'] = false;
59 # standalone or login mode
60 $scriptname=end(explode('/',$_SERVER['PHP_SELF']));
61 diff -Nur --no-dereference smeserver-mysql-2.7.0.old/rootscl/sbin/e-smith/systemd/mariadb_VER_-mysql.init smeserver-mysql-2.7.0/rootscl/sbin/e-smith/systemd/mariadb_VER_-mysql.init
62 --- smeserver-mysql-2.7.0.old/rootscl/sbin/e-smith/systemd/mariadb_VER_-mysql.init 2022-03-11 20:43:05.000000000 -0500
63 +++ smeserver-mysql-2.7.0/rootscl/sbin/e-smith/systemd/mariadb_VER_-mysql.init 2022-03-13 21:13:39.386000000 -0400
64 @@ -52,7 +52,7 @@
65
66 for i in $(seq 1 10)
67 do
68 - if test -e /var/lib/mysql/mariadb!!!VER!!!.sock
69 + if test -e !!!SOCKET!!!
70 then
71 exit_value=0
72 HOME=/root
73 diff -Nur --no-dereference smeserver-mysql-2.7.0.old/root/etc/e-smith/templates/var/lib/mysql/set.password smeserver-mysql-2.7.0/root/etc/e-smith/templates/var/lib/mysql/set.password
74 --- smeserver-mysql-2.7.0.old/root/etc/e-smith/templates/var/lib/mysql/set.password 2022-03-11 10:32:13.000000000 -0500
75 +++ smeserver-mysql-2.7.0/root/etc/e-smith/templates/var/lib/mysql/set.password 2022-03-13 22:32:50.035000000 -0400
76 @@ -3,9 +3,20 @@
77
78 my $pw = esmith::util::LdapPassword();
79
80 - $OUT .= "use mysql;\n";
81 - $OUT .= "ALTER TABLE user MODIFY Password char(41) NOT NULL default '';\n";
82 - $OUT .= "UPDATE user SET password=password('$pw') WHERE user='root';\n";
83 - $OUT .= "DELETE FROM user WHERE user='';\n";
84 + $OUT .= "DELIMITER //\n";
85 + $OUT .= "use mysql //\n";
86 + $OUT .= "SET \@vers := (SELECT REPLACE(SUBSTRING( \@\@VERSION , 1 , LOCATE( '.' , \@\@VERSION, LOCATE( '.' , \@\@VERSION )+1 ) ), '.','' ) ) //\n";
87 + $OUT .= "BEGIN NOT ATOMIC \n";
88 + $OUT .= "IF \@vers < 104 THEN \n";
89 + $OUT .= " ALTER TABLE user MODIFY Password char(41) NOT NULL default '';\n";
90 + $OUT .= " UPDATE user SET password=password('$pw') WHERE user='root';\n";
91 + $OUT .= " DELETE FROM db WHERE user='';\n";
92 + $OUT .= " DELETE FROM user WHERE user='';\n";
93 + $OUT .= "ELSE \n";
94 + $OUT .= " SET PASSWORD FOR 'root'\@localhost = PASSWORD(\"$pw\"); \n";
95 + $OUT .= "END IF; \n";
96 + $OUT .= "END // \n";
97 + $OUT .= "DELIMITER ; \n";
98 $OUT .= "FLUSH PRIVILEGES;\n";
99 +
100 }

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed