fix(jd): narrow repository sharing hook
This commit is contained in:
parent
c7c17f8fd4
commit
406e9d8a7d
1 changed files with 5 additions and 2 deletions
|
|
@ -12,8 +12,11 @@ cd "$repo_dir"
|
||||||
owner_uid=$(id -u)
|
owner_uid=$(id -u)
|
||||||
|
|
||||||
share_tree() {
|
share_tree() {
|
||||||
find "$1" -user "$owner_uid" -type d -exec chmod g+rwx {} +
|
# RestrictSUIDSGID forbids chmod calls that preserve a setgid directory.
|
||||||
find "$1" -user "$owner_uid" -type f -exec chmod g+rw {} +
|
# Existing shared directories are already traversable, so touch only new
|
||||||
|
# private directories and use a numeric mode that drops the special bit.
|
||||||
|
find "$1" -user "$owner_uid" -type d ! -perm -g=x -exec chmod 0770 {} +
|
||||||
|
find "$1" -user "$owner_uid" -type f ! -perm -g=r -exec chmod g+r {} +
|
||||||
}
|
}
|
||||||
|
|
||||||
share_tree "$repo_dir/objects"
|
share_tree "$repo_dir/objects"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue