]> git.nbdom.net Git - nb.git/commitdiff
etc/profile.d/git.sh
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 4 Mar 2025 08:28:14 +0000 (09:28 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 4 Mar 2025 08:28:14 +0000 (09:28 +0100)
etc/profile.d/git.sh

index a5179767ac4685bc68c024ec9c6c898148104489..3d0c5ea322a7953ef39df9013495482670e92d3b 100644 (file)
@@ -36,7 +36,9 @@ EOF
                return 1
        fi
 
-       declare owner=$(ls -dl "$file" | awk '{print $3}')
+       # NB 04.03.25 declare owner=$(ls -dl "$file" | awk '{print $3}')
+       # NB 04.03.25: We get the owner from the dir not the file. Because the file could be own by anotrher user for specific use. Ex: acl.pl owner is proxy but the git repo is root  
+       declare owner="$(ls -dl "$(dirname "$file")" | awk '{print $3}')"
        [ -z "$owner" ] && echo "Can't find owner for file '$file'" 1>&2 && return 1
 
        [ "$#" == "0" ] && echo "Args CMD missing" 2>&1 && return 1