Skip to contentSkip to conversation

lib/bb/siggen.py: ensure dumped signatures have group R/W

PATCH Applied Joshua Lock 2 participants 2 messages May 12, 2012 – May 13, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 lib/bb/siggen.py: ensure dumped signatures have group R/W

We anticipate signatures being shared amongst peers in a group so ensure they have rw-rw-r-- permissions to facilitate this.

---
 lib/bb/siggen.py |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
lib/bb/siggen.py +4 -2
index ca26919..5a0b80e 100644
@@ -201,8 +201,10 @@ class SignatureGeneratorBasic(SignatureGenerator):
             for dep in data['runtaskdeps']:
                 data['runtaskhashes'][dep] = self.taskhash[dep]
 
-        p = pickle.Pickler(open(sigfile, "wb"), -1)
-        p.dump(data)
+        with open(sigfile, "wb") as f:
+            p = pickle.Pickler(f, -1)
+            p.dump(data)
+        os.chmod(sigfile, 0664)
 
     def dump_sigs(self, dataCache):
         for fn in self.taskdeps:
Signature · 1 line
1.7.7.6
#1 lore raw
Quoted 7 lines · Joshua Lock

We anticipate signatures being shared amongst peers in a group so ensure they have rw-rw-r-- permissions to facilitate this.

---
 lib/bb/siggen.py |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

Merged to master (along with 1/2) thanks.

Richard