]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
sanity.bbclass: skip check_userns for non-local uid
authorChangqing Li <changqing.li@windriver.com>
Thu, 17 Oct 2024 11:15:20 +0000 (19:15 +0800)
committerSteve Sakoman <steve@sakoman.com>
Fri, 3 Jan 2025 14:05:29 +0000 (06:05 -0800)
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

Signed-off-by: Changqing Li <changqing.li@windriver.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 808d0cece22bcbee15236717e158da247cbedaf1)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
meta/classes-global/sanity.bbclass

index 72dab0fea2b70bf5accd83a31eaeae536aeec496..a0b2508e1166f2c0878a39c34844492d8d3a1725 100644 (file)
@@ -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: