git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Sep 17, 2012, 15:49 UTC
Message-ID
<vpqvcfcps2z.fsf@grenoble-inp.fr>
In-Reply-To
<CALkWK0=ROz8fxXgnqt-+AthU-hgq_mzFg0GhBQCrAshH_mRBPQ@mail.gmail.com>
Ramkumar Ramachandra <artagnon@gmail.com> writes:
Show 7 quoted lines
> 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/
Previous: Ramkumar RamachandraNext: Junio C Hamano
Message 6 of 17 in “Test failure: Test #3 in t1304-default-acl”
  1. Ramkumar RamachandraSep 17, 2012
  2. Matthieu MoySep 17, 2012
  3. Ramkumar RamachandraSep 17, 2012
  4. Matthieu MoySep 17, 2012
  5. Ramkumar RamachandraSep 17, 2012
  6. Matthieu MoySep 17, 2012
  7. Junio C HamanoSep 17, 2012
  8. Matthieu MoySep 17, 2012
  9. Joachim SchmitzSep 17, 2012
  10. Junio C HamanoSep 17, 2012
  11. Ramkumar RamachandraOct 1, 2012
  12. Joachim SchmitzOct 1, 2012
  13. Junio C HamanoOct 1, 2012
  14. Ramkumar RamachandraSep 18, 2012
  15. Andreas SchwabSep 17, 2012
  16. Ramkumar RamachandraSep 17, 2012
  17. Andreas SchwabSep 17, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.