diff options
author | Wolfgang Müller | 2021-07-19 15:36:38 +0200 |
---|---|---|
committer | Wolfgang Müller | 2021-07-19 15:36:38 +0200 |
commit | 9b161d7d203257ca07b43ab4be5904b1d3855645 (patch) | |
tree | 83a652d08ff571eabfe7feb6ca83022bec58b236 | |
parent | 18b50a7e0e92e4d710472b3537a025df5f581141 (diff) | |
download | git-helpers-9b161d7d203257ca07b43ab4be5904b1d3855645.tar.gz |
git-init-shared: Collapse calls to setfacl
setfacl(1) allows specifying multiple ACL entries with ','. This makes
the code cleaner and easier to maintain.
Diffstat (limited to '')
-rwxr-xr-x | git-init-shared | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/git-init-shared b/git-init-shared index c06f418..b0ffac5 100755 --- a/git-init-shared +++ b/git-init-shared @@ -10,8 +10,7 @@ usage() { acl_mask() { # Set the ACL mask for the directory. The default mask will be inherited by # new directories and files (where it will correctly be set to rw-) - setfacl -m "d:m:rwx" "$1" - setfacl -m "m:rwx" "$1" + setfacl -m "d:m:rwx,m:rwx" "$1" } add_to_acl() { @@ -19,8 +18,7 @@ add_to_acl() { # the git repository with additional authorised users. # Take care *not* to recalculate the ACL mask (-n), since rwX translates to # a mask of rwx even on non-directory files. - setfacl -Rnm "d:u:$2:rwX" "$1" - setfacl -Rnm "u:$2:rwX" "$1" + setfacl -Rnm "d:u:$2:rwX,u:$2:rwX" "$1" } test $# -ge 1 || usage |