From 1739b7d79422abac7c83c30831dd9b3fe6df4a0f Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Sat, 20 Apr 2024 01:40:13 -0300 Subject: [PATCH] Run chmod after clone The umask appears to be ignored (maybe it is reset after running 'git config core.filemode off' ?). Run chmod to fix. --- libexec/portzap/portzap-clone | 3 +++ libexec/portzap/portzap-pull | 2 +- share/portzap/doas.conf | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/libexec/portzap/portzap-clone b/libexec/portzap/portzap-clone index ffe982b..bbf3d7c 100755 --- a/libexec/portzap/portzap-clone +++ b/libexec/portzap/portzap-clone @@ -27,7 +27,10 @@ set -x umask ${mode} doas -u _portzap "${git}" clone "${giturl}" "${gitdir}" cd "${gitdir}" +set +x +echo "[-] Adjust filemode. This might take a while" doas -u _portzap "${git}" config core.filemode off +doas -u root /bin/chmod -R ${mode} "${gitdir}" echo "[-] git checkout ${branch}" if ! doas -u _portzap "${git}" \ checkout -t \ diff --git a/libexec/portzap/portzap-pull b/libexec/portzap/portzap-pull index 1d35ce0..126a3a9 100755 --- a/libexec/portzap/portzap-pull +++ b/libexec/portzap/portzap-pull @@ -51,7 +51,7 @@ cd "${gitdir}" remote=$("${git}" remote | head -n1) if [ "$(git branch --show-current)" != "${branch}" ]; then change_branch "${remote}" "${branch}" - echo "[-] Adjust filemode for new branch. This might take a while" + echo "[-] Adjust filemode. This might take a while" doas -u root /bin/chmod -R "${mode}" "${gitdir}" fi set -x diff --git a/share/portzap/doas.conf b/share/portzap/doas.conf index 5d0e9fa..bdb2b97 100644 --- a/share/portzap/doas.conf +++ b/share/portzap/doas.conf @@ -2,6 +2,6 @@ # portzap permit nopass root as _portzap cmd /usr/local/bin/git permit nopass :_portzap as _portzap cmd /usr/local/bin/git -permit nopass :_portzap as root cmd /bin/chmod args -R u=rwX,g=rwX,o= /home/_portzap/ports -permit nopass :_portzap as root cmd /bin/chmod args -R u=rwX,g=rwX,o= /home/_portzap/ports/.git +permit nopass :_portzap as root cmd /bin/chmod args -R ug=rwX,o= /home/_portzap/ports +permit nopass :_portzap as root cmd /bin/chmod args -R ug=rwX,o= /home/_portzap/ports/.git permit nopass :_portzap as root cmd /usr/sbin/chown args -R _portzap:_portzap /home/_portzap/ports/.git