t/t1304: use 'test -r' to test readability rather than looking at mode bits
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>
Brandon Casey committed
Mar 15, 2010 at 12:14 UTC
71c4d6c6354036597534931d8fe9e80a9ae3c0af
1 file changed
+1
-14
t/t1304-default-acl.sh
+1
-14
@@ -20,21 +20,8 @@ if ! setfacl -m u:root:rwx .; then
20
test_done
21
fi
22
23
-modebits () {
24
- ls -l "$1" | sed -e 's|^\(..........\).*|\1|'
25
-}
26
-
23
check_perms_and_acl () {
28
- actual=$(modebits "$1") &&
29
- case "$actual" in
30
- -r--r-----*)
31
- : happy
32
- ;;
33
- *)
34
- echo "Got permission '$actual', expected '-r--r-----'"
35
- false
36
- ;;
37
- esac &&
24
+ test -r "$1" &&
25
getfacl "$1" > actual &&
26
grep -q "user:root:rwx" actual &&
27
grep -q "user:${LOGNAME}:rwx" actual &&