mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-27 07:34:15 +02:00
Merge pull request #8316 from Icinga/bugfix/ido-hash-groups
*DbObject#CalculateConfigHash(): sort groups to be hashed
This commit is contained in:
commit
5ee7eb8f29
@ -356,8 +356,12 @@ String HostDbObject::CalculateConfigHash(const Dictionary::Ptr& configFields) co
|
|||||||
|
|
||||||
Array::Ptr groups = host->GetGroups();
|
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);
|
hashData += DbObject::HashValue(groups);
|
||||||
|
}
|
||||||
|
|
||||||
ArrayData parents;
|
ArrayData parents;
|
||||||
|
|
||||||
|
@ -308,8 +308,12 @@ String ServiceDbObject::CalculateConfigHash(const Dictionary::Ptr& configFields)
|
|||||||
|
|
||||||
Array::Ptr groups = service->GetGroups();
|
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);
|
hashData += DbObject::HashValue(groups);
|
||||||
|
}
|
||||||
|
|
||||||
ArrayData dependencies;
|
ArrayData dependencies;
|
||||||
|
|
||||||
|
@ -150,8 +150,12 @@ String UserDbObject::CalculateConfigHash(const Dictionary::Ptr& configFields) co
|
|||||||
|
|
||||||
Array::Ptr groups = user->GetGroups();
|
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);
|
hashData += DbObject::HashValue(groups);
|
||||||
|
}
|
||||||
|
|
||||||
return SHA256(hashData);
|
return SHA256(hashData);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user