mirror of
https://github.com/git/git
synced 2024-08-24 18:26:02 +00:00
Merge branch 'jc/set-gid-bit-less-aggressively'
The adjust_shared_perm() helper function learned to refrain from setting the "g+s" bit on directories when it is not necessary. * jc/set-gid-bit-less-aggressively: adjust_shared_perm(): leave g+s alone when the group does not matter
This commit is contained in:
commit
06e7696025
6
path.c
6
path.c
|
@ -901,6 +901,12 @@ int adjust_shared_perm(const char *path)
|
|||
if (S_ISDIR(old_mode)) {
|
||||
/* Copy read bits to execute bits */
|
||||
new_mode |= (new_mode & 0444) >> 2;
|
||||
|
||||
/*
|
||||
* g+s matters only if any extra access is granted
|
||||
* based on group membership.
|
||||
*/
|
||||
if (FORCE_DIR_SET_GID && (new_mode & 060))
|
||||
new_mode |= FORCE_DIR_SET_GID;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue