summaryrefslogtreecommitdiffstats
path: root/lib/bb/data_smart.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2015-05-29 10:30:36 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-07-12 22:50:27 +0100
commit07d773369f571028c2cf82dd1f65d9731af6d00e (patch)
treea45e70588efb062e21691707c953b6f68dcb6b22 /lib/bb/data_smart.py
parent41cf8d0c92d2d8a33fdad0921e424a0024914be1 (diff)
downloadopenembedded-core-contrib-07d773369f571028c2cf82dd1f65d9731af6d00e.tar.gz
data_smart: Improve override recursion handling
When expanding OVERRIDES, its possible someone might try and override a variable that is used in OVERRIDES. This could lead to infinite recursion. Add in guards against this. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/data_smart.py')
-rw-r--r--lib/bb/data_smart.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py
index c800a9a106..c91b51f686 100644
--- a/lib/bb/data_smart.py
+++ b/lib/bb/data_smart.py
@@ -313,6 +313,7 @@ class DataSmart(MutableMapping):
self.overridedata = {}
self.overrides = None
self.overridevars = set(["OVERRIDES", "FILE"])
+ self.inoverride = False
def enableTracking(self):
self._tracking = True
@@ -363,8 +364,13 @@ class DataSmart(MutableMapping):
def need_overrides(self):
if self.overrides is None:
+ if self.inoverride:
+ return
+ self.inoverride = True
+ # Can end up here recursively so setup dummy values
self.overrides = []
self.overrides = (self.getVar("OVERRIDES", True) or "").split(":") or []
+ self.inoverride = False
self.expand_cache = {}
def initVar(self, var):