]> granicus.if.org Git - icinga2/commitdiff
'Sandboxed' property isn't properly propagated to child frames
authorGunnar Beutner <gunnar.beutner@netways.de>
Fri, 29 Jul 2016 12:11:52 +0000 (14:11 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Fri, 29 Jul 2016 12:11:52 +0000 (14:11 +0200)
refs #12247

lib/base/scriptframe.cpp

index c9aec385c20b9a1e60bfdedec32a674132680b6a..3526c08d465e0541a3c9e4d0d32c53a145aba0ba 100644 (file)
@@ -28,6 +28,11 @@ boost::thread_specific_ptr<std::stack<ScriptFrame *> > ScriptFrame::m_ScriptFram
 ScriptFrame::ScriptFrame(void)
        : Locals(new Dictionary()), Self(ScriptGlobal::GetGlobals()), Sandboxed(false), Depth(0)
 {
+       std::stack<ScriptFrame *> *frames = m_ScriptFrames.get();
+
+       if (frames && !frames->empty())
+               Sandboxed = frames->top()->Sandboxed;
+
        PushFrame(this);
 }