mirror of
https://github.com/webmin/webmin.git
synced 2026-09-17 11:00:42 +01:00
Use environment variable to set password
This commit is contained in:
@@ -56,3 +56,4 @@ Improved detection of support for views, which avoids errors with information_sc
|
||||
---- Changes since 1.370 ----
|
||||
Added an option on the backup form to create the destination directory if missing.
|
||||
Re-wrote the backup form to use the new Webmin UI library.
|
||||
The MySQL password is no longer passed on the command line.
|
||||
|
||||
@@ -89,11 +89,13 @@ local $pass = defined($_[1]) ? $_[1] : $mysql_pass;
|
||||
local $host = defined($_[2]) ? $_[2] : $config{'host'};
|
||||
local $port = defined($_[3]) ? $_[3] : $config{'port'};
|
||||
local $sock = defined($_[4]) ? $_[4] : $config{'sock'};
|
||||
$ENV{'MYSQL_PWD'} = $pass;
|
||||
return ($sock ? " -S $sock" : "").
|
||||
($host ? " -h $host" : "").
|
||||
($port ? " -P $port" : "").
|
||||
($login ? " -u ".quotemeta($login) : "").
|
||||
($pass && $mysql_version >= 4.1 ? " --password=".quotemeta($pass) :
|
||||
($mysql_version >= 5.0 ? "" : # Password comes from environment
|
||||
$pass && $mysql_version >= 4.1 ? " --password=".quotemeta($pass) :
|
||||
$pass ? " -p".quotemeta($pass) : "");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user