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

[PATCH/current master] gitweb: do not use 'No such directory' error message

From
MLMatthias Lederhofer <matled@gmx.net>
Date
Sep 16, 2006, 22:30 UTC
Message-ID
<20060916223027.GA32679@moooo.ath.cx>
In-Reply-To
<20060916192750.GA27008@moooo.ath.cx>
undef $project; to prevent a file named description to be read.
---
Sorry, I patched an old version.  Here is the patch for the current
master/next.
---
 gitweb/gitweb.perl |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index a81c8d4..07ea1ea 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -203,13 +203,10 @@ if (defined $project) {
 	$project = undef unless $project;
 }
 if (defined $project) {
-	if (!validate_input($project)) {
-		die_error(undef, "Invalid project parameter");
-	}
-	if (!(-d "$projectroot/$project")) {
-		die_error(undef, "No such directory");
-	}
-	if (!(-e "$projectroot/$project/HEAD")) {
+	if (!validate_input($project) ||
+	    !(-d "$projectroot/$project") ||
+	    !(-e "$projectroot/$project/HEAD")) {
+		undef $project;
 		die_error(undef, "No such project");
 	}
 	$git_dir = "$projectroot/$project";
-- 
1.4.2.g0ea2
Previous: Matthias LederhoferNext: Matthias Lederhofer
Message 7 of 15 in “gitweb: export-ok option”
  1. gitweb: export-ok optionMatthias Lederhofer, Sep 16, 2006
  2. Jakub NarebskiSep 16, 2006
  3. Matthias LederhoferSep 16, 2006
  4. Junio C HamanoSep 16, 2006
  5. Jakub NarebskiSep 16, 2006
  6. gitweb: option 'strict export'Matthias Lederhofer, Sep 16, 2006
  7. gitweb: do not use 'No such directory' error messageMatthias Lederhofer, Sep 16, 2006
  8. gitweb: export optionsMatthias Lederhofer, Sep 16, 2006
  9. Junio C HamanoSep 17, 2006
  10. Matthias LederhoferSep 17, 2006
  11. Junio C HamanoSep 17, 2006
  12. gitweb: fix warnings in PATH_INFO code and add export_ok/strict_exportMatthias Lederhofer, Sep 17, 2006
  13. Junio C HamanoSep 17, 2006
  14. Jakub NarebskiSep 17, 2006
  15. Junio C HamanoSep 17, 2006

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.