File tree Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Original file line number Diff line number Diff line change @@ -323,17 +323,8 @@ my $password;
323323my $escaped_password ; # the password, with special characters escaped
324324
325325sub ensure_secret_file {
326- if ( exists $ENV {HOME } ) {
327- $secret_file = $ENV {HOME } . " /.mysql_secret" ;
328- } elsif ( -d " /root" ) {
329- # If we don't have any environment this might be because we're
330- # running as a service script. Assume the user is root and that he has
331- # a standard root account.
332- $secret_file = " /root/.mysql_secret" ;
333- } else
334- {
335- die " ERROR: Found no /root home directory. Please create one." ;
336- }
326+ my $home = (getpwuid ($> ))[7];
327+ $secret_file = $home . " /.mysql_secret" ;
337328
338329 # Create safe files to avoid leaking info to other users
339330 # Loop may be extended if we need more ...
You can’t perform that action at this time.
0 commit comments