[ARVADOS] updated: 1.1.1-259-ge64b71e

Git user git at public.curoverse.com
Thu Dec 14 16:14:39 EST 2017


Summary of changes:
 services/crunch-run/git_mount.go | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

       via  e64b71e098878da66c434b7f7c09d36f2650f38e (commit)
      from  fc880f7053c5fc5a669d92453f4fc293e0b514f1 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit e64b71e098878da66c434b7f7c09d36f2650f38e
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date:   Thu Dec 14 16:14:00 2017 -0500

    8311: Ensure git tree is readable even with umask 077.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>

diff --git a/services/crunch-run/git_mount.go b/services/crunch-run/git_mount.go
index b923518..92b8371 100644
--- a/services/crunch-run/git_mount.go
+++ b/services/crunch-run/git_mount.go
@@ -4,6 +4,7 @@ import (
 	"fmt"
 	"net/url"
 	"os"
+	"path/filepath"
 	"regexp"
 
 	"git.curoverse.com/arvados.git/sdk/go/arvados"
@@ -92,9 +93,18 @@ func (gm gitMount) extractTree(ac IArvadosClient, dir string, token string) erro
 	if err != nil {
 		return fmt.Errorf("checkout failed: %s", err)
 	}
-	err = os.Chmod(dir, 0755)
+	err = filepath.Walk(dir, func(path string, info os.FileInfo, err error) error {
+		if err != nil {
+			return err
+		}
+		// copy user rx bits to group and other, in case
+		// prevailing umask is more restrictive than 022
+		mode := info.Mode()
+		mode = mode | ((mode >> 3) & 050) | ((mode >> 6) & 5)
+		return os.Chmod(path, mode)
+	})
 	if err != nil {
-		return fmt.Errorf("chmod %o %q: %s", 0755, dir, err)
+		return fmt.Errorf("chmod -R %q: %s", dir, err)
 	}
 	return nil
 }

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list