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

Re: [PATCH] gitweb bugfix - check for search permission on sub-directories while scanning project root to prevent program termination

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 18, 2017, 21:06 UTC
Message-ID
<xmqq7ez5o3p1.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<8e4adda7-11df-8a26-71a8-2e6429b04c67@unco.de>
Hielke Christian Braun <hcb@unco.de> writes:
Show 31 quoted lines
> Hi,
>
> gitweb terminates and shows no project list, if it can not access a
> sub-directory in the project root directory. It should show a list of
> the projects it can access. Patch corrects this by skipping inaccessible
> directories.
>
>
> Signed-off-by: Hielke Christian Braun <hcb@unco.de>
>
>
> ---
>  gitweb/gitweb.perl | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index 3d4a8ee27c96a..9208f42ed1753 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -3071,6 +3071,8 @@ sub git_get_projects_list {
>  				return if (m!^[/.]$!);
>  				# only directories can be git repositories
>  				return unless (-d $_);
> +				# need search permission
> +				return unless (-x $_);
>  				# don't traverse too deep (Find is super slow on os x)
>  				# $project_maxdepth excludes depth of $projectroot
>  				if (($File::Find::name =~ tr!/!!) - $pfxdepth > $project_maxdepth) {
>
> --
> https://github.com/git/git/pull/384

I've tweaked the title and the log message further before queuing the patch.

Thanks.  
Previous: Hielke Christian Braun
Message 4 of 4 in “check for search permission”
  1. check for search permissionHielke Christian Braun, Jul 17, 2017
  2. Junio C HamanoJul 17, 2017
  3. gitweb bugfix - check for search permission on sub-directories while scanning project root to prevent program terminationHielke Christian Braun, Jul 18, 2017
  4. Junio C HamanoJul 18, 2017

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.