aboutsummaryrefslogtreecommitdiffstats
path: root/git-init-shared
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xgit-init-acl (renamed from git-init-shared)9
-rw-r--r--git-init-acl.1 (renamed from git-init-shared.1)6
2 files changed, 8 insertions, 7 deletions
diff --git a/git-init-shared b/git-init-acl
index b0ffac5..1a40dff 100755
--- a/git-init-shared
+++ b/git-init-acl
@@ -3,7 +3,7 @@
set -e
usage() {
- printf "usage: git init-shared directory [user...]\n" >&2
+ printf "usage: git init-acl directory [user...]\n" >&2
exit 1
}
@@ -16,9 +16,10 @@ acl_mask() {
add_to_acl() {
# Recursively apply all necessary ACL settings as we may be reinitializing
# 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,u:$2:rwX" "$1"
+ # Take care to specify the ACL mask explicitly to make sure it is set to
+ # rw- on files and rwx on directories (automatic recalculation ends up
+ # setting rwx even on non-directory files)
+ setfacl -Rm "d:u:$2:rwX,u:$2:rwX,d:m:rwX,m:rwX" "$1"
}
test $# -ge 1 || usage
diff --git a/git-init-shared.1 b/git-init-acl.1
index dfd9ffa..2bf8b12 100644
--- a/git-init-shared.1
+++ b/git-init-acl.1
@@ -1,11 +1,11 @@
.Dd July 19, 2021
-.Dt GIT-INIT-SHARED 1
+.Dt GIT-INIT-ACL 1
.Os
.Sh NAME
-.Nm git-init-shared
+.Nm git-init-acl
.Nd create and share a git repository amongst multiple users
.Sh SYNOPSIS
-.Nm git init-shared
+.Nm git init-acl
.Ar directory
.Op Ar user...
.Sh DESCRIPTION