--- rpms/smeserver-mysql/sme10/smeserver-mysql-2.7.0-bz11899-sclo.patch 2022/03/14 01:15:56 1.2 +++ rpms/smeserver-mysql/sme10/smeserver-mysql-2.7.0-bz11899-sclo.patch 2022/03/14 02:34:44 1.3 @@ -70,3 +70,31 @@ diff -Nur --no-dereference smeserver-mys then exit_value=0 HOME=/root +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 +--- smeserver-mysql-2.7.0.old/root/etc/e-smith/templates/var/lib/mysql/set.password 2022-03-11 10:32:13.000000000 -0500 ++++ smeserver-mysql-2.7.0/root/etc/e-smith/templates/var/lib/mysql/set.password 2022-03-13 22:32:50.035000000 -0400 +@@ -3,9 +3,20 @@ + + my $pw = esmith::util::LdapPassword(); + +- $OUT .= "use mysql;\n"; +- $OUT .= "ALTER TABLE user MODIFY Password char(41) NOT NULL default '';\n"; +- $OUT .= "UPDATE user SET password=password('$pw') WHERE user='root';\n"; +- $OUT .= "DELETE FROM user WHERE user='';\n"; ++ $OUT .= "DELIMITER //\n"; ++ $OUT .= "use mysql //\n"; ++ $OUT .= "SET \@vers := (SELECT REPLACE(SUBSTRING( \@\@VERSION , 1 , LOCATE( '.' , \@\@VERSION, LOCATE( '.' , \@\@VERSION )+1 ) ), '.','' ) ) //\n"; ++ $OUT .= "BEGIN NOT ATOMIC \n"; ++ $OUT .= "IF \@vers < 104 THEN \n"; ++ $OUT .= " ALTER TABLE user MODIFY Password char(41) NOT NULL default '';\n"; ++ $OUT .= " UPDATE user SET password=password('$pw') WHERE user='root';\n"; ++ $OUT .= " DELETE FROM db WHERE user='';\n"; ++ $OUT .= " DELETE FROM user WHERE user='';\n"; ++ $OUT .= "ELSE \n"; ++ $OUT .= " SET PASSWORD FOR 'root'\@localhost = PASSWORD(\"$pw\"); \n"; ++ $OUT .= "END IF; \n"; ++ $OUT .= "END // \n"; ++ $OUT .= "DELIMITER ; \n"; + $OUT .= "FLUSH PRIVILEGES;\n"; ++ + }