git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthias Lederhofer <matled@gmx.net>
To: git@vger.kernel.org
Subject: [PATCH/current master] gitweb: do not use 'No such directory' error message
Date: Sun, 17 Sep 2006 00:30:27 +0200	[thread overview]
Message-ID: <20060916223027.GA32679@moooo.ath.cx> (raw)
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

  parent reply	other threads:[~2006-09-16 22:30 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-16 19:27 [PATCH] gitweb: export-ok option Matthias Lederhofer
2006-09-16 19:40 ` Jakub Narebski
2006-09-16 20:33   ` Matthias Lederhofer
2006-09-16 20:37   ` Junio C Hamano
2006-09-16 19:44 ` Jakub Narebski
2006-09-16 21:43 ` [PATCH] gitweb: option 'strict export' Matthias Lederhofer
2006-09-16 22:30 ` Matthias Lederhofer [this message]
2006-09-16 22:31   ` [PATCH] gitweb: export options Matthias Lederhofer
2006-09-17  8:53     ` Junio C Hamano
2006-09-17  9:07       ` Matthias Lederhofer
2006-09-17 10:34         ` Junio C Hamano
2006-09-17 13:29           ` [PATCH] gitweb: fix warnings in PATH_INFO code and add export_ok/strict_export Matthias Lederhofer
2006-09-17 22:06             ` Junio C Hamano
2006-09-17 22:45               ` Jakub Narebski
2006-09-17 23:10                 ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060916223027.GA32679@moooo.ath.cx \
    --to=matled@gmx.net \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).