{"thread":{"id":"16189","subject":"[PATCH] gitweb: Use single implementation of export_ok check.","startedAt":"2008-11-05T22:15:56Z","lastAt":"2008-11-05T22:41:43Z","messageCount":2,"participants":["Alexander Gavrilov","Jakub Narebski"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"95005","messageId":"200811060115.57168.angavrilov@gmail.com","threadId":"16189","inReplyTo":null,"subject":"[PATCH] gitweb: Use single implementation of export_ok check.","fromName":"Alexander Gavrilov","fromEmail":"angavrilov@gmail.com","sentAt":"2008-11-05T22:15:56Z","receivedAt":"2008-11-05T22:15:56Z","isPatch":true,"sender":{"key":"angavrilov@gmail.com","avatar":"https://avatars.githubusercontent.com/u/42666?v=4"},"body":"GitWeb source contains a special function that implements the\nexport_ok check, but validate_project still uses a separate copy\nof essentially the same code.\n\nThis patch makes it use the dedicated function, thus ensuring\nthat all checks are done through a single code path.\n\nSigned-off-by: Alexander Gavrilov <angavrilov@gmail.com>\n---\n\n\tFor reference, here is the function:\n\n\tsub check_export_ok {\n\t\tmy ($dir) = @_;\n\t\treturn (check_head_link($dir) &&\n\t\t\t(!$export_ok || -e \"$dir/$export_ok\"));\n\t}\n\n\n gitweb/gitweb.perl |    3 +--\n 1 files changed, 1 insertions(+), 2 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex c5254af..172ea6b 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -742,8 +742,7 @@ sub validate_project {\n \tmy $input = shift || return undef;\n \tif (!validate_pathname($input) ||\n \t\t!(-d \"$projectroot/$input\") ||\n-\t\t!check_head_link(\"$projectroot/$input\") ||\n-\t\t($export_ok && !(-e \"$projectroot/$input/$export_ok\")) ||\n+\t\t!check_export_ok(\"$projectroot/$input\") ||\n \t\t($strict_export && !project_in_list($input))) {\n \t\treturn undef;\n \t} else {\n-- \ntg: (933bb3a..) t/authenticate/unify-exportok (depends on: vanilla/master)\n"},{"id":"95010","messageId":"200811052341.43746.jnareb@gmail.com","threadId":"16189","inReplyTo":"200811060115.57168.angavrilov@gmail.com","subject":"Re: [PATCH] gitweb: Use single implementation of export_ok check.","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-11-05T22:41:43Z","receivedAt":"2008-11-05T22:41:43Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Alexander Gavrilov wrote:\n\n> GitWeb source contains a special function that implements the\n\ns/GitWeb/gitweb/\n\n> export_ok check, but validate_project still uses a separate copy\n> of essentially the same code.\n> \n> This patch makes it use the dedicated function, thus ensuring\n> that all checks are done through a single code path.\n> \n> Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>\n\nAcked-by: Jakub Narebski <jnareb@gmail.com>\n\n-- \nJakub Narebski\nPoland\n"}]}