]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t/t1304: use 'test -r' to test readability rather than looking at mode bits
authorBrandon Casey <drafnel@gmail.com>
Mon, 15 Mar 2010 17:14:35 +0000 (12:14 -0500)
committerJunio C Hamano <gitster@pobox.com>
Wed, 17 Mar 2010 02:05:58 +0000 (19:05 -0700)
This test was using the group read permission bit as an indicator of the
default ACL mask.  This behavior is valid on Linux but not on other
platforms like Solaris.  So, rather than looking at mode bits, just test
readability for the user.  This, along with the checks for the existence
of the ACL's that were set on the parent directories, should be enough.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t1304-default-acl.sh

index 3a1532be553fefdb322f34a84e001b705f687c01..52246d7393dddeba36cae8aa80d58505af306469 100755 (executable)
@@ -20,21 +20,8 @@ if ! setfacl -m u:root:rwx .; then
     test_done
 fi
 
-modebits () {
-       ls -l "$1" | sed -e 's|^\(..........\).*|\1|'
-}
-
 check_perms_and_acl () {
-       actual=$(modebits "$1") &&
-       case "$actual" in
-       -r--r-----*)
-               : happy
-               ;;
-       *)
-               echo "Got permission '$actual', expected '-r--r-----'"
-               false
-               ;;
-       esac &&
+       test -r "$1" &&
        getfacl "$1" > actual &&
        grep -q "user:root:rwx" actual &&
        grep -q "user:${LOGNAME}:rwx" actual &&