pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/www/bozohttpd Add SCRIPT_FILENAME to the environment v...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/10b5c5008d73
branches:  trunk
changeset: 474422:10b5c5008d73
user:      lukem <lukem%pkgsrc.org@localhost>
date:      Thu Apr 29 12:12:31 2004 +0000

description:
Add SCRIPT_FILENAME to the environment variables provided to CGIs,
as a copy of SCRIPT_NAME with the leading `/' removed.
Note that SCRIPT_FILENAME is  _not_  a CGI/1.1 environment variable per
        http://cgi-spec.golux.com/

If SCRIPT_FILENAME is not set set PHP 4.3.6 as a CGI fails with
        No input file specified.
Apache sets this variable; it appears that many other CGI/1.1 compliant
web servers do not and thus PHP 4.3.6 as a CGI doesn't function with them.
"oh joy."

diffstat:

 www/bozohttpd/Makefile         |   4 ++--
 www/bozohttpd/distinfo         |   4 ++--
 www/bozohttpd/patches/patch-aa |  38 +++++++++++++++++++++++---------------
 3 files changed, 27 insertions(+), 19 deletions(-)

diffs (156 lines):

diff -r 5081d2c20832 -r 10b5c5008d73 www/bozohttpd/Makefile
--- a/www/bozohttpd/Makefile    Thu Apr 29 10:31:16 2004 +0000
+++ b/www/bozohttpd/Makefile    Thu Apr 29 12:12:31 2004 +0000
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.42 2004/03/28 21:24:12 martin Exp $
+# $NetBSD: Makefile,v 1.43 2004/04/29 12:12:31 lukem Exp $
 #
 
 DISTNAME=      bozohttpd-20040218
-PKGREVISION=   4
+PKGREVISION=   5
 CATEGORIES=    www
 MASTER_SITES=  ${MASTER_SITE_LOCAL}
 EXTRACT_SUFX=  .tar.bz2
diff -r 5081d2c20832 -r 10b5c5008d73 www/bozohttpd/distinfo
--- a/www/bozohttpd/distinfo    Thu Apr 29 10:31:16 2004 +0000
+++ b/www/bozohttpd/distinfo    Thu Apr 29 12:12:31 2004 +0000
@@ -1,6 +1,6 @@
-$NetBSD: distinfo,v 1.33 2004/03/28 21:25:16 martin Exp $
+$NetBSD: distinfo,v 1.34 2004/04/29 12:12:31 lukem Exp $
 
 SHA1 (bozohttpd-20040218.tar.bz2) = 849753fd96c75a2df7b7f79a0be329d52eabeaf9
 Size (bozohttpd-20040218.tar.bz2) = 31936 bytes
-SHA1 (patch-aa) = 713718b7ed61aed9411315677b3d952a4a954e8f
+SHA1 (patch-aa) = 02415ea7f0f43f3ecda424c924865289273cc192
 SHA1 (patch-ab) = 900a578833b82d45ad1a5f30600e0f0143b4bc6c
diff -r 5081d2c20832 -r 10b5c5008d73 www/bozohttpd/patches/patch-aa
--- a/www/bozohttpd/patches/patch-aa    Thu Apr 29 10:31:16 2004 +0000
+++ b/www/bozohttpd/patches/patch-aa    Thu Apr 29 12:12:31 2004 +0000
@@ -1,7 +1,7 @@
-$NetBSD: patch-aa,v 1.13 2004/03/28 20:52:00 martin Exp $
+$NetBSD: patch-aa,v 1.14 2004/04/29 12:12:31 lukem Exp $
 
---- bozohttpd.c.orig   2004-02-18 14:11:57.000000000 +0100
-+++ bozohttpd.c        2004-03-28 22:46:29.000000000 +0200
+--- bozohttpd.c.orig   2004-02-19 00:11:57.000000000 +1100
++++ bozohttpd.c
 @@ -136,6 +136,9 @@
  #ifndef REDIRECT_FILE
  #define REDIRECT_FILE ".bzredirect"
@@ -12,7 +12,7 @@
  
  /*
   * And so it begins ..
-@@ -329,7 +332,7 @@
+@@ -329,7 +332,7 @@ static     void    process_request(http_req *);
  static        void    check_special_files(http_req *, const char *);
  static        int     check_direct_access(http_req *request);
  static        char    *transform_request(http_req *, int *);
@@ -21,7 +21,7 @@
  static        void    print_header(http_req *, struct stat *, const char *,
                             const char *);
  
-@@ -1186,7 +1189,7 @@
+@@ -1186,7 +1189,7 @@ process_request(request)
        if (fstat(fd, &sb) < 0)
                http_error(500, request, "can't fstat");
        if (S_ISDIR(sb.st_mode))
@@ -30,7 +30,7 @@
                /* NOTREACHED */
        /* XXX RFC1945 10.9 If-Modified-Since (http code 304) */
  
-@@ -1438,6 +1441,9 @@
+@@ -1438,6 +1441,9 @@ check_special_files(http_req *request, c
        if (strcmp(name, REDIRECT_FILE) == 0)
                http_error(403, request,
                    "no permission to open redirect file");
@@ -40,7 +40,7 @@
  #ifdef DO_HTPASSWD
        if (strcmp(name, AUTH_FILE) == 0)
                http_error(403, request,
-@@ -1454,8 +1460,8 @@
+@@ -1454,8 +1460,8 @@ check_bzredirect(http_req *request)
  {
        struct stat sb;
        char dir[MAXPATHLEN], redir[MAXPATHLEN], redirpath[MAXPATHLEN];
@@ -51,7 +51,7 @@
  
  
        /*
-@@ -1477,19 +1483,35 @@
+@@ -1477,19 +1483,35 @@ check_bzredirect(http_req *request)
        }
  
        snprintf(redir, sizeof(redir), "%s/%s", dir, REDIRECT_FILE);
@@ -93,7 +93,7 @@
  }
  
  /*
-@@ -1602,7 +1624,7 @@
+@@ -1602,7 +1624,7 @@ transform_request(request, isindex)
                        if (asprintf(&slashindexhtml, "/%s", index_html) < 0)
                                error(1, "asprintf");
                        debug((DEBUG_FAT, "rflag: redirecting %s to %s", url, slashindexhtml));
@@ -102,7 +102,7 @@
                        /* NOTREACHED */
                }
        }
-@@ -1619,7 +1641,7 @@
+@@ -1619,7 +1641,7 @@ transform_request(request, isindex)
                if (url[2] == '\0')
                        http_error(404, request, "missing username");
                if (strchr(url + 2, '/') == NULL)
@@ -111,7 +111,7 @@
                        /* NOTREACHED */
                debug((DEBUG_FAT, "calling transform_user"));
                return (transform_user(request, isindex));
-@@ -1733,9 +1755,10 @@
+@@ -1733,9 +1755,10 @@ transform_user(request, isindex)
   * do automatic redirection
   */
  static void
@@ -123,7 +123,7 @@
  {
        char *urlbuf;
        char portbuf[20];
-@@ -1755,16 +1778,24 @@
+@@ -1755,16 +1778,24 @@ handle_redirect(request, url)
        (void)bozoprintf("%s 301 Document Moved\r\n", request->hr_proto);
        if (request->hr_proto != http_09) 
                print_header(request, NULL, "text/html", NULL);
@@ -153,7 +153,15 @@
        (void)bozoprintf("</body></html>\n");
  head:
        fflush(stdout);
-@@ -1977,8 +2008,8 @@
+@@ -1951,6 +1982,7 @@ process_cgi(request)
+       spsetenv("SERVER_PROTOCOL", request->hr_proto, curenvp++);
+       spsetenv("REQUEST_METHOD", request->hr_methodstr, curenvp++);
+       spsetenv("SCRIPT_NAME", url, curenvp++);
++      spsetenv("SCRIPT_FILENAME", url+1, curenvp++);
+       spsetenv("SERVER_SOFTWARE", server_software, curenvp++);
+       spsetenv("REQUEST_URI", request->hr_url, curenvp++);
+       spsetenv("DATE_GMT", date, curenvp++);
+@@ -1977,8 +2009,8 @@ process_cgi(request)
  
        /* may as well wait as long as possible */
  print_cgi_header:
@@ -163,7 +171,7 @@
                debug((DEBUG_OBESE, "process_cgi:  writing HTTP header .."));
                if (request->hr_proto != http_09)
                        print_header(NULL, NULL, NULL, NULL);
-@@ -1988,8 +2019,6 @@
+@@ -1988,8 +2020,6 @@ print_cgi_header:
        } else
                debug((DEBUG_OBESE, "process_cgi:  not-writing HTTP header .."));
  
@@ -172,7 +180,7 @@
        debug((DEBUG_FAT, "process_cgi: going exec %s, %s %s %s",
            path, argv[0], strornull(argv[1]), strornull(argv[2])));
  
-@@ -2291,6 +2320,7 @@
+@@ -2291,6 +2321,7 @@ static struct content_map content_map[] 
        { ".ppt",       "application/powerpoint",       "",             "", NULL },
        { ".rtf",       "application/rtf",              "",             "", NULL },
        { ".bcpio",     "application/x-bcpio",          "",             "", NULL },



Home | Main Index | Thread Index | Old Index