NetBSD-Bugs archive

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

re: bin/38466: cvsweb does not work with httpd




could you please test this patch?  (it might not apply
directly, i have only tested it outside of netbsd src.)

it changes the cgi index.html code to only run if you
set the index.html name, so the default should work for
you now.


.mrg.


Index: bozohttpd.c
===================================================================
RCS file: /home/cvs/bozohttpd/bozohttpd.c,v
retrieving revision 1.145
diff -p -u -r1.145 bozohttpd.c
--- bozohttpd.c 4 Mar 2008 08:10:13 -0000       1.145
+++ bozohttpd.c 20 Apr 2008 15:57:44 -0000
@@ -165,6 +165,7 @@ static      int     eflag;          /* don't clean enviro
        const char *Iflag = "http";/* bind port; default "http" */
        int     Iflag_set;
        int     dflag = 0;      /* debugging level */
+       int     xflag_set;      /* have set index_html */
        char    *myname;        /* my name */
 
 #ifndef LOG_FTP
@@ -344,6 +345,7 @@ main(int argc, char **argv)
                        break;
 
                case 'x':
+                       xflag_set = 1;
                        index_html = optarg;
                        break;
 
Index: bozohttpd.h
===================================================================
RCS file: /home/cvs/bozohttpd/bozohttpd.h,v
retrieving revision 1.19
diff -p -u -r1.19 bozohttpd.h
--- bozohttpd.h 4 Mar 2008 04:46:38 -0000       1.19
+++ bozohttpd.h 20 Apr 2008 15:57:44 -0000
@@ -130,7 +130,7 @@ void        *bozorealloc(void *, size_t);
 char   *bozostrdup(const char *);
 
 extern const char *Iflag;
-extern int     Iflag_set;
+extern int     Iflag_set, xflag_set;
 extern int     bflag, fflag;
 extern char    *slashdir;
 extern const char http_09[];
Index: cgi-bozo.c
===================================================================
RCS file: /home/cvs/bozohttpd/cgi-bozo.c,v
retrieving revision 1.20
diff -p -u -r1.20 cgi-bozo.c
--- cgi-bozo.c  4 Mar 2008 05:42:28 -0000       1.20
+++ cgi-bozo.c  20 Apr 2008 15:57:44 -0000
@@ -117,7 +117,8 @@ process_cgi(http_req *request)
        info = NULL;
 
        len = strlen(url);
-       if (len == 0 || url[len - 1] == '/') {  /* append index.html */
+       /* only append index.html if -x is set */
+       if (xflag_set && (len == 0 || url[len - 1] == '/')) {
                debug((DEBUG_FAT, "appending index.html"));
                url = bozorealloc(url, len + strlen(index_html) + 1);
                if (url == NULL)


Home | Main Index | Thread Index | Old Index