Re: Test failure: Test #3 in t1304-default-acl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ramkumar Ramachandra <artagnon@xxxxxxxxx> writes:

> Hi again,
>
> Matthieu Moy wrote:
>> Does this user have the same UID as your usual user
>> (id kseygold; id $LOGNAME)?
>
> Yes.  What do you propose we do about the test?

On a GNU system, something like this should do the trick:

--- a/t/t1304-default-acl.sh
+++ b/t/t1304-default-acl.sh
@@ -31,9 +31,9 @@ fi
 
 check_perms_and_acl () {
        test -r "$1" &&
-       getfacl "$1" > actual &&
+       getfacl --numeric "$1" > actual &&
        grep -q "user:root:rwx" actual &&
-       grep -q "user:${LOGNAME}:rwx" actual &&
+       grep -q "user:$(id -u):rwx" actual &&
        egrep "mask::?r--" actual > /dev/null 2>&1 &&
        grep -q "group::---" actual || false
 }

but it seems FreeBSD's getfacl doesn't have --numeric
(http://www.unix.com/man-page/FreeBSD/1/getfacl/), so to be portable, we
need some more surgery, like this:

--- a/t/t1304-default-acl.sh
+++ b/t/t1304-default-acl.sh
@@ -33,7 +33,10 @@ check_perms_and_acl () {
        test -r "$1" &&
        getfacl "$1" > actual &&
        grep -q "user:root:rwx" actual &&
-       grep -q "user:${LOGNAME}:rwx" actual &&
+       grep "user:.*:rwx" actual | grep -v 'user:root:' | \
+           cut -d : -f 2 | xargs id -u > acl-uid &&
+       id -u > actual-uid &&
+       test_cmp acl-uid actual-uid &&
        egrep "mask::?r--" actual > /dev/null 2>&1 &&
        grep -q "group::---" actual || false
 }

Can you check that this second patch fixes your problem?

I'm a bit hesitant to submit it to git.git, as I find it a bit too
hacky. What do other people think?

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]