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:
parent
08f449ae9a
commit
e2d42672b7
3 changed files with 6 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -73,6 +73,7 @@
|
|||
{'type': 'null'}
|
||||
],
|
||||
},
|
||||
'allow_sgid': {'type': 'boolean'},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue