From 9b161d7d203257ca07b43ab4be5904b1d3855645 Mon Sep 17 00:00:00 2001 From: Wolfgang Müller Date: Mon, 19 Jul 2021 15:36:38 +0200 Subject: git-init-shared: Collapse calls to setfacl setfacl(1) allows specifying multiple ACL entries with ','. This makes the code cleaner and easier to maintain. --- git-init-shared | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'git-init-shared') 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 -- cgit v1.2.3-2-gb3c3