{"thread":{"id":"46410","subject":"[PATCH] check for search permission","startedAt":"2017-07-17T19:26:24Z","lastAt":"2017-07-18T21:06:46Z","messageCount":4,"participants":["Hielke Christian Braun","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"324664","messageId":"0102015d5203f2ae-c7f1daeb-a6ab-413d-9036-c8da816c4c18-000000@eu-west-1.amazonses.com","threadId":"46410","inReplyTo":null,"subject":"[PATCH] check for search permission","fromName":"Hielke Christian Braun","fromEmail":"hcb@unco.de","sentAt":"2017-07-17T19:26:16Z","receivedAt":"2017-07-17T19:26:24Z","isPatch":true,"sender":{"key":"hcb@unco.de","avatar":null},"body":"---\n gitweb/gitweb.perl | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 3d4a8ee27c96a..9208f42ed1753 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -3071,6 +3071,8 @@ sub git_get_projects_list {\n \t\t\t\treturn if (m!^[/.]$!);\n \t\t\t\t# only directories can be git repositories\n \t\t\t\treturn unless (-d $_);\n+\t\t\t\t# need search permission\n+\t\t\t\treturn unless (-x $_);\n \t\t\t\t# don't traverse too deep (Find is super slow on os x)\n \t\t\t\t# $project_maxdepth excludes depth of $projectroot\n \t\t\t\tif (($File::Find::name =~ tr!/!!) - $pfxdepth > $project_maxdepth) {\n\n--\nhttps://github.com/git/git/pull/384\n"},{"id":"324681","messageId":"xmqqd18yhl5v.fsf@gitster.mtv.corp.google.com","threadId":"46410","inReplyTo":"0102015d5203f2ae-c7f1daeb-a6ab-413d-9036-c8da816c4c18-000000@eu-west-1.amazonses.com","subject":"Re: [PATCH] check for search permission","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-07-17T20:18:36Z","receivedAt":"2017-07-17T20:18:43Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Hielke Christian Braun <hcb@unco.de> writes:\n\n> ---\n>  gitweb/gitweb.perl | 2 ++\n>  1 file changed, 2 insertions(+)\n\nThanks for trying to help and welcome to Git development community.\nBut\n\n (1) Please double-check the title of your change.  Imagine that the\n     title appears in a list of 600 other commits that goes in a\n     single release in \"git shortlog --no-merges\" output.  Does it\n     tell readers of the list what the change is about?  We cannot\n     even guess that it is about the project list that appears in\n     gitweb output.\n\n (2) Please explain what problem this is trying to solve; that is\n     what the blank space before \"---\" line we see up above is for.\n     What happens in the current code under what condition, until we\n     do not apply this patch, and why is it a bad thing to happen?\n     Once we apply this patch, in what way the situation gets\n     improved?\n\n (3) Please sign-off your patch (see SubmittingPatches in\n     Documentation).\n\nThanks.\n\n>\n> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\n> index 3d4a8ee27c96a..9208f42ed1753 100755\n> --- a/gitweb/gitweb.perl\n> +++ b/gitweb/gitweb.perl\n> @@ -3071,6 +3071,8 @@ sub git_get_projects_list {\n>  \t\t\t\treturn if (m!^[/.]$!);\n>  \t\t\t\t# only directories can be git repositories\n>  \t\t\t\treturn unless (-d $_);\n> +\t\t\t\t# need search permission\n> +\t\t\t\treturn unless (-x $_);\n>  \t\t\t\t# don't traverse too deep (Find is super slow on os x)\n>  \t\t\t\t# $project_maxdepth excludes depth of $projectroot\n>  \t\t\t\tif (($File::Find::name =~ tr!/!!) - $pfxdepth > $project_maxdepth) {\n>\n> --\n> https://github.com/git/git/pull/384\n"},{"id":"324699","messageId":"8e4adda7-11df-8a26-71a8-2e6429b04c67@unco.de","threadId":"46410","inReplyTo":"xmqqd18yhl5v.fsf@gitster.mtv.corp.google.com","subject":"[PATCH] gitweb bugfix - check for search permission on sub-directories while scanning project root to prevent program termination","fromName":"Hielke Christian Braun","fromEmail":"hcb@unco.de","sentAt":"2017-07-18T08:41:54Z","receivedAt":"2017-07-18T08:47:25Z","isPatch":true,"sender":{"key":"hcb@unco.de","avatar":null},"body":"Hi,\n\ngitweb terminates and shows no project list, if it can not access a\nsub-directory in the project root directory. It should show a list of\nthe projects it can access. Patch corrects this by skipping inaccessible\ndirectories.\n\n\nSigned-off-by: Hielke Christian Braun <hcb@unco.de>\n\n\n---\n gitweb/gitweb.perl | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 3d4a8ee27c96a..9208f42ed1753 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -3071,6 +3071,8 @@ sub git_get_projects_list {\n \t\t\t\treturn if (m!^[/.]$!);\n \t\t\t\t# only directories can be git repositories\n \t\t\t\treturn unless (-d $_);\n+\t\t\t\t# need search permission\n+\t\t\t\treturn unless (-x $_);\n \t\t\t\t# don't traverse too deep (Find is super slow on os x)\n \t\t\t\t# $project_maxdepth excludes depth of $projectroot\n \t\t\t\tif (($File::Find::name =~ tr!/!!) - $pfxdepth > $project_maxdepth) {\n\n--\nhttps://github.com/git/git/pull/384\n\n\n\n\n\n\nOn 2017-07-17 22:18, Junio C Hamano wrote:\n> Hielke Christian Braun <hcb@unco.de> writes:\n> \n>> ---\n>>  gitweb/gitweb.perl | 2 ++\n>>  1 file changed, 2 insertions(+)\n> \n> Thanks for trying to help and welcome to Git development community.\n> But\n> \n>  (1) Please double-check the title of your change.  Imagine that the\n>      title appears in a list of 600 other commits that goes in a\n>      single release in \"git shortlog --no-merges\" output.  Does it\n>      tell readers of the list what the change is about?  We cannot\n>      even guess that it is about the project list that appears in\n>      gitweb output.\n> \n>  (2) Please explain what problem this is trying to solve; that is\n>      what the blank space before \"---\" line we see up above is for.\n>      What happens in the current code under what condition, until we\n>      do not apply this patch, and why is it a bad thing to happen?\n>      Once we apply this patch, in what way the situation gets\n>      improved?\n> \n>  (3) Please sign-off your patch (see SubmittingPatches in\n>      Documentation).\n> \n> Thanks.\n> \n>>\n>> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\n>> index 3d4a8ee27c96a..9208f42ed1753 100755\n>> --- a/gitweb/gitweb.perl\n>> +++ b/gitweb/gitweb.perl\n>> @@ -3071,6 +3071,8 @@ sub git_get_projects_list {\n>>  \t\t\t\treturn if (m!^[/.]$!);\n>>  \t\t\t\t# only directories can be git repositories\n>>  \t\t\t\treturn unless (-d $_);\n>> +\t\t\t\t# need search permission\n>> +\t\t\t\treturn unless (-x $_);\n>>  \t\t\t\t# don't traverse too deep (Find is super slow on os x)\n>>  \t\t\t\t# $project_maxdepth excludes depth of $projectroot\n>>  \t\t\t\tif (($File::Find::name =~ tr!/!!) - $pfxdepth > $project_maxdepth) {\n>>\n>> --\n>> https://github.com/git/git/pull/384\n"},{"id":"324745","messageId":"xmqq7ez5o3p1.fsf@gitster.mtv.corp.google.com","threadId":"46410","inReplyTo":"8e4adda7-11df-8a26-71a8-2e6429b04c67@unco.de","subject":"Re: [PATCH] gitweb bugfix - check for search permission on sub-directories while scanning project root to prevent program termination","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-07-18T21:06:18Z","receivedAt":"2017-07-18T21:06:46Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Hielke Christian Braun <hcb@unco.de> writes:\n\n> Hi,\n>\n> gitweb terminates and shows no project list, if it can not access a\n> sub-directory in the project root directory. It should show a list of\n> the projects it can access. Patch corrects this by skipping inaccessible\n> directories.\n>\n>\n> Signed-off-by: Hielke Christian Braun <hcb@unco.de>\n>\n>\n> ---\n>  gitweb/gitweb.perl | 2 ++\n>  1 file changed, 2 insertions(+)\n>\n> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\n> index 3d4a8ee27c96a..9208f42ed1753 100755\n> --- a/gitweb/gitweb.perl\n> +++ b/gitweb/gitweb.perl\n> @@ -3071,6 +3071,8 @@ sub git_get_projects_list {\n>  \t\t\t\treturn if (m!^[/.]$!);\n>  \t\t\t\t# only directories can be git repositories\n>  \t\t\t\treturn unless (-d $_);\n> +\t\t\t\t# need search permission\n> +\t\t\t\treturn unless (-x $_);\n>  \t\t\t\t# don't traverse too deep (Find is super slow on os x)\n>  \t\t\t\t# $project_maxdepth excludes depth of $projectroot\n>  \t\t\t\tif (($File::Find::name =~ tr!/!!) - $pfxdepth > $project_maxdepth) {\n>\n> --\n> https://github.com/git/git/pull/384\n\nI've tweaked the title and the log message further before queuing\nthe patch.\n\nThanks.  \n\n"}]}