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

[PATCH] gitweb: Use single implementation of export_ok check.

From
Alexander Gavrilov <angavrilov@gmail.com>
Date
Nov 5, 2008, 22:15 UTC
Message-ID
<200811060115.57168.angavrilov@gmail.com>

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)
Next: Jakub Narebski
Message 1 of 2 in “gitweb: Use single implementation of export_ok check.”
  1. gitweb: Use single implementation of export_ok check.Alexander Gavrilov, Nov 5, 2008
  2. Jakub NarebskiNov 5, 2008

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.