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
@ -157,3 +157,7 @@ config:
|
|||||||
# Has no effect on macOS. DO NOT MIX these within the same install tree.
|
# Has no effect on macOS. DO NOT MIX these within the same install tree.
|
||||||
# See the Spack documentation for details.
|
# See the Spack documentation for details.
|
||||||
shared_linking: 'rpath'
|
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
|
attribute sticky for the directory. Package-specific settings take
|
||||||
precedent over settings for ``all``"""
|
precedent over settings for ``all``"""
|
||||||
perms = get_package_permissions(spec)
|
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
|
perms |= stat.S_ISGID
|
||||||
return perms
|
return perms
|
||||||
|
|
||||||
|
@ -73,6 +73,7 @@
|
|||||||
{'type': 'null'}
|
{'type': 'null'}
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
'allow_sgid': {'type': 'boolean'},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user