Skip to contentSkip to conversation

sanity.bbclass: verify that user isn't building in PSEUDO_IGNORE_PATHS

PATCH In review Dorinda 1 participant 2 messages Jan 25, 2021

lore
Share & tools
lore

Dorinda

author
#0 lore raw

PATCH 1/1 sanity.bbclass: verify that user isn't building in PSEUDO_IGNORE_PATHS

added a check to ensure that a user isn't building in PSEUDO_IGNORE_PATHS

---
 meta/classes/sanity.bbclass | 7 +++++++
 1 file changed, 7 insertions(+)
meta/classes/sanity.bbclass +7 -0
index 2040b48595..78c0343f0d 100644
@@ -703,6 +703,13 @@ def check_sanity_version_change(status, d):
     if (tmpdirmode & stat.S_ISUID):
         status.addresult("TMPDIR is setuid, please don't build in a setuid directory")
 
+    # Check that user isn't building in PSEUDO_IGNORE_PATHS
+    pseudoignorepaths = d.getVar('PSEUDO_IGNORE_PATHS', expand=True).split(",")
+    workdir = d.getVar('WORKDIR', expand=True)
+    for i in pseudoignorepaths:
+        if workdir.startswith(i):
+            status.addresult("you are building in a path under PSEUDO_IGNORE_PATHS, please remove this" + str(i) + "directory in \nParsed WORKDIR: " + str(workdir) + "\n")
+
     # Some third-party software apparently relies on chmod etc. being suid root (!!)
     import stat
     suid_check_bins = "chown chmod mknod".split()
Signature · 1 line
2.17.1
author
#1 lore raw

Apologies please disregard this code, the update I made against this patch didn't reflect.

Quoted 34 lines · dorindabassey

added a check to ensure that a user isn't building in PSEUDO_IGNORE_PATHS

---
 meta/classes/sanity.bbclass | 7 +++++++
 1 file changed, 7 insertions(+)
meta/classes/sanity.bbclass +6 -0
index 2040b48595..78c0343f0d 100644
@@ -703,6 +703,13 @@ def check_sanity_version_change(status, d):
     if (tmpdirmode & stat.S_ISUID):
         status.addresult("TMPDIR is setuid, please don't build in a
 setuid directory")
 
+    # Check that user isn't building in PSEUDO_IGNORE_PATHS
+    pseudoignorepaths = d.getVar('PSEUDO_IGNORE_PATHS',
 expand=True).split(",")
+    workdir = d.getVar('WORKDIR', expand=True)
+    for i in pseudoignorepaths:
+        if workdir.startswith(i):
+            status.addresult("you are building in a path under

PSEUDO_IGNORE_PATHS, please remove this" + str(i) + "directory in \nParsed
WORKDIR: " + str(workdir) + "\n")
+
# Some third-party software apparently relies on chmod etc. being
suid root (!!)
import stat
suid_check_bins = "chown chmod mknod".split()
--
2.17.1