From 56ad67017e601c7e0f6085ca84e29c28d8d4519f Mon Sep 17 00:00:00 2001 From: Andre McCurdy Date: Wed, 1 Feb 2017 13:09:16 -0800 Subject: cooker: detect malformed BBMASK expressions which begin with a separator When constructing an older style single regex, it's possible for BBMASK to end up beginning with '|', which matches and masks _everything_. Signed-off-by: Andre McCurdy Signed-off-by: Richard Purdie --- lib/bb/cooker.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py index ce84e1c74..662a7ac07 100644 --- a/lib/bb/cooker.py +++ b/lib/bb/cooker.py @@ -1900,6 +1900,11 @@ class CookerCollectFiles(object): # that do not compile bbmasks = [] for mask in bbmask.split(): + # When constructing an older style single regex, it's possible for BBMASK + # to end up beginning with '|', which matches and masks _everything_. + if mask.startswith("|"): + collectlog.warn("BBMASK contains regular expression beginning with '|', fixing: %s" % mask) + mask = mask[1:] try: re.compile(mask) bbmasks.append(mask) -- cgit 1.2.3-korg