[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master aedc8d0 11/14: Detect files that aren't group
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master aedc8d0 11/14: Detect files that aren't group writable |
Date: |
Sat, 25 Apr 2020 17:43:14 -0400 (EDT) |
branch: master
commit aedc8d04ad718e06908ef20049338627ae622a88
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Detect files that aren't group writable
---
gwc/share_git1.sh | 14 ++++++++++++--
gwc/share_git2.sh | 14 ++++++++++++--
2 files changed, 24 insertions(+), 4 deletions(-)
diff --git a/gwc/share_git1.sh b/gwc/share_git1.sh
index 026ce71..2eedbda 100755
--- a/gwc/share_git1.sh
+++ b/gwc/share_git1.sh
@@ -45,7 +45,7 @@ git -C "$inited" remote add origin
https://github.com/wxWidgets/zlib.git
git -C "$inited" fetch origin
find ./"$inited" ! -perm -g=w |sed -e'/objects\/pack/d'
-# Oops: FETCH_HEAD doesn't have group permissions:
+# Oops: FETCH_HEAD doesn't have group write permissions:
ls -l ./"$inited"/*HEAD
# This isn't really necessary; it just makes the result look more like
@@ -92,7 +92,7 @@ ls -l ./"$cloned"/*HEAD
git -C "$cloned" fetch
find ./"$cloned" ! -perm -g=w |sed -e'/objects\/pack/d'
-# Oops: FETCH_HEAD doesn't have group permissions:
+# Oops: FETCH_HEAD doesn't have group write permissions:
ls -l ./"$cloned"/*HEAD
# This fails:
@@ -115,6 +115,16 @@ du -sb "$cloned" "$inited"
git -C "$cloned" fsck
git -C "$inited" fsck
+# Show any files that aren't group writable, expecting '.' only.
+#
+# Something like this:
+# stat --printf="%A %a\t%U %G %n\n" $(find .) |sed ...
+# could be used instead of 'ls', but the gain in robustness doesn't
+# seem worth the loss in readability.
+# shellcheck disable=SC2012
+# shellcheck disable=SC2046
+ls -ld $(find .) |sed -e'/^.....w/d' -e'/objects\/pack/d'
+
# List all files' permissions for comparison, e.g.:
# meld /srv/chroot/bullseye0/tmp/eraseme/ls-* &
cd /tmp/eraseme/"$inited" && ls -alR >/tmp/eraseme/ls-"$inited"
diff --git a/gwc/share_git2.sh b/gwc/share_git2.sh
index 8519fa2..d4f13fb 100755
--- a/gwc/share_git2.sh
+++ b/gwc/share_git2.sh
@@ -49,7 +49,7 @@ git -C "$inited" remote add origin
https://github.com/wxWidgets/zlib.git
git -C "$inited" fetch origin
find ./"$inited" ! -perm -g=w |sed -e'/objects\/pack/d'
-# Oops: FETCH_HEAD doesn't have group permissions:
+# Oops: FETCH_HEAD doesn't have group write permissions:
ls -l ./"$inited"/.git/*HEAD
# This isn't really necessary; it just makes the result look more like
@@ -96,7 +96,7 @@ ls -l ./"$cloned"/.git/*HEAD
git -C "$cloned" fetch
find ./"$cloned" ! -perm -g=w |sed -e'/objects\/pack/d'
-# Oops: FETCH_HEAD doesn't have group permissions:
+# Oops: FETCH_HEAD doesn't have group write permissions:
ls -l ./"$cloned"/.git/*HEAD
# This fails:
@@ -116,6 +116,16 @@ du -sb "$cloned" "$inited"
git -C "$cloned" fsck
git -C "$inited" fsck
+# Show any files that aren't group writable, expecting '.' only.
+#
+# Something like this:
+# stat --printf="%A %a\t%U %G %n\n" $(find .) |sed ...
+# could be used instead of 'ls', but the gain in robustness doesn't
+# seem worth the loss in readability.
+# shellcheck disable=SC2012
+# shellcheck disable=SC2046
+ls -ld $(find .) |sed -e'/^.....w/d' -e'/objects\/pack/d'
+
# List all files' permissions for comparison, e.g.:
# meld /srv/chroot/bullseye0/tmp/eraseme/ls-* &
cd /tmp/eraseme/"$inited" && ls -alR >/tmp/eraseme/ls-"$inited"
- [lmi-commits] [lmi] master 032d679 02/14: Reduce gratuitous differences between git scripts, (continued)
- [lmi-commits] [lmi] master 032d679 02/14: Reduce gratuitous differences between git scripts, Greg Chicares, 2020/04/25
- [lmi-commits] [lmi] master 655214a 01/14: Note progress on git FETCH_HEAD permission issue, Greg Chicares, 2020/04/25
- [lmi-commits] [lmi] master c78c9aa 06/14: Reduce differences between git scripts, Greg Chicares, 2020/04/25
- [lmi-commits] [lmi] master 02f33b5 07/14: Don't rely on a nondefault umask, Greg Chicares, 2020/04/25
- [lmi-commits] [lmi] master d432bc8 09/14: Improve documentation of git scripts, Greg Chicares, 2020/04/25
- [lmi-commits] [lmi] master 28dbf67 08/14: Reduce differences between git scripts, Greg Chicares, 2020/04/25
- [lmi-commits] [lmi] master 063d24d 04/14: Reduce differences between git scripts, Greg Chicares, 2020/04/25
- [lmi-commits] [lmi] master 38a6c93 12/14: Let git create its own directory, Greg Chicares, 2020/04/25
- [lmi-commits] [lmi] master 9f235b6 14/14: Don't mess with GID or permissions of $PWD, Greg Chicares, 2020/04/25
- [lmi-commits] [lmi] master 3dace32 05/14: Check permissions more thoroughly, Greg Chicares, 2020/04/25
- [lmi-commits] [lmi] master aedc8d0 11/14: Detect files that aren't group writable,
Greg Chicares <=
- [lmi-commits] [lmi] master 03f3b23 10/14: Reorder statements in a git script; improve documentation, Greg Chicares, 2020/04/25
- [lmi-commits] [lmi] master 7944d8e 13/14: Detect files that have an unexpected GID, Greg Chicares, 2020/04/25