mirror of
https://github.com/Icinga/icinga2.git
synced 2026-06-09 00:32:12 -04:00
ifw-api: omit password from curl command in check result
Icinga (DB) Web has a special permission to show the check command line. Well-written plugins receive passwords via env vars which don't appear even there. Now ifw-api also hides the password using curl -u USER, not USER:PASS. The new command is still working, it just prompts for the password.
This commit is contained in:
parent
f63bbec4ab
commit
70f724abde
1 changed files with 2 additions and 4 deletions
|
|
@ -428,11 +428,9 @@ void IfwApiCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckRes
|
|||
}
|
||||
|
||||
if (!username.IsEmpty() && !password.IsEmpty()) {
|
||||
auto authn (username + ":" + password);
|
||||
|
||||
req->set(field::authorization, "Basic " + Base64::Encode(authn));
|
||||
req->set(field::authorization, "Basic " + Base64::Encode(username + ":" + password));
|
||||
cmdLine->Add("--user");
|
||||
cmdLine->Add(authn);
|
||||
cmdLine->Add(username);
|
||||
}
|
||||
|
||||
auto& io (IoEngine::Get().GetIoContext());
|
||||
|
|
|
|||
Loading…
Reference in a new issue