mirror of https://github.com/Icinga/icinga2.git
Merge pull request #8367 from Icinga/bugfix/ido-hash-groups
*DbObject#CalculateConfigHash(): sort groups to be hashed
This commit is contained in:
commit
79210a5542
|
@ -356,8 +356,12 @@ String HostDbObject::CalculateConfigHash(const Dictionary::Ptr& configFields) co
|
|||
|
||||
Array::Ptr groups = host->GetGroups();
|
||||
|
||||
if (groups)
|
||||
if (groups) {
|
||||
groups = groups->ShallowClone();
|
||||
ObjectLock oLock (groups);
|
||||
std::sort(groups->Begin(), groups->End());
|
||||
hashData += DbObject::HashValue(groups);
|
||||
}
|
||||
|
||||
ArrayData parents;
|
||||
|
||||
|
|
|
@ -308,8 +308,12 @@ String ServiceDbObject::CalculateConfigHash(const Dictionary::Ptr& configFields)
|
|||
|
||||
Array::Ptr groups = service->GetGroups();
|
||||
|
||||
if (groups)
|
||||
if (groups) {
|
||||
groups = groups->ShallowClone();
|
||||
ObjectLock oLock (groups);
|
||||
std::sort(groups->Begin(), groups->End());
|
||||
hashData += DbObject::HashValue(groups);
|
||||
}
|
||||
|
||||
ArrayData dependencies;
|
||||
|
||||
|
|
|
@ -150,8 +150,12 @@ String UserDbObject::CalculateConfigHash(const Dictionary::Ptr& configFields) co
|
|||
|
||||
Array::Ptr groups = user->GetGroups();
|
||||
|
||||
if (groups)
|
||||
if (groups) {
|
||||
groups = groups->ShallowClone();
|
||||
ObjectLock oLock (groups);
|
||||
std::sort(groups->Begin(), groups->End());
|
||||
hashData += DbObject::HashValue(groups);
|
||||
}
|
||||
|
||||
return SHA256(hashData);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue