All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sstate.bbclass: apply proper umask when fetching from SSTATE_MIRROR
@ 2025-06-06  9:39 Rasmus Villemoes
  2025-06-13 16:30 ` Richard Purdie
  2025-06-15 21:17 ` Richard Purdie
  0 siblings, 2 replies; 8+ messages in thread
From: Rasmus Villemoes @ 2025-06-06  9:39 UTC (permalink / raw)
  To: openembedded-core; +Cc: Richard Purdie, Rasmus Villemoes

From: Rasmus Villemoes <ravi@prevas.dk>

Currently, files and directories created under ${SSTATE_DIR} when
fetching from an sstate mirror are not created with group write,
unlike when the sstate artifacts are generated locally. That's
inconsistent, and problematic when the local sstate dir is shared
among multiple users.

Wrap the fetching in a bb.utils.umask() context manager, and for simplicity
move the mkdir of SSTATE_DIR inside that.

Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
---
 meta/classes-global/sstate.bbclass | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/meta/classes-global/sstate.bbclass b/meta/classes-global/sstate.bbclass
index 1d7b033b80..2968cc4c2e 100644
--- a/meta/classes-global/sstate.bbclass
+++ b/meta/classes-global/sstate.bbclass
@@ -726,7 +726,6 @@ def pstaging_fetch(sstatefetch, d):
     localdata = bb.data.createCopy(d)
 
     dldir = localdata.expand("${SSTATE_DIR}")
-    bb.utils.mkdirhier(dldir)
 
     localdata.delVar('MIRRORS')
     localdata.setVar('FILESPATH', dldir)
@@ -746,16 +745,19 @@ def pstaging_fetch(sstatefetch, d):
     if bb.utils.to_boolean(d.getVar("SSTATE_VERIFY_SIG"), False):
         uris += ['file://{0}.sig;downloadfilename={0}.sig'.format(sstatefetch)]
 
-    for srcuri in uris:
-        localdata.delVar('SRC_URI')
-        localdata.setVar('SRC_URI', srcuri)
-        try:
-            fetcher = bb.fetch2.Fetch([srcuri], localdata, cache=False)
-            fetcher.checkstatus()
-            fetcher.download()
+    with bb.utils.umask(0o002):
+        bb.utils.mkdirhier(dldir)
 
-        except bb.fetch2.BBFetchException:
-            pass
+        for srcuri in uris:
+            localdata.delVar('SRC_URI')
+            localdata.setVar('SRC_URI', srcuri)
+            try:
+                fetcher = bb.fetch2.Fetch([srcuri], localdata, cache=False)
+                fetcher.checkstatus()
+                fetcher.download()
+
+            except bb.fetch2.BBFetchException:
+                pass
 
 def sstate_setscene(d):
     shared_state = sstate_state_fromvars(d)
-- 
2.49.0



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-06-26 14:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <18466AB4BE83FB99.2470@lists.openembedded.org>
2025-06-13 11:43 ` [OE-core] [PATCH] sstate.bbclass: apply proper umask when fetching from SSTATE_MIRROR Rasmus Villemoes
2025-06-06  9:39 Rasmus Villemoes
2025-06-13 16:30 ` Richard Purdie
2025-06-13 19:42   ` [OE-core] " Ryan Eatmon
2025-06-15 21:17 ` Richard Purdie
2025-06-17  7:41   ` [OE-core] " Rasmus Villemoes
2025-06-25 13:54     ` Richard Purdie
2025-06-26  6:51       ` Rasmus Villemoes
2025-06-26 10:06         ` Richard Purdie
2025-06-26 12:50           ` Rasmus Villemoes
2025-06-26 14:05             ` Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.