mirror of https://github.com/Icinga/icinga2.git
Ensure that arrays are sorted for checksum calculation
This commit is contained in:
parent
26a2095426
commit
782486ce9c
|
@ -45,10 +45,15 @@ String RedisWriter::CalculateCheckSumGroups(const Array::Ptr& groups)
|
||||||
{
|
{
|
||||||
String output;
|
String output;
|
||||||
|
|
||||||
{
|
/* Ensure that checksums happen in a defined order. */
|
||||||
ObjectLock olock(groups);
|
Array::Ptr tmpGroups = groups->ShallowClone();
|
||||||
|
|
||||||
for (const String& group : groups) {
|
tmpGroups->Sort();
|
||||||
|
|
||||||
|
{
|
||||||
|
ObjectLock olock(tmpGroups);
|
||||||
|
|
||||||
|
for (const String& group : tmpGroups) {
|
||||||
output += SHA1(group);
|
output += SHA1(group);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue