{"thread":{"id":"20512","subject":"[PATCH] git-instaweb: detect difference between mod_cgi and mod_cgid for apache2","startedAt":"2009-08-10T05:19:53Z","lastAt":"2009-08-11T01:23:30Z","messageCount":2,"participants":["Mark A Rada"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"120109","messageId":"8366E0BD-3A64-4DDD-B12C-2FD48C357FFB@mailservices.uwaterloo.ca","threadId":"20512","inReplyTo":null,"subject":"[PATCH] git-instaweb: detect difference between mod_cgi and mod_cgid for apache2","fromName":"Mark A Rada","fromEmail":"marada@uwaterloo.ca","sentAt":"2009-08-10T05:19:53Z","receivedAt":"2009-08-10T05:19:53Z","isPatch":true,"sender":{"key":"marada@uwaterloo.ca","avatar":"https://avatars.githubusercontent.com/u/38430?v=4"},"body":"I'm not sure if this should have been two patches or just one.\n\nFirst I changed the check of whether mod_cgi is built in or not from  \nmatching against\n'mod_cgi.c' to 'mod_cgi' because I made the assumption that mod_cgid  \nwould be called\n'mod_cgid.c' (I haven't actually checked this, but it sounds  \nreasonable). Then, the\nsecond change handles the two cases when no cgi module is built in,  \nwhich I  did try\n(for mod_cgid that is).\n\nAlso, should the socket needed for mod_cgid be put in $GIT_DIR or  \nsomewhere else?\n\n\ntl;dr I only actually tried 1/4 cases, everything else looks reasonable\n\n\n--\nMark A Rada (ferrous26)\nmarada@uwaterloo.ca\n\n\n--->8---\nSome people have mod_cgid in place of mod_cgi, this will check which one\nthe user has available to them first, and then act accordingly.\n\nSigned-off-by: Mark Rada <marada@uwaterloo.ca>\n---\n  git-instaweb.sh |   10 ++++++++--\n  1 files changed, 8 insertions(+), 2 deletions(-)\n\ndiff --git a/git-instaweb.sh b/git-instaweb.sh\nindex 5f5cac7..fdac0d0 100755\n--- a/git-instaweb.sh\n+++ b/git-instaweb.sh\n@@ -297,8 +297,14 @@ EOF\n  \t\t# plain-old CGI\n  \t\tresolve_full_httpd\n  \t\tlist_mods=$(echo \"$full_httpd\" | sed \"s/-f$/-l/\")\n-\t\t$list_mods | grep 'mod_cgi\\.c' >/dev/null 2>&1 || \\\n-\t\techo \"LoadModule cgi_module $module_path/mod_cgi.so\" >> \"$conf\"\n+\t\t$list_mods | grep 'mod_cgi' >/dev/null 2>&1 || \\\n+\t\tif test -f \"$module_path/mod_cgi.so\"\n+\t\tthen\n+\t\t\techo \"LoadModule cgi_module $module_path/mod_cgi.so\" >> \"$conf\"\n+\t\telse\n+\t\t\techo \"LoadModule cgi_module $module_path/mod_cgid.so\" >> \"$conf\"\n+\t\t\techo \"ScriptSock $GIT_DIR/gitweb.sock\" >> \"$conf\"\n+\t\tfi\n  \t\tcat >> \"$conf\" <<EOF\n  AddHandler cgi-script .cgi\n  <Location /gitweb.cgi>\n-- \n1.6.4\n"},{"id":"120213","messageId":"7B93F2E3-D6F9-4A5D-BAE1-F630F09E9909@mailservices.uwaterloo.ca","threadId":"20512","inReplyTo":"8366E0BD-3A64-4DDD-B12C-2FD48C357FFB@mailservices.uwaterloo.ca","subject":"Re: [PATCH] git-instaweb: detect difference between mod_cgi and mod_cgid for apache2","fromName":"Mark A Rada","fromEmail":"marada@uwaterloo.ca","sentAt":"2009-08-11T01:23:30Z","receivedAt":"2009-08-11T01:23:30Z","isPatch":true,"sender":{"key":"marada@uwaterloo.ca","avatar":"https://avatars.githubusercontent.com/u/38430?v=4"},"body":"If you haven't already, ignore this patch, I'm pretty sure it won't  \nwork for cases where mod_cgid\nis built in. I think it should be including the ScriptSock directive  \nwhen built in as well, but I don't\nhave a setup to test that on, and the apache documentation isn't very  \nspecific.\n\nI'll try again later, sorry for the spam.\n\n\n--\nMark A Rada (ferrous26)\nmarada@uwaterloo.ca\n\n\nOn 10-Aug-09, at 1:19 AM, Mark A Rada wrote:\n\n> I'm not sure if this should have been two patches or just one.\n>\n> First I changed the check of whether mod_cgi is built in or not from  \n> matching against\n> 'mod_cgi.c' to 'mod_cgi' because I made the assumption that mod_cgid  \n> would be called\n> 'mod_cgid.c' (I haven't actually checked this, but it sounds  \n> reasonable). Then, the\n> second change handles the two cases when no cgi module is built in,  \n> which I  did try\n> (for mod_cgid that is).\n>\n> Also, should the socket needed for mod_cgid be put in $GIT_DIR or  \n> somewhere else?\n>\n>\n> tl;dr I only actually tried 1/4 cases, everything else looks  \n> reasonable\n>\n>\n> --\n> Mark A Rada (ferrous26)\n> marada@uwaterloo.ca\n>\n>\n> --->8---\n> Some people have mod_cgid in place of mod_cgi, this will check which  \n> one\n> the user has available to them first, and then act accordingly.\n>\n> Signed-off-by: Mark Rada <marada@uwaterloo.ca>\n> ---\n> git-instaweb.sh |   10 ++++++++--\n> 1 files changed, 8 insertions(+), 2 deletions(-)\n>\n> diff --git a/git-instaweb.sh b/git-instaweb.sh\n> index 5f5cac7..fdac0d0 100755\n> --- a/git-instaweb.sh\n> +++ b/git-instaweb.sh\n> @@ -297,8 +297,14 @@ EOF\n> \t\t# plain-old CGI\n> \t\tresolve_full_httpd\n> \t\tlist_mods=$(echo \"$full_httpd\" | sed \"s/-f$/-l/\")\n> -\t\t$list_mods | grep 'mod_cgi\\.c' >/dev/null 2>&1 || \\\n> -\t\techo \"LoadModule cgi_module $module_path/mod_cgi.so\" >> \"$conf\"\n> +\t\t$list_mods | grep 'mod_cgi' >/dev/null 2>&1 || \\\n> +\t\tif test -f \"$module_path/mod_cgi.so\"\n> +\t\tthen\n> +\t\t\techo \"LoadModule cgi_module $module_path/mod_cgi.so\" >> \"$conf\"\n> +\t\telse\n> +\t\t\techo \"LoadModule cgi_module $module_path/mod_cgid.so\" >> \"$conf\"\n> +\t\t\techo \"ScriptSock $GIT_DIR/gitweb.sock\" >> \"$conf\"\n> +\t\tfi\n> \t\tcat >> \"$conf\" <<EOF\n> AddHandler cgi-script .cgi\n> <Location /gitweb.cgi>\n> -- \n> 1.6.4\n>\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n"}]}