lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 38b1eed 3/3: Fix ownership and permissions of


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 38b1eed 3/3: Fix ownership and permissions of proprietary repository
Date: Sun, 10 May 2020 20:44:15 -0400 (EDT)

branch: master
commit 38b1eed447be8e6667fc3ce08c816d7d599774f0
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Fix ownership and permissions of proprietary repository
    
    Adapted code from 'gwc/share_git1.sh'.
    
    Ideally, the blessed bare copy of this repository would need no such
    adjustments, but applying them peremptorily should do no harm, as any
    shared bare repository should fit this bed of Procrustes already.
---
 lmi_setup_43.sh | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/lmi_setup_43.sh b/lmi_setup_43.sh
index 1bc6a6e..6cd9e65 100755
--- a/lmi_setup_43.sh
+++ b/lmi_setup_43.sh
@@ -43,8 +43,35 @@ git remote set-url --push origin 
address@hidden:/srv/git/lmi.git
 # bare repository has no references that need to be resolved):
 cd /opt/lmi || { printf 'failed: cd\n'; exit 3; }
 cp --dereference --preserve --recursive /srv/cache_for_lmi/blessed .
+#
+# Fix ownership and permissions of bare repository, just in case.
+chgrp -R "$NORMAL_GROUP" blessed
+# This is better than 'chmod -R g+s' (it affects only directories):
+find blessed -type d -exec chmod g+s {} +
+# Specifying 's' here would cause many 'S' occurrences in 'ls' output;
+# specifying 'g+w' here would cause pack files to be group writable:
+#   chmod -R g+swX blessed
+# Instead, use 'g=u', which doesn't override the earlier 'g+s'--see:
+#   https://lists.nongnu.org/archive/html/lmi/2020-03/msg00019.html
+chmod -R g=u blessed
+#
 # Then create a working copy by cloning the bare repository...
+#
+# Apparently '--config core.SharedRepository=group' would have little
+# or no benefit here.
 git clone -b master file:///opt/lmi/blessed/proprietary
+#
+# Fix ownership and permissions of working copy.
+chgrp -R "$NORMAL_GROUP" proprietary
+# This is better than 'chmod -R g+s' (it affects only directories):
+find proprietary -type d -exec chmod g+s {} +
+# Specifying 's' here would cause many 'S' occurrences in 'ls' output;
+# specifying 'g+w' here would cause pack files to be group writable:
+#   chmod -R g+swX proprietary
+# Instead, use 'g=u', which doesn't override the earlier 'g+s'--see:
+#   https://lists.nongnu.org/archive/html/lmi/2020-03/msg00019.html
+chmod -R g=u proprietary
+#
 # ...and verify it:
 cd proprietary || { printf 'failed: cd\n'; exit 3; }
 git rev-parse HEAD



reply via email to

[Prev in Thread] Current Thread [Next in Thread]