mirror of
https://github.com/Corfirean/coa-server-manager.git
synced 2026-11-22 03:25:56 +00:00
fix(csm_plugins): handle password and env_remove properly in reconcile_squid
This commit is contained in:
1 parent
873db420c0
commit
68e9d7d0cf
1 file changed
+3
-1
@@ -226,8 +226,10 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let query_fn = |sql: &str| -> Result<String, coa_core::error::Error> {
|
||||
let mut cmd = std::process::Command::new(&mysql_exe);
|
||||
cmd.args(["-h", "127.0.0.1", "-P", &port_str, "-u", &user, "-e", sql]);
|
||||
if !pass.is_empty() {
|
||||
if !pass.is_empty() && pass != "trap" {
|
||||
cmd.env("MYSQL_PWD", &pass);
|
||||
} else {
|
||||
cmd.env_remove("MYSQL_PWD");
|
||||
}
|
||||
let out = cmd.output().map_err(coa_core::error::Error::Io)?;
|
||||
if !out.status.success() {
|
||||
|
||||
Reference in new issue
Block a user