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>
This commit is contained in:
iarspider 2020-05-08 02:21:53 +02:00 committed by GitHub
parent 08f449ae9a
commit e2d42672b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 1 deletions

View file

@ -157,3 +157,7 @@ config:
# Has no effect on macOS. DO NOT MIX these within the same install tree.
# See the Spack documentation for details.
shared_linking: 'rpath'
# Set to 'false' to allow installation on filesystems that doesn't allow setgid bit
# manipulation by unprivileged user (e.g. AFS)
config:allow_sgid: true

View file

@ -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

View file

@ -73,6 +73,7 @@
{'type': 'null'}
],
},
'allow_sgid': {'type': 'boolean'},
},
},
}