mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Bug#13741677 MYSQL_SECURE_INSTALLATION DOES NOT
WORK + SAVES ROOT PASSWORD TO DISK! The secure installation scripts connect to the server by storing the password in a temporary option file. Now, if the script gets killed or fails for some reason, the removal of the option file may not take place. This patch introduces following enhancements : * (.sh) Made sure that cleanup happens at every call to 'exit 1'. This is performed implicitly by END{} in pl.in. * (.pl.in) Added a warning in case unlink fails to delete the option/query files. * (.sh/.pl.in) Added more signals to the signal handler list. SIG# 1, 3, 6, 15
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
#!/usr/bin/perl
|
||||
# -*- cperl -*-
|
||||
#
|
||||
# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -28,7 +28,7 @@ my $mysql; # How to call the mysql client
|
||||
my $rootpass = "";
|
||||
|
||||
|
||||
$SIG{QUIT} = $SIG{INT} = sub {
|
||||
$SIG{QUIT} = $SIG{INT} = $SIG{TERM} = $SIG{ABRT} = $SIG{HUP} = sub {
|
||||
print "\nAborting!\n\n";
|
||||
echo_on();
|
||||
cleanup();
|
||||
@ -242,7 +242,11 @@ sub reload_privilege_tables {
|
||||
}
|
||||
|
||||
sub cleanup {
|
||||
unlink($config,$command);
|
||||
print "Cleaning up...\n";
|
||||
|
||||
foreach my $file ($config, $command) {
|
||||
unlink $file or warn "Warning: Could not unlink $file: $!\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user