summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authoriarspider <iarspider@gmail.com>2020-05-08 02:21:53 +0200
committerGitHub <noreply@github.com>2020-05-07 17:21:53 -0700
commite2d42672b702ac6a1a3fe182b903e6122945c033 (patch)
treeada6e95786acb3eeead7aeeddc957232f8cf165e /lib
parent08f449ae9a4b18e5a8c1056278b6e925d1760678 (diff)
downloadspack-e2d42672b702ac6a1a3fe182b903e6122945c033.tar.gz
spack-e2d42672b702ac6a1a3fe182b903e6122945c033.tar.bz2
spack-e2d42672b702ac6a1a3fe182b903e6122945c033.tar.xz
spack-e2d42672b702ac6a1a3fe182b903e6122945c033.zip
Config option to disable setting S_ISGID bit when creating installation directory (#14479)
* Add config option to disable setting S_ISGID bit when creating installation directory. Co-authored-by: Ivan Razumov <ivan.razumov@cern.ch>
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/package_prefs.py2
-rw-r--r--lib/spack/spack/schema/config.py1
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/spack/spack/package_prefs.py b/lib/spack/spack/package_prefs.py
index 0158c7063a..aa904a0792 100644
--- a/lib/spack/spack/package_prefs.py
+++ b/lib/spack/spack/package_prefs.py
@@ -204,7 +204,7 @@ def get_package_dir_permissions(spec):
attribute sticky for the directory. Package-specific settings take
precedent over settings for ``all``"""
perms = get_package_permissions(spec)
- if perms & stat.S_IRWXG:
+ if perms & stat.S_IRWXG and spack.config.get('config:allow_sgid', True):
perms |= stat.S_ISGID
return perms
diff --git a/lib/spack/spack/schema/config.py b/lib/spack/spack/schema/config.py
index a05af2f438..d56321d09c 100644
--- a/lib/spack/spack/schema/config.py
+++ b/lib/spack/spack/schema/config.py
@@ -73,6 +73,7 @@ properties = {
{'type': 'null'}
],
},
+ 'allow_sgid': {'type': 'boolean'},
},
},
}