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

Re: Bugreport on Ubuntu LTS: not ok - 2 Objects creation does not break ACLs with restrictive umask

From
Stefan Beller <stefanbeller@googlemail.com>
Date
Jun 5, 2012, 12:23 UTC
Message-ID
<CALbm-EbGoaxkvBXphAPF8rRkS=VFeeFHXQSFdWVrZUJJ8DYovw@mail.gmail.com>
In-Reply-To
<vpq4nqqj8ss.fsf@bauges.imag.fr>
Hi,

so I applied that patch with git apply, but here 2 out of 4 tests now still fail.

sb@sb:~/OSS/git/t$ cat t1304-default-acl.sh #!/bin/sh # # Copyright (c) 2010 Matthieu Moy #

test_description='Test repository with default ACL'

# Create the test repo with restrictive umask # => this must come before . ./test-lib.sh umask 077

. ./test-lib.sh
# We need an arbitrary other user give permission to using ACLs. root
# is a good candidate: exists on all unices, and it has permission
# anyway, so we don't create a security hole running the testsuite.
test_expect_success 'checking for a working acl setup' '
       if setfacl -m u:root:rwx . &&
          getfacl . | grep user:root:rwx
       then
               test_set_prereq SETFACL
       fi
'
if test -z "$LOGNAME"
then
	LOGNAME=$USER
fi
check_perms_and_acl () {
	test -r "$1" &&
	getfacl "$1" > actual &&
	grep -q "user:root:rwx" actual &&
	grep -q "user:${LOGNAME}:rwx" actual &&
	egrep "mask::?r--" actual > /dev/null 2>&1 &&
	grep -q "group::---" actual || false
}
dirs_to_set="./ .git/ .git/objects/ .git/objects/pack/"
test_expect_success SETFACL 'Setup test repo' '
	setfacl -m d:u::rwx,d:g::---,d:o:---,d:m:rwx $dirs_to_set &&
	setfacl -m m:rwx               $dirs_to_set &&
	setfacl -m u:root:rwx          $dirs_to_set &&
	setfacl -m d:u:"$LOGNAME":rwx  $dirs_to_set &&
	setfacl -m d:u:root:rwx        $dirs_to_set &&
	touch file.txt &&
	git add file.txt &&
	git commit -m "init"
'
test_expect_success SETFACL 'Objects creation does not break ACLs with
restrictive umask' '
	# SHA1 for empty blob
	check_perms_and_acl .git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391
'
test_expect_success SETFACL 'git gc does not break ACLs with
restrictive umask' '
	git gc &&
	check_perms_and_acl .git/objects/pack/*.pack
'
test_done
sb@sb:~/OSS/git/t$ ./t1304-default-acl.sh --verbose
Initialized empty Git repository in /home/sb/OSS/git/t/trash
directory.t1304-default-acl/.git/
expecting success:
       if setfacl -m u:root:rwx . &&
          getfacl . | grep user:root:rwx
       then
               test_set_prereq SETFACL
       fi

user:root:rwx ok 1 - checking for a working acl setup

expecting success:
	setfacl -m d:u::rwx,d:g::---,d:o:---,d:m:rwx $dirs_to_set &&
	setfacl -m m:rwx               $dirs_to_set &&
	setfacl -m u:root:rwx          $dirs_to_set &&
	setfacl -m d:u:"$LOGNAME":rwx  $dirs_to_set &&
	setfacl -m d:u:root:rwx        $dirs_to_set &&
	touch file.txt &&
	git add file.txt &&
	git commit -m "init"
[master (root-commit) 011f91a] init
 Author: A U Thor <author@example.com>
 0 files changed
 create mode 100644 file.txt
ok 2 - Setup test repo
expecting success:
	# SHA1 for empty blob
	check_perms_and_acl .git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391

not ok - 3 Objects creation does not break ACLs with restrictive umask # # # SHA1 for empty blob # check_perms_and_acl .git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 #

expecting success:
	git gc &&
	check_perms_and_acl .git/objects/pack/*.pack

Counting objects: 3, done. Writing objects: 100% (3/3), done. Total 3 (delta 0), reused 0 (delta 0) not ok - 4 git gc does not break ACLs with restrictive umask # # git gc && # check_perms_and_acl .git/objects/pack/*.pack #

# failed 2 among 4 test(s) 1..4

2012/6/5 Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>:
Show 19 quoted lines
> Jeff King <peff@peff.net> writes:
>
>> Subject: t1304: improve setfacl prerequisite setup
>
>> +test_expect_success 'checking for a working acl setup' '
>> +     if setfacl -m u:root:rwx . &&
>> +        getfacl . | grep user:root:rwx
>> +     then
>> +             test_set_prereq SETFACL
>> +     fi
>> +'
>
> Excellent. Thanks.
>
> Tested-by: Matthieu Moy <Matthieu.Moy@imag.fr>
>
> --
> Matthieu Moy
> http://www-verimag.imag.fr/~moy/
Previous: Matthieu MoyNext: Matthieu Moy
Message 9 of 26 in “Bugreport on Ubuntu LTS: not ok - 2 Objects creation does not break ACLs with restrictive umask”
  1. Stefan BellerJun 4, 2012
  2. Junio C HamanoJun 4, 2012
  3. Junio C HamanoJun 4, 2012
  4. Matthieu MoyJun 5, 2012
  5. Stefan BellerJun 5, 2012
  6. Stefan BellerJun 5, 2012
  7. Jeff KingJun 5, 2012
  8. Matthieu MoyJun 5, 2012
  9. Stefan BellerJun 5, 2012
  10. Matthieu MoyJun 5, 2012
  11. Jeff KingJun 5, 2012
  12. Jeff KingJun 5, 2012
  13. Jeff KingJun 5, 2012
  14. Jeff KingJun 5, 2012
  15. Junio C HamanoJun 5, 2012
  16. Jeff KingJun 5, 2012
  17. Junio C HamanoJun 5, 2012
  18. t1304: improve setfacl prerequisite setupJeff King, Jun 6, 2012
  19. Stefan BellerJun 6, 2012
  20. Junio C HamanoJun 6, 2012
  21. Jeff KingJun 7, 2012
  22. Junio C HamanoJun 7, 2012
  23. Brandon CaseyJun 8, 2012
  24. Tyler HicksJun 5, 2012
  25. Stefan BellerJun 5, 2012
  26. Jeff KingJun 5, 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.