git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] t1301-shared-repo: Fix forced modes test
@ 2009-04-11 21:32 Johannes Sixt
  2009-04-12 19:22 ` [PATCH v2] t1301-shared-repo: Fix forced modes test, but it still shows a flaw Johannes Sixt
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Sixt @ 2009-04-11 21:32 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Git Mailing List

This test was added recently (5a688fe, "core.sharedrepository = 0mode"
should set, not loosen; 2009-03-28). It checked the result of a sed
invocation for emptyness, but in some cases it forgot to print anything
at all, so that those checks would never be false.

Due to this mistake, it went unnoticed that the files in objects/info are
not necessarily 0440, but can also be 0640. This directory is now exempt
from the check.

Finally, this test cannot be run on Windows (requires POSIXPERM).

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---

  I don't have a Linux/Unix readily available right now, so this is only
  tested on Windows.

  -- Hannes

  t/t1301-shared-repo.sh |    8 +++++---
  1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/t/t1301-shared-repo.sh b/t/t1301-shared-repo.sh
index 750fbb3..fb7c51d 100755
--- a/t/t1301-shared-repo.sh
+++ b/t/t1301-shared-repo.sh
@@ -126,7 +126,7 @@ test_expect_success POSIXPERM 'git reflog expire
  	esac
  '

-test_expect_success 'forced modes' '
+test_expect_success POSIXPERM 'forced modes' '
  	mkdir -p templates/hooks &&
  	echo update-server-info >templates/hooks/post-update &&
  	chmod +x templates/hooks/post-update &&
@@ -145,7 +145,7 @@ test_expect_success 'forced modes' '
  	xargs ls -ld >actual &&

  	# Everything must be unaccessible to others
-	test -z "$(sed -n -e "/^.......---/d" actual)" &&
+	test -z "$(sed -e "/^.......---/d" actual)" &&

  	# All directories must have either 2770 or 770
  	test -z "$(sed -n -e "/^drwxrw[sx]---/d" -e "/^d/p" actual)" &&
@@ -156,10 +156,12 @@ test_expect_success 'forced modes' '
  		p
  	}" actual)" &&

-	# All files inside objects must be 0440
+	# All files inside objects (except objects/info) must be 0440
  	test -z "$(sed -n -e "/objects\//{
  		/^d/d
+		/info/d
  		/^-r--r-----/d
+		p
  	}" actual)"
  '

-- 
1.6.2.2.1458.gf2216d6

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-04-13  2:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-11 21:32 [PATCH] t1301-shared-repo: Fix forced modes test Johannes Sixt
2009-04-12 19:22 ` [PATCH v2] t1301-shared-repo: Fix forced modes test, but it still shows a flaw Johannes Sixt
2009-04-13  2:49   ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).