70 |
then |
then |
71 |
exit_value=0 |
exit_value=0 |
72 |
HOME=/root |
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 |
|
} |