Skip to contentSkip to conversation

sstate: Set umask to 002 before packaging runs

PATCH New Phil Blundell 1 participant 1 message Apr 24, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sstate: Set umask to 002 before packaging runs

Otherwise we might end up creating directories under sstate-cache with whatever random umask has been selected for the task that we're trying to package. This would be a bad thing since it might result in losing group write access for newly created dirs, and/or losing group read access for the sstate files themselves.

---
 meta/classes/sstate.bbclass |    4 ++++
 1 file changed, 4 insertions(+)
meta/classes/sstate.bbclass +4 -0
index 03f083e..380eb66 100644
@@ -507,7 +507,11 @@ python sstate_task_postfunc () {
     sstate_install(shared_state, d)
     for intercept in shared_state['interceptfuncs']:
         bb.build.exec_func(intercept, d)
+    omask = os.umask(002)
+    if omask != 002:
+       bb.note("Using umask 002 (not %0o) for sstate packaging" % omask)
     sstate_package(shared_state, d)
+    os.umask(omask)
 }
   
 
Signature · 1 line
1.7.10.4