Skip to contentSkip to conversation

sanity.bbclass: skip check_userns for non-local uid

PATCH New [email protected] 1 participant 1 message Jan 3, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sanity.bbclass: skip check_userns for non-local uid

From: Changqing Li <[email protected]>

Bitbake preserve network for non-local uid, refer [1], so check_userns is not needed for non-local uid

[1] https://git.openembedded.org/bitbake/commit/?id=4eafae7904bae6e5c6bc50356e8a9077f2e207fa

---
 meta/classes-global/sanity.bbclass | 2 ++
 1 file changed, 2 insertions(+)
meta/classes-global/sanity.bbclass +2 -0
index 72dab0fea2..a0b2508e11 100644
@@ -484,6 +484,8 @@ def check_userns():
     # succeeds (at which point the uid is nobody) but writing to the uid_map
     # fails (so the uid isn't reset back to the user's uid). We can detect this.
     parentuid = os.getuid()
+    if not bb.utils.is_local_uid(parentuid):
+        return None
     pid = os.fork()
     if not pid:
         try:
Signature · 1 line
2.25.1