mirror of https://github.com/Icinga/icinga2.git
Fix: Add missing locks.
This commit is contained in:
parent
ec0a32380e
commit
98e20f6425
|
@ -49,6 +49,8 @@ void Host::Start(void)
|
||||||
Array::Ptr groups = GetGroups();
|
Array::Ptr groups = GetGroups();
|
||||||
|
|
||||||
if (groups) {
|
if (groups) {
|
||||||
|
ObjectLock olock(groups);
|
||||||
|
|
||||||
BOOST_FOREACH(const String& name, groups) {
|
BOOST_FOREACH(const String& name, groups) {
|
||||||
HostGroup::Ptr hg = HostGroup::GetByName(name);
|
HostGroup::Ptr hg = HostGroup::GetByName(name);
|
||||||
|
|
||||||
|
@ -70,6 +72,8 @@ void Host::Stop(void)
|
||||||
Array::Ptr groups = GetGroups();
|
Array::Ptr groups = GetGroups();
|
||||||
|
|
||||||
if (groups) {
|
if (groups) {
|
||||||
|
ObjectLock olock(groups);
|
||||||
|
|
||||||
BOOST_FOREACH(const String& name, groups) {
|
BOOST_FOREACH(const String& name, groups) {
|
||||||
HostGroup::Ptr hg = HostGroup::GetByName(name);
|
HostGroup::Ptr hg = HostGroup::GetByName(name);
|
||||||
|
|
||||||
|
|
|
@ -58,6 +58,8 @@ void Service::OnConfigLoaded(void)
|
||||||
Array::Ptr groups = GetGroups();
|
Array::Ptr groups = GetGroups();
|
||||||
|
|
||||||
if (groups) {
|
if (groups) {
|
||||||
|
ObjectLock olock(groups);
|
||||||
|
|
||||||
BOOST_FOREACH(const String& name, groups) {
|
BOOST_FOREACH(const String& name, groups) {
|
||||||
ServiceGroup::Ptr sg = ServiceGroup::GetByName(name);
|
ServiceGroup::Ptr sg = ServiceGroup::GetByName(name);
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include "icinga/usergroup.h"
|
#include "icinga/usergroup.h"
|
||||||
#include "base/dynamictype.h"
|
#include "base/dynamictype.h"
|
||||||
#include "base/utility.h"
|
#include "base/utility.h"
|
||||||
|
#include "base/objectlock.h"
|
||||||
#include <boost/smart_ptr/make_shared.hpp>
|
#include <boost/smart_ptr/make_shared.hpp>
|
||||||
|
|
||||||
using namespace icinga;
|
using namespace icinga;
|
||||||
|
@ -32,6 +33,8 @@ void User::OnConfigLoaded(void)
|
||||||
Array::Ptr groups = GetGroups();
|
Array::Ptr groups = GetGroups();
|
||||||
|
|
||||||
if (groups) {
|
if (groups) {
|
||||||
|
ObjectLock olock(groups);
|
||||||
|
|
||||||
BOOST_FOREACH(const String& name, groups) {
|
BOOST_FOREACH(const String& name, groups) {
|
||||||
UserGroup::Ptr ug = UserGroup::GetByName(name);
|
UserGroup::Ptr ug = UserGroup::GetByName(name);
|
||||||
|
|
||||||
|
@ -48,6 +51,8 @@ void User::Stop(void)
|
||||||
Array::Ptr groups = GetGroups();
|
Array::Ptr groups = GetGroups();
|
||||||
|
|
||||||
if (groups) {
|
if (groups) {
|
||||||
|
ObjectLock olock(groups);
|
||||||
|
|
||||||
BOOST_FOREACH(const String& name, groups) {
|
BOOST_FOREACH(const String& name, groups) {
|
||||||
UserGroup::Ptr ug = UserGroup::GetByName(name);
|
UserGroup::Ptr ug = UserGroup::GetByName(name);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue