From 5b97061ad0ca9c0fd34a2a4359d1f437fef8836b Mon Sep 17 00:00:00 2001 From: Aminda Suomalainen Date: Thu, 8 Aug 2024 14:17:41 +0300 Subject: [PATCH] chmod: I have a setfacl hammer, so I see setfacl nails --- chmod | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/chmod b/chmod index 30ebf28b..aff02240 100755 --- a/chmod +++ b/chmod @@ -29,4 +29,18 @@ chmod -v 700 ~/.ssh touch ~/.ssh/authorized_keys chmod -v 600 ~/.ssh/authorized_keys +# if we have support for setting ACL, some of this becomes easier (although maybe redundant) +if hash setfacl 2> /dev/null; then + setfacl --modify u:$(id -un):rw,g:$(id -gn):r,o:r ~/.oidentd.conf + # The execute permission is a bit silly to apply recursively, but it's + # needed for cd and ls. so perhaps there should be some responsibility + # given to others too... + setfacl --recursive --modify u:$(id -un):rw,g:$(id -gn):rx,o:rx ~/public_html/ + + # Enabling laziness pt. … + if [[ -d ~/.shell-things ]]; then + setfacl --recursive --modify u:$(id -un):rw,g:$(id -gn):rx,o:rx ~/.shell-things/ + fi +fi + set +x