diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-05-29 10:30:36 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-07-12 22:50:46 +0100 |
commit | 0ac9c80e0866b095b2c2376801224a9c2c1ef39e (patch) | |
tree | fab40becbf5ea40d492c04d6e43ae9ed5f826430 /bitbake/lib | |
parent | 2dbb067eba4efe3216fd4dbc0103c63f883d8ef4 (diff) | |
download | poky-0ac9c80e0866b095b2c2376801224a9c2c1ef39e.tar.gz |
bitbake: 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.
(Bitbake rev: 07d773369f571028c2cf82dd1f65d9731af6d00e)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/bb/data_smart.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py index c800a9a106..c91b51f686 100644 --- a/bitbake/lib/bb/data_smart.py +++ b/bitbake/lib/bb/data_smart.py | |||
@@ -313,6 +313,7 @@ class DataSmart(MutableMapping): | |||
313 | self.overridedata = {} | 313 | self.overridedata = {} |
314 | self.overrides = None | 314 | self.overrides = None |
315 | self.overridevars = set(["OVERRIDES", "FILE"]) | 315 | self.overridevars = set(["OVERRIDES", "FILE"]) |
316 | self.inoverride = False | ||
316 | 317 | ||
317 | def enableTracking(self): | 318 | def enableTracking(self): |
318 | self._tracking = True | 319 | self._tracking = True |
@@ -363,8 +364,13 @@ class DataSmart(MutableMapping): | |||
363 | 364 | ||
364 | def need_overrides(self): | 365 | def need_overrides(self): |
365 | if self.overrides is None: | 366 | if self.overrides is None: |
367 | if self.inoverride: | ||
368 | return | ||
369 | self.inoverride = True | ||
370 | # Can end up here recursively so setup dummy values | ||
366 | self.overrides = [] | 371 | self.overrides = [] |
367 | self.overrides = (self.getVar("OVERRIDES", True) or "").split(":") or [] | 372 | self.overrides = (self.getVar("OVERRIDES", True) or "").split(":") or [] |
373 | self.inoverride = False | ||
368 | self.expand_cache = {} | 374 | self.expand_cache = {} |
369 | 375 | ||
370 | def initVar(self, var): | 376 | def initVar(self, var): |