aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Makefile6
-rw-r--r--README.md2
-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
4 files changed, 12 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index 6244684..64201f1 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
PREFIX ?= /usr/local
-install: git-init-shared git-init-shared.1 git-package git-package.1 git-sign-for-cgit git-sign-for-cgit.1
- install -D -m 755 -t '${DESTDIR}${PREFIX}/bin' git-init-shared git-package git-sign-for-cgit
- install -D -m 644 -t '${DESTDIR}${PREFIX}/share/man/man1' git-init-shared.1 git-package.1 git-sign-for-cgit.1
+install: git-init-acl git-init-acl.1 git-package git-package.1 git-sign-for-cgit git-sign-for-cgit.1
+ install -D -m 755 -t '${DESTDIR}${PREFIX}/bin' git-init-acl git-package git-sign-for-cgit
+ install -D -m 644 -t '${DESTDIR}${PREFIX}/share/man/man1' git-init-acl.1 git-package.1 git-sign-for-cgit.1
.PHONY: install
diff --git a/README.md b/README.md
index 60d06d5..1e3fb33 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@ personal use.
## Scripts
-- [`git-init-shared(1)`](git-init-shared.1): Initialize a bare repo that multiple users have write access
+- [`git-init-acl(1)`](git-init-acl.1): Initialize a bare repo that multiple users have write access
to. This uses `setfacl(1)` and thereby relies on ACL support.
- [`git-package(1)`](git-package.1): Create an archive of a named tree suitable for distribution.
- [`git-sign-for-cgit(1)`](git-sign-for-cgit.1): Generate a snapshot and store its [signify](https://www.openbsd.org/papers/bsdcan-signify.html) signature for
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