mirror of
https://github.com/Icinga/icinga2.git
synced 2026-05-28 04:12:13 -04:00
API: Ensure that empty passwords w/ client_cn are properly checked
fixes #11482
This commit is contained in:
parent
3715f307a1
commit
d2f5008557
1 changed files with 5 additions and 1 deletions
|
|
@ -144,12 +144,16 @@ void HttpServerConnection::ProcessMessageAsync(HttpRequest& request)
|
|||
|
||||
ApiUser::Ptr user;
|
||||
|
||||
/* client_cn matched. */
|
||||
if (m_ApiUser)
|
||||
user = m_ApiUser;
|
||||
else {
|
||||
user = ApiUser::GetByName(username);
|
||||
|
||||
if (user && user->GetPassword() != password)
|
||||
/* Deny authentication if 1) given password is empty 2) configured password does not match. */
|
||||
if (password.IsEmpty())
|
||||
user.reset();
|
||||
else if (user && user->GetPassword() != password)
|
||||
user.reset();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue