Git development
 help / color / mirror / Atom feed
* [PATCH] gitweb: Use single implementation of export_ok check.
@ 2008-11-05 22:15 Alexander Gavrilov
  2008-11-05 22:41 ` Jakub Narebski
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Gavrilov @ 2008-11-05 22:15 UTC (permalink / raw)
  To: git; +Cc: Jakub Narebski, Giuseppe Bilotta, Petr Baudis

GitWeb source contains a special function that implements the
export_ok check, but validate_project still uses a separate copy
of essentially the same code.

This patch makes it use the dedicated function, thus ensuring
that all checks are done through a single code path.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
---

	For reference, here is the function:

	sub check_export_ok {
		my ($dir) = @_;
		return (check_head_link($dir) &&
			(!$export_ok || -e "$dir/$export_ok"));
	}


 gitweb/gitweb.perl |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index c5254af..172ea6b 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -742,8 +742,7 @@ sub validate_project {
 	my $input = shift || return undef;
 	if (!validate_pathname($input) ||
 		!(-d "$projectroot/$input") ||
-		!check_head_link("$projectroot/$input") ||
-		($export_ok && !(-e "$projectroot/$input/$export_ok")) ||
+		!check_export_ok("$projectroot/$input") ||
 		($strict_export && !project_in_list($input))) {
 		return undef;
 	} else {
-- 
tg: (933bb3a..) t/authenticate/unify-exportok (depends on: vanilla/master)

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

end of thread, other threads:[~2008-11-05 22:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-05 22:15 [PATCH] gitweb: Use single implementation of export_ok check Alexander Gavrilov
2008-11-05 22:41 ` Jakub Narebski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox