]> git.pld-linux.org Git - packages/apache1.git/commitdiff
- fixes and improvements from debian (apache_1.3.34-2.diff.gz)
authorElan Ruusamäe <glen@pld-linux.org>
Wed, 31 May 2006 11:28:49 +0000 (11:28 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    apache1-GNU_xargs.patch -> 1.1
    apache1-ab.8_formatting_error.patch -> 1.1
    apache1-autoindex_generator.patch -> 1.1
    apache1-autoindex_indexes.patch -> 1.1
    apache1-autoindex_studly.patch -> 1.1
    apache1-configure_hashbang.patch -> 1.1
    apache1-htpasswd_do_not_trash_extra_fields.patch -> 1.1
    apache1-inetdfix.patch -> 1.1
    apache1-log_files_permission.patch -> 1.1
    apache1-proxy_content_base.patch -> 1.1
    apache1-regex_must_conform_to_posix_for_LFS_to_work.patch -> 1.1
    apache1-security_check_forensic_tempfiles.patch -> 1.1
    apache1-security_htdigest_local_buffer_overflow.patch -> 1.1
    apache1-security_htpasswd_user_buffer_overflow.patch -> 1.1
    apache1-suexec_of_death.patch -> 1.1
    apache1-suexec_reopenlog.patch -> 1.1

16 files changed:
apache1-GNU_xargs.patch [new file with mode: 0644]
apache1-ab.8_formatting_error.patch [new file with mode: 0644]
apache1-autoindex_generator.patch [new file with mode: 0644]
apache1-autoindex_indexes.patch [new file with mode: 0644]
apache1-autoindex_studly.patch [new file with mode: 0644]
apache1-configure_hashbang.patch [new file with mode: 0644]
apache1-htpasswd_do_not_trash_extra_fields.patch [new file with mode: 0644]
apache1-inetdfix.patch [new file with mode: 0644]
apache1-log_files_permission.patch [new file with mode: 0644]
apache1-proxy_content_base.patch [new file with mode: 0644]
apache1-regex_must_conform_to_posix_for_LFS_to_work.patch [new file with mode: 0644]
apache1-security_check_forensic_tempfiles.patch [new file with mode: 0644]
apache1-security_htdigest_local_buffer_overflow.patch [new file with mode: 0644]
apache1-security_htpasswd_user_buffer_overflow.patch [new file with mode: 0644]
apache1-suexec_of_death.patch [new file with mode: 0644]
apache1-suexec_reopenlog.patch [new file with mode: 0644]

diff --git a/apache1-GNU_xargs.patch b/apache1-GNU_xargs.patch
new file mode 100644 (file)
index 0000000..29a6704
--- /dev/null
@@ -0,0 +1,10 @@
+diff -Naurd build-tree.orig/apache_1.3.34/src/support/check_forensic build-tree/apache_1.3.34/src/support/check_forensic
+--- build-tree.orig/apache_1.3.34/src/support/check_forensic   2004-01-15 21:46:20.000000000 +0100
++++ build-tree/apache_1.3.34/src/support/check_forensic        2004-05-18 19:30:32.000000000 +0200
+@@ -11,5 +11,5 @@
+ grep + < /tmp/fc-all.$$ | cut -c2- | sort > /tmp/fc-in.$$
+ grep -- - < /tmp/fc-all.$$ | cut -c2- | sort > /tmp/fc-out.$$
+ # use -i instead of -I for GNU xargs
+-join -v 1 /tmp/fc-in.$$ /tmp/fc-out.$$ | xargs -I xx egrep "^\\+xx" $F
++join -v 1 /tmp/fc-in.$$ /tmp/fc-out.$$ | xargs -ixx egrep "^\\+xx" $F
+ rm /tmp/fc-all.$$ /tmp/fc-in.$$ /tmp/fc-out.$$
diff --git a/apache1-ab.8_formatting_error.patch b/apache1-ab.8_formatting_error.patch
new file mode 100644 (file)
index 0000000..c5b6383
--- /dev/null
@@ -0,0 +1,11 @@
+--- build-tree/apache_1.3.34/src/support/ab.8  2004-10-01 21:28:14.000000000 +0200
++++ build-tree/apache_1.3.34/src/support/ab.8  2004-10-01 21:35:15.000000000 +0200
+@@ -185,7 +185,7 @@
+ percentage (from 1% to 100%) the time (in milli seconds) it took
+ to serve that percentage of the requests. This is usually more
+ usefull than the 'gnuplot' file; as the results are already
+-'binned'.
++\&'binned'.
+ .TP 12
+ .B \-v 
diff --git a/apache1-autoindex_generator.patch b/apache1-autoindex_generator.patch
new file mode 100644 (file)
index 0000000..3827ca7
--- /dev/null
@@ -0,0 +1,12 @@
+--- build-tree-apache-ssl/apache_1.3.34/src/modules/standard/mod_autoindex.c   2004-03-10 15:22:23.000000000 -0500
++++ build-tree-apache/apache_1.3.34/src/modules/standard/mod_autoindex.c       2004-03-19 09:45:18.953625781 -0500
+@@ -215,7 +215,8 @@
+ {
+     ap_rvputs(r, DOCTYPE_HTML_4_0T,
+             "<HTML>\n <HEAD>\n  <TITLE>Index of ", title,
+-            "</TITLE>\n </HEAD>\n <BODY bgcolor=\"",
++            "</TITLE>\n <META NAME=\"generator\", CONTENT=\"mod_autoindex\"> "
++            "</HEAD>\n <BODY bgcolor=\"",
+               autoindex_conf->body_col ?: "#ffffff", "\" text=\"",
+               autoindex_conf->text_col ?: "#000000", "\"", NULL);
+     if (autoindex_conf->opts & STUDLY_INDEXING) {
diff --git a/apache1-autoindex_indexes.patch b/apache1-autoindex_indexes.patch
new file mode 100644 (file)
index 0000000..61af3d4
--- /dev/null
@@ -0,0 +1,43 @@
+--- build-tree-apache/apache_1.3.34/src/modules/standard/mod_autoindex.c       Wed Mar 13 22:05:33 2002
++++ build-tree-apache/apache_1.3.34/src/modules/standard/mod_autoindex.c       Wed Apr 24 17:17:05 2002
+@@ -101,6 +101,7 @@
+ #define TRACK_MODIFIED 1024
+ #define SORT_NOCASE 2048
+ #define STUDLY_INDEXING 4096
++#define INDEXOPT_INDEXES 8192
+ #define K_PAD 1
+ #define K_NOPAD 0
+@@ -463,6 +464,9 @@
+       else if (!strcasecmp(w, "IgnoreCase")) {
+               option = SORT_NOCASE;
+       }
++      else if (!strcasecmp(w, "Indexes")) {
++            option = INDEXOPT_INDEXES;
++      }
+       else if (!strcasecmp(w, "None")) {
+           if (action != '\0') {
+               return "Cannot combine '+' or '-' with 'None' keyword";
+@@ -2012,7 +2016,7 @@
+ static int handle_autoindex(request_rec *r)
+ {
+     autoindex_config_rec *d;
+-    int allow_opts = ap_allow_options(r);
++    int opt_indexes = ap_allow_options(r) & OPT_INDEXES;
+     d = (autoindex_config_rec *) ap_get_module_config(r->per_dir_config,
+                                                     &autoindex_module);
+@@ -2023,8 +2027,12 @@
+     }
+     /* OK, nothing easy.  Trot out the heavy artillery... */
++    if ((d->incremented_opts & INDEXOPT_INDEXES) ||
++      (d->opts & INDEXOPT_INDEXES)) opt_indexes = 1;
++    if ((d->decremented_opts & INDEXOPT_INDEXES) &&
++      !(d->opts & INDEXOPT_INDEXES)) opt_indexes = 0;
+-    if (allow_opts & OPT_INDEXES) {
++    if (opt_indexes) {
+       /* KLUDGE --- make the sub_req lookups happen in the right directory.
+        * Fixing this in the sub_req_lookup functions themselves is difficult,
+        * and would probably break virtual includes...
diff --git a/apache1-autoindex_studly.patch b/apache1-autoindex_studly.patch
new file mode 100644 (file)
index 0000000..08a5aa7
--- /dev/null
@@ -0,0 +1,511 @@
+--- build-tree-apache/apache_1.3.34/src/modules/standard/mod_autoindex.c       2003-12-09 14:47:37.000000000 -0500
++++ build-tree-apache/apache_1.3.34/src/modules/standard/mod_autoindex.c       2004-02-19 13:16:31.000000000 -0500
+@@ -63,6 +63,7 @@
+  * 3/23/93
+  * 
+  * Adapted to Apache by rst.
++ * StudlyIndexing by Johnie Ingram <johnie@netgod.net>
+  */
+ #include "httpd.h"
+@@ -99,6 +100,7 @@ module MODULE_VAR_EXPORT autoindex_modul
+ #define FOLDERS_FIRST 512
+ #define TRACK_MODIFIED 1024
+ #define SORT_NOCASE 2048
++#define STUDLY_INDEXING 4096
+ #define K_PAD 1
+ #define K_NOPAD 0
+@@ -163,6 +165,17 @@ typedef struct autoindex_config_struct {
+     array_header *ign_list;
+     array_header *hdr_list;
+     array_header *rdme_list;
++    array_header *side_list;
++    array_header *main_list;
++    array_header *ftr_list;
++
++    char *body_col;
++    char *text_col;
++    char *hdr_col;
++    char *rdme_col;
++    char *side_col;
++    char *main_col;
++    char *ftr_col;
+ } autoindex_config_rec;
+@@ -196,11 +209,19 @@ static ap_inline int is_parent(const cha
+  * We include the DOCTYPE because we may be using features therefrom (i.e.,
+  * HEIGHT and WIDTH attributes on the icons if we're FancyIndexing).
+  */
+-static void emit_preamble(request_rec *r, char *title)
++static void emit_preamble(request_rec *r, char *title,
++                          autoindex_config_rec *autoindex_conf)
+ {
+-    ap_rvputs(r, DOCTYPE_HTML_3_2,
++    ap_rvputs(r, DOCTYPE_HTML_4_0T,
+             "<HTML>\n <HEAD>\n  <TITLE>Index of ", title,
+-            "</TITLE>\n </HEAD>\n <BODY>\n", NULL);
++            "</TITLE>\n </HEAD>\n <BODY bgcolor=\"",
++              autoindex_conf->body_col ?: "#ffffff", "\" text=\"",
++              autoindex_conf->text_col ?: "#000000", "\"", NULL);
++    if (autoindex_conf->opts & STUDLY_INDEXING) {
++      ap_rvputs(r, " leftmargin=\"0\" topmargin=\"0\" \n "
++              "marginwidth=\"0\" marginheight=\"0\"", NULL);
++    }
++    ap_rputs(">\n\n", r);
+ }
+ static void push_item(array_header *arr, char *type, char *to, char *path,
+@@ -340,6 +361,27 @@ static const char *add_readme(cmd_parms 
+     return NULL;
+ }
++static const char *add_sidebar(cmd_parms *cmd, void *d, char *name)
++{
++    push_item(((autoindex_config_rec *) d)->side_list, 0, NULL, cmd->path,
++            name);
++    return NULL;
++}
++
++static const char *add_body(cmd_parms *cmd, void *d, char *name)
++{
++    push_item(((autoindex_config_rec *) d)->main_list, 0, NULL, cmd->path,
++            name);
++    return NULL;
++}
++
++static const char *add_footer(cmd_parms *cmd, void *d, char *name)
++{
++    push_item(((autoindex_config_rec *) d)->ftr_list, 0, NULL, cmd->path,
++            name);
++    return NULL;
++}
++
+ /* A legacy directive, FancyIndexing is superseded by the IndexOptions
+  * keyword.  But for compatibility..
+  */
+@@ -385,6 +427,12 @@ static const char *add_opts(cmd_parms *c
+       if (!strcasecmp(w, "FancyIndexing")) {
+           option = FANCY_INDEXING;
+       }
++      else if (!strcasecmp(w, "StudlyIndexing")) {
++            /* automatic FancyIndexing on, NameWidth=*, etc. */
++          option = STUDLY_INDEXING + FANCY_INDEXING
++              + ICONS_ARE_LINKS + SUPPRESS_DESC;
++            d_cfg->name_adjust = K_ADJUST;
++      }
+       else if (!strcasecmp(w, "IconsAreLinks")) {
+           option = ICONS_ARE_LINKS;
+       }
+@@ -406,16 +454,16 @@ static const char *add_opts(cmd_parms *c
+         else if (!strcasecmp(w, "SuppressColumnSorting")) {
+             option = SUPPRESS_COLSORT;
+       }
+-        else if (!strcasecmp(w, "FoldersFirst")) {
+-            option = FOLDERS_FIRST;
++      else if (!strcasecmp(w, "FoldersFirst")) {
++          option = FOLDERS_FIRST;
+       }
+       else if (!strcasecmp(w, "TrackModified")) {
+-            option = TRACK_MODIFIED;
++          option = TRACK_MODIFIED;
+       }
+       else if (!strcasecmp(w, "IgnoreCase")) {
+-            option = SORT_NOCASE;
++          option = SORT_NOCASE;
+       }
+-        else if (!strcasecmp(w, "None")) {
++      else if (!strcasecmp(w, "None")) {
+           if (action != '\0') {
+               return "Cannot combine '+' or '-' with 'None' keyword";
+           }
+@@ -501,7 +549,49 @@ static const char *add_opts(cmd_parms *c
+               d_cfg->desc_adjust = K_NOADJUST;
+           }
+       }
+-        else {
++      else if (!strncasecmp(w, "BodyColor=", 10)) {
++          if (action == '-') {
++              return "Cannot combine '-' with BodyColor=#xxxxxx";
++          }
++          d_cfg->body_col = ap_pstrdup(d_cfg->desc_list->pool, &w[10]);
++      }
++      else if (!strncasecmp(w, "TextColor=", 10)) {
++          if (action == '-') {
++              return "Cannot combine '-' with TextColor=#xxxxxx";
++          }
++          d_cfg->text_col = ap_pstrdup(d_cfg->desc_list->pool, &w[10]);
++      }
++      else if (!strncasecmp(w, "HeaderColor=", 12)) {
++          if (action == '-') {
++              return "Cannot combine '-' with HeaderColor=#xxxxxx";
++          }
++          d_cfg->hdr_col = ap_pstrdup(d_cfg->desc_list->pool, &w[12]);
++      }
++      else if (!strncasecmp(w, "ReadmeColor=", 12)) {
++          if (action == '-') {
++              return "Cannot combine '-' with ReadmeColor=#xxxxxx";
++          }
++          d_cfg->rdme_col = ap_pstrdup(d_cfg->desc_list->pool, &w[12]);
++      }
++      else if (!strncasecmp(w, "SidebarColor=", 13)) {
++          if (action == '-') {
++              return "Cannot combine '-' with SidebarColor=#xxxxxx";
++          }
++          d_cfg->side_col = ap_pstrdup(d_cfg->desc_list->pool, &w[13]);
++      }
++      else if (!strncasecmp(w, "MainColor=", 10)) {
++          if (action == '-') {
++              return "Cannot combine '-' with MainColor=#xxxxxx";
++          }
++          d_cfg->main_col = ap_pstrdup(d_cfg->desc_list->pool, &w[10]);
++      }
++      else if (!strncasecmp(w, "FooterColor=", 12)) {
++          if (action == '-') {
++              return "Cannot combine '-' with FooterColor=#xxxxxx";
++          }
++          d_cfg->ftr_col = ap_pstrdup(d_cfg->desc_list->pool, &w[12]);
++      }
++      else {
+           return "Invalid directory indexing option";
+       }
+       if (action == '\0') {
+@@ -595,6 +685,9 @@ static const command_rec autoindex_cmds[
+      "Descriptive text followed by one or more filenames"},
+     {"HeaderName", add_header, NULL, DIR_CMD_PERMS, TAKE1, "a filename"},
+     {"ReadmeName", add_readme, NULL, DIR_CMD_PERMS, TAKE1, "a filename"},
++    {"SidebarName", add_sidebar, NULL, DIR_CMD_PERMS, TAKE1, "a filename"},
++    {"BodyName", add_body, NULL, DIR_CMD_PERMS, TAKE1, "a filename"},
++    {"FooterName", add_footer, NULL, DIR_CMD_PERMS, TAKE1, "a filename"},
+     {"FancyIndexing", fancy_indexing, NULL, DIR_CMD_PERMS, FLAG,
+      "Limited to 'on' or 'off' (superseded by IndexOptions FancyIndexing)"},
+     {"DefaultIcon", ap_set_string_slot,
+@@ -620,6 +713,9 @@ static void *create_autoindex_config(poo
+     new->ign_list = ap_make_array(p, 4, sizeof(struct item));
+     new->hdr_list = ap_make_array(p, 4, sizeof(struct item));
+     new->rdme_list = ap_make_array(p, 4, sizeof(struct item));
++    new->side_list = ap_make_array(p, 4, sizeof(struct item));
++    new->main_list = ap_make_array(p, 4, sizeof(struct item));
++    new->ftr_list = ap_make_array(p, 4, sizeof(struct item));
+     new->opts = 0;
+     new->incremented_opts = 0;
+     new->decremented_opts = 0;
+@@ -646,6 +742,9 @@ static void *merge_autoindex_configs(poo
+     new->desc_list = ap_append_arrays(p, add->desc_list, base->desc_list);
+     new->icon_list = ap_append_arrays(p, add->icon_list, base->icon_list);
+     new->rdme_list = ap_append_arrays(p, add->rdme_list, base->rdme_list);
++    new->side_list = ap_append_arrays(p, add->side_list, base->side_list);
++    new->main_list = ap_append_arrays(p, add->main_list, base->main_list);
++    new->ftr_list = ap_append_arrays(p, add->ftr_list, base->ftr_list);
+     if (add->opts & NO_OPTIONS) {
+       /*
+        * If the current directory says 'no options' then we also
+@@ -715,6 +814,22 @@ static void *merge_autoindex_configs(poo
+     new->default_order = (add->default_order != NULL)
+       ? add->default_order : base->default_order;
++
++    new->body_col = (add->body_col != NULL)
++      ? add->body_col : base->body_col;
++    new->text_col = (add->text_col != NULL)
++      ? add->text_col : base->text_col;
++    new->hdr_col = (add->hdr_col != NULL)
++      ? add->hdr_col : base->hdr_col;
++    new->rdme_col = (add->rdme_col != NULL)
++      ? add->rdme_col : base->rdme_col;
++    new->side_col = (add->side_col != NULL)
++      ? add->side_col : base->side_col;
++    new->main_col = (add->main_col != NULL)
++      ? add->main_col : base->main_col;
++    new->ftr_col = (add->ftr_col != NULL)
++      ? add->ftr_col : base->ftr_col;
++
+     return new;
+ }
+@@ -789,7 +904,10 @@ static char *find_item(request_rec *r, a
+ #define find_icon(d,p,t) find_item(p,d->icon_list,t)
+ #define find_alt(d,p,t) find_item(p,d->alt_list,t)
+ #define find_header(d,p) find_item(p,d->hdr_list,0)
++#define find_sidebar(d,p) find_item(p,d->side_list,0)
+ #define find_readme(d,p) find_item(p,d->rdme_list,0)
++#define find_main(d,p) find_item(p,d->main_list,0)
++#define find_footer(d,p) find_item(p,d->ftr_list,0)
+ static char *find_default_icon(autoindex_config_rec *d, char *bogus_name)
+ {
+@@ -940,12 +1058,13 @@ static int ignore_entry(autoindex_config
+ /*
+  * emit a plain text file
+  */
+-static void do_emit_plain(request_rec *r, FILE *f)
++static void do_emit_plain(request_rec *r, FILE *f, int autoindex_opts)
+ {
+     char buf[IOBUFSIZE + 1];
+     int i, n, c, ch;
+-    ap_rputs("<PRE>\n", r);
++    if (! (autoindex_opts & STUDLY_INDEXING))
++      ap_rputs("<PRE>\n", r);
+     while (!feof(f)) {
+       do {
+           n = fread(buf, sizeof(char), IOBUFSIZE, f);
+@@ -977,7 +1096,50 @@ static void do_emit_plain(request_rec *r
+           c = i + 1;
+       }
+     }
+-    ap_rputs("</PRE>\n", r);
++    if (! (autoindex_opts & STUDLY_INDEXING))
++      ap_rputs("</PRE>\n", r);
++}
++
++/*
++ * If there's a file, send a subrequest to look for it.  If it's
++ * found and a text file, handle it and return 0, otherwise return -1.
++ */
++static int do_emit_fancy(request_rec *r, const char *fname, int autoindex_opts)
++{
++    FILE *f;
++    request_rec *rr = NULL;
++
++    if ((fname != NULL)
++      && (rr = ap_sub_req_lookup_uri(fname, r))
++        && (rr->status == HTTP_OK)
++      && (rr->filename != NULL)
++      && S_ISREG(rr->finfo.st_mode)) {
++      /*
++       * Check for the two specific cases we allow: text/html and
++       * text/anything-else.  The former is allowed to be processed for
++       * SSIs.
++       */
++      if (rr->content_type != NULL) {
++          if (!strcasecmp(ap_field_noparam(r->pool, rr->content_type),
++                          "text/html")) {
++              if (ap_run_sub_req(rr) == OK) {
++                  /* worked... */
++                    return 0;
++              }
++          }
++          else if (!strncasecmp("text/", rr->content_type, 5)) {
++              if ((f = ap_pfopen(r->pool, rr->filename, "r")) != 0) {
++                  do_emit_plain(r, f, autoindex_opts);
++                  ap_pfclose(r->pool, f);
++                  return 0;
++              }
++          }
++      }
++    }
++    if (rr != NULL) {
++      ap_destroy_sub_req(rr);
++    }
++    return -1;
+ }
+ /* See mod_include */
+@@ -993,8 +1155,9 @@ static void do_emit_plain(request_rec *r
+  * instead of a text document, meaning nothing will be displayed, but
+  * oh well.
+  */
+-static void emit_head(request_rec *r, char *header_fname, int suppress_amble,
+-                    char *title)
++static void emit_head(request_rec *r, char *header_fname, 
++                      autoindex_config_rec *autoindex_conf,
++                      int autoindex_opts, char *title)
+ {
+     FILE *f;
+     request_rec *rr = NULL;
+@@ -1035,8 +1198,8 @@ static void emit_head(request_rec *r, ch
+               emit_amble = 0;
+               emit_H1 = 0;
+-              if (! suppress_amble) {
+-                  emit_preamble(r, title);
++              if (! (autoindex_opts & SUPPRESS_PREAMBLE)) {
++                  emit_preamble(r, title, autoindex_conf);
+               }
+               /* See mod_include */
+@@ -1050,7 +1213,7 @@ static void emit_head(request_rec *r, ch
+                */
+               if (ap_run_sub_req(rr) != OK) {
+                   /* It didn't work */
+-                  emit_amble = suppress_amble;
++                  emit_amble = autoindex_opts & SUPPRESS_PREAMBLE;
+                   emit_H1 = 1;
+               }
+               ap_table_unset(r->notes, PARENT_STRING);        /* cleanup */
+@@ -1063,9 +1226,9 @@ static void emit_head(request_rec *r, ch
+                * where it belongs.
+                */
+               if ((f = ap_pfopen(r->pool, rr->filename, "r")) != 0) {
+-                  emit_preamble(r, title);
++                  emit_preamble(r, title, autoindex_conf);
+                   emit_amble = 0;
+-                  do_emit_plain(r, f);
++                  do_emit_plain(r, f, autoindex_opts);
+                   ap_pfclose(r->pool, f);
+                   emit_H1 = 0;
+               }
+@@ -1085,10 +1248,28 @@ static void emit_head(request_rec *r, ch
+     }
+     if (emit_amble) {
+-      emit_preamble(r, title);
++      emit_preamble(r, title, autoindex_conf);
+     }
++
++    if (autoindex_opts & STUDLY_INDEXING) {
++      ap_rvputs(r, "<TABLE cellpadding=\"5\" cellspacing=\"5\" "
++              "width=\"100%\">\n<tbody>\n", NULL);
++    }
++
+     if (emit_H1) {
+-      ap_rvputs(r, "<H1>Index of ", title, "</H1>\n", NULL);
++      if (autoindex_opts & STUDLY_INDEXING)
++          ap_rvputs(r, "\n<TR valign=\"top\">\n"
++                  "<TD class=\"header\" bgcolor=\"",
++                  autoindex_conf->hdr_col ?: "#ffffff",
++                  "\" colspan=\"2\">\n", NULL);
++      ap_rputs("<TABLE><TR><TD bgcolor=\"#ffffff\" "
++              "class=\"title\">\n", r);
++      ap_rvputs(r, "<FONT size=\"+3\" "
++              "face=\"Helvetica,Arial,sans-serif\">\n<B>Index of ",
++              title, "</B></FONT>\n", NULL);
++      ap_rputs("\n</TD></TR></TABLE>", r);
++      if (autoindex_opts & STUDLY_INDEXING)
++          ap_rvputs(r, "</TD>\n</TR>\n", NULL);
+     }
+     if (rr != NULL) {
+       ap_destroy_sub_req(rr);
+@@ -1105,7 +1286,8 @@ static void emit_head(request_rec *r, ch
+  * instead of a text document, meaning nothing will be displayed, but
+  * oh well.
+  */
+-static void emit_tail(request_rec *r, char *readme_fname, int suppress_amble)
++static void emit_tail(request_rec *r, char *readme_fname,
++                      autoindex_config_rec *autoindex_conf, int autoindex_opts)
+ {
+     FILE *f;
+     request_rec *rr = NULL;
+@@ -1150,7 +1332,7 @@ static void emit_tail(request_rec *r, ch
+               if (ap_run_sub_req(rr) == OK) {
+                   /* worked... */
+                   suppress_sig = 1;
+-                  suppress_post = suppress_amble;
++                  suppress_post = autoindex_opts & SUPPRESS_PREAMBLE;
+               }
+               ap_table_unset(r->notes, PARENT_STRING);        /* cleanup */
+           }
+@@ -1159,7 +1341,7 @@ static void emit_tail(request_rec *r, ch
+                * If we can open the file, suppress the signature.
+                */
+               if ((f = ap_pfopen(r->pool, rr->filename, "r")) != 0) {
+-                  do_emit_plain(r, f);
++                  do_emit_plain(r, f, autoindex_opts & STUDLY_INDEXING);
+                   ap_pfclose(r->pool, f);
+                   suppress_sig = 1;
+               }
+@@ -1178,7 +1360,21 @@ static void emit_tail(request_rec *r, ch
+         ap_table_setn(hdrs, "Accept-Encoding", r_accept_enc);
+     }
++    if (autoindex_opts & STUDLY_INDEXING && !suppress_post) {
++      ap_rvputs(r, "\n<TR valign=\"top\">\n<TD class=\"footer\" "
++              "colspan=\"2\" bgcolor=\"",
++              autoindex_conf->ftr_col ?: "#ffffff", "\">\n", NULL);
++      if (do_emit_fancy (r, find_footer(autoindex_conf, r),
++                              autoindex_opts) == 0) {
++          suppress_sig = 1;
++      }
++      ap_rputs("</TD>\n</TR>\n\n</TBODY></TABLE>\n<P>\n", r);
++    }
+     if (!suppress_sig) {
++      if (autoindex_opts & STUDLY_INDEXING)
++          ap_rputs ("<BR><IMG src=\"/icons/linux-pengo-small.gif\"\n"
++                      "width=\"110\" height=\"44\" align=\"right\""
++                      "alt=\"\">", r);
+       ap_rputs(ap_psignature("", r), r);
+     }
+     if (!suppress_post) {
+@@ -1411,6 +1607,11 @@ static void output_directories(struct en
+     char *name_scratch;
+     char *pad_scratch;
++    if (autoindex_opts & STUDLY_INDEXING) {
++        if (do_emit_fancy (r, find_main(d, r), autoindex_opts) == 0)
++          return;
++    }
++
+     if (name[0] == '\0') {
+       name = "/";
+     }
+@@ -1443,7 +1644,8 @@ static void output_directories(struct en
+     if (autoindex_opts & FANCY_INDEXING) {
+       ap_rputs("<PRE>", r);
+       if ((tp = find_default_icon(d, "^^BLANKICON^^"))) {
+-          ap_rvputs(r, "<IMG SRC=\"", ap_escape_html(scratch, tp),
++          ap_rvputs(r, "<IMG border=\"0\" src=\"",
++                      ap_escape_html(scratch, tp),
+                  "\" ALT=\"     \"", NULL);
+           if (d->icon_width && d->icon_height) {
+               ap_rprintf
+@@ -1475,7 +1677,7 @@ static void output_directories(struct en
+             emit_link(r, "Description", K_DESC, keyid, direction,
+                       static_columns);
+       }
+-      ap_rputs("\n<HR>\n", r);
++      ap_rputs("\n<HR noshade align=\"left\" width=\"80%\">\n", r);
+     }
+     else {
+       ap_rputs("<UL>", r);
+@@ -1507,7 +1709,7 @@ static void output_directories(struct en
+               ap_rvputs(r, "<A HREF=\"", anchor, "\">", NULL);
+           }
+           if ((ar[x]->icon) || d->default_icon) {
+-              ap_rvputs(r, "<IMG SRC=\"",
++              ap_rvputs(r, "<IMG border=\"0\" src=\"", 
+                         ap_escape_html(scratch,
+                                        ar[x]->icon ? ar[x]->icon
+                                                    : d->default_icon),
+@@ -1717,7 +1919,7 @@ static int index_directory(request_rec *
+       *title_endp-- = '\0';
+     }
+-    emit_head(r, find_header(autoindex_conf, r),
++    emit_head(r, find_header(autoindex_conf, r), autoindex_conf,
+             autoindex_opts & SUPPRESS_PREAMBLE, title_name);
+     /*
+@@ -1779,15 +1981,27 @@ static int index_directory(request_rec *
+       qsort((void *) ar, num_ent, sizeof(struct ent *),
+             (int (*)(const void *, const void *)) dsortf);
+     }
++    if (autoindex_opts & STUDLY_INDEXING) {
++      ap_rputs("\n<TR valign=\"top\">\n", r);
++      ap_rvputs(r, "\n<TD class=\"sidebar\" bgcolor=\"",
++                autoindex_conf->side_col ?: "#ffffff",
++                "\" width=\"5%\">\n", NULL);
++      do_emit_fancy (r, find_sidebar(autoindex_conf, r), autoindex_opts);
++      ap_rputs("</TD>\n", r);
++      ap_rvputs(r, "\n<TD class=\"body\" bgcolor=\"",
++                autoindex_conf->main_col ?: "#ffffff", "\">\n", NULL);
++    }
+     output_directories(ar, num_ent, autoindex_conf, r, autoindex_opts, keyid,
+                      direction);
+     ap_pclosedir(r->pool, d);
+-    if (autoindex_opts & FANCY_INDEXING) {
+-      ap_rputs("<HR>\n", r);
++    if (autoindex_opts & STUDLY_INDEXING) {
++      ap_rputs("</TD class=\"body\">\n\n</TR>\n", r);
++    }
++    else if (autoindex_opts & FANCY_INDEXING) {
++      ap_rputs("<HR noshade align=\"left\" width=\"80%\">\n", r);
+     }
+-    emit_tail(r, find_readme(autoindex_conf, r),
+-            autoindex_opts & SUPPRESS_PREAMBLE);
++    emit_tail(r, find_readme(autoindex_conf, r), autoindex_conf, autoindex_opts);
+     ap_kill_timeout(r);
+     return 0;
diff --git a/apache1-configure_hashbang.patch b/apache1-configure_hashbang.patch
new file mode 100644 (file)
index 0000000..35437b3
--- /dev/null
@@ -0,0 +1,36 @@
+diff -Naurd build-tree.orig/apache_1.3.34/configure build-tree/apache_1.3.34/configure
+--- build-tree.orig/apache_1.3.34/configure    2004-02-20 23:40:50.000000000 +0100
++++ build-tree/apache_1.3.34/configure 2004-05-15 00:06:13.000000000 +0200
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright 1999-2004 The Apache Software Foundation
+ #
+diff -Naurd build-tree.orig/apache_1.3.34/src/Configure build-tree/apache_1.3.34/src/Configure
+--- build-tree.orig/apache_1.3.34/src/Configure        2004-04-09 19:01:50.000000000 +0200
++++ build-tree/apache_1.3.34/src/Configure     2004-05-15 00:06:57.000000000 +0200
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright 1999-2004 The Apache Software Foundation
+ #
+@@ -208,7 +208,7 @@
+ ##
+ DBM_LIB="-ldbm"
+ DB_LIB="-ldb"
+-SHELL="/bin/sh"
++SHELL="/bin/bash"
+ SUBTARGET="target_static"
+ SHLIB_SUFFIX_NAME=""
+ SHLIB_SUFFIX_LIST=""
+diff -Naurd build-tree.orig/apache_1.3.34/src/helpers/TestCompile build-tree/apache_1.3.34/src/helpers/TestCompile
+--- build-tree.orig/apache_1.3.34/src/helpers/TestCompile      2004-02-16 23:23:09.000000000 +0100
++++ build-tree/apache_1.3.34/src/helpers/TestCompile   2004-05-15 00:07:11.000000000 +0200
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright 1999-2004 The Apache Software Foundation
+ #
diff --git a/apache1-htpasswd_do_not_trash_extra_fields.patch b/apache1-htpasswd_do_not_trash_extra_fields.patch
new file mode 100644 (file)
index 0000000..3dd6772
--- /dev/null
@@ -0,0 +1,45 @@
+diff -Naurd build-tree.orig/apache_1.3.34/src/support/htpasswd.c build-tree/apache_1.3.34/src/support/htpasswd.c
+--- build-tree.orig/apache_1.3.34/src/support/htpasswd.c       2004-05-05 11:24:30.000000000 +0200
++++ build-tree/apache_1.3.34/src/support/htpasswd.c    2004-05-05 11:23:45.000000000 +0200
+@@ -369,6 +369,7 @@
+     char record[MAX_STRING_LEN];
+     char line[MAX_STRING_LEN];
+     char pwfilename[MAX_STRING_LEN];
++    char extrafields[MAX_STRING_LEN];
+     char *arg;
+     int found = 0;
+     int alg = ALG_CRYPT;
+@@ -381,6 +382,8 @@
+     signal(SIGINT, (void (*)(int)) interrupted);
++    extrafields[0] = '\0'; /* be sure it is initialized properly */
++    
+     /*
+      * Preliminary check to make sure they provided at least
+      * three arguments, we'll do better argument checking as 
+@@ -610,6 +613,14 @@
+               putline(ftemp, line);
+               continue;
+           }
++          strcpy(scratch, line);              /* make a clean copy of line */
++          colon = strchr(scratch, ':');       /* skip the username */
++          colon = strchr(colon+1, ':');       /* skip the password */
++          if (colon != NULL) {                /* if != NULL there are extrafields */
++              strcpy(extrafields,colon);      /* copy them */
++          } else {
++              extrafields[0] = '\0';          /* if not be sure that it is empty! */
++          }
+           found++;
+           break;
+       }
+@@ -624,6 +635,9 @@
+     /*
+      * Now add the user record we created.
+      */
++    if (strlen(extrafields) > 0) {
++      strcat(record,extrafields);
++    }
+     putline(ftemp, record);
+     /*
+      * If we're updating an existing file, there may be additional
diff --git a/apache1-inetdfix.patch b/apache1-inetdfix.patch
new file mode 100644 (file)
index 0000000..6a0b3b7
--- /dev/null
@@ -0,0 +1,21 @@
+diff -Naurd build-tree.orig/apache_1.3.34/src/main/http_config.c build-tree/apache_1.3.34/src/main/http_config.c
+--- build-tree.orig/apache_1.3.34/src/main/http_config.c       2004-11-07 17:15:08.000000000 +0100
++++ build-tree/apache_1.3.34/src/main/http_config.c    2004-11-07 17:17:24.000000000 +0100
+@@ -1302,7 +1302,7 @@
+        * entries here and store 'em away. Recall we need full pathnames
+        * for this.
+        */
+-      fprintf(stderr, "Processing config directory: %s\n", fname);
++      /* fprintf(stderr, "Processing config directory: %s\n", fname); */
+ #ifdef NETWARE
+       dirp = ap_popendir(p, fname);
+ #else
+@@ -1340,7 +1340,7 @@
+            */
+           for (current = 0; current < candidates->nelts; ++current) {
+               fnew = &((fnames *) candidates->elts)[current];
+-              fprintf(stderr, " Processing config file: %s\n", fnew->fname);
++              /* fprintf(stderr, " Processing config file: %s\n", fnew->fname); */
+               ap_process_resource_config(s, fnew->fname, p, ptemp);
+           }
+       }
diff --git a/apache1-log_files_permission.patch b/apache1-log_files_permission.patch
new file mode 100644 (file)
index 0000000..6cb4498
--- /dev/null
@@ -0,0 +1,72 @@
+diff -Naurd build-tree.orig/apache_1.3.34/src/main/alloc.c build-tree/apache_1.3.34/src/main/alloc.c
+--- build-tree.orig/apache_1.3.34/src/main/alloc.c     2004-05-18 19:45:27.000000000 +0200
++++ build-tree/apache_1.3.34/src/main/alloc.c  2004-05-18 19:45:51.000000000 +0200
+@@ -2193,7 +2193,7 @@
+ #ifdef WIN32
+     modeFlags = _S_IREAD | _S_IWRITE;
+ #else
+-    modeFlags = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;
++    modeFlags = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP;
+ #endif
+     ap_block_alarms();
+diff -Naurd build-tree.orig/apache_1.3.34/src/modules/standard/mod_log_agent.c build-tree/apache_1.3.34/src/modules/standard/mod_log_agent.c
+--- build-tree.orig/apache_1.3.34/src/modules/standard/mod_log_agent.c 2004-02-20 21:37:40.000000000 +0100
++++ build-tree/apache_1.3.34/src/modules/standard/mod_log_agent.c      2004-05-18 19:45:51.000000000 +0200
+@@ -24,7 +24,7 @@
+ /* OS/2 dosen't support users and groups */
+ static mode_t xfer_mode = (S_IREAD | S_IWRITE);
+ #else
+-static mode_t xfer_mode = (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
++static mode_t xfer_mode = (S_IRUSR | S_IWUSR | S_IRGRP );
+ #endif
+ typedef struct {
+diff -Naurd build-tree.orig/apache_1.3.34/src/modules/standard/mod_log_config.c build-tree/apache_1.3.34/src/modules/standard/mod_log_config.c
+--- build-tree.orig/apache_1.3.34/src/modules/standard/mod_log_config.c        2004-05-18 19:45:27.000000000 +0200
++++ build-tree/apache_1.3.34/src/modules/standard/mod_log_config.c     2004-05-18 19:45:51.000000000 +0200
+@@ -150,7 +150,7 @@
+ /* OS/2 dosen't support users and groups */
+ static mode_t xfer_mode = (S_IREAD | S_IWRITE);
+ #else
+-static mode_t xfer_mode = (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
++static mode_t xfer_mode = (S_IRUSR | S_IWUSR | S_IRGRP );
+ #endif
+ /* POSIX.1 defines PIPE_BUF as the maximum number of bytes that is
+diff -Naurd build-tree.orig/apache_1.3.34/src/modules/standard/mod_log_forensic.c build-tree/apache_1.3.34/src/modules/standard/mod_log_forensic.c
+--- build-tree.orig/apache_1.3.34/src/modules/standard/mod_log_forensic.c      2004-02-21 16:24:36.000000000 +0100
++++ build-tree/apache_1.3.34/src/modules/standard/mod_log_forensic.c   2004-05-18 19:46:57.000000000 +0200
+@@ -91,7 +91,7 @@
+         char *fname = ap_server_root_relative(p, cfg->logname);
+         if ((cfg->fd = ap_popenf_ex(p, fname, O_WRONLY | O_APPEND | O_CREAT,
+-                                    0644, 1)) < 0) {
++                                    0640, 1)) < 0) {
+             ap_log_error(APLOG_MARK, APLOG_ERR, s,
+                          "could not open forensic log file %s.", fname);
+             exit(1);
+diff -Naurd build-tree.orig/apache_1.3.34/src/modules/standard/mod_log_referer.c build-tree/apache_1.3.34/src/modules/standard/mod_log_referer.c
+--- build-tree.orig/apache_1.3.34/src/modules/standard/mod_log_referer.c       2004-02-20 21:37:40.000000000 +0100
++++ build-tree/apache_1.3.34/src/modules/standard/mod_log_referer.c    2004-05-18 19:45:51.000000000 +0200
+@@ -25,7 +25,7 @@
+ /* OS/2 lacks support for users and groups */
+ static mode_t xfer_mode = (S_IREAD | S_IWRITE);
+ #else
+-static mode_t xfer_mode = (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
++static mode_t xfer_mode = (S_IRUSR | S_IWUSR | S_IRGRP );
+ #endif
+ typedef struct {
+diff -Naurd build-tree.orig/apache_1.3.34/src/modules/standard/mod_rewrite.c build-tree/apache_1.3.34/src/modules/standard/mod_rewrite.c
+--- build-tree.orig/apache_1.3.34/src/modules/standard/mod_rewrite.c   2004-05-18 19:45:28.000000000 +0200
++++ build-tree/apache_1.3.34/src/modules/standard/mod_rewrite.c        2004-05-18 19:45:51.000000000 +0200
+@@ -3231,7 +3231,7 @@
+ #elif defined(WIN32)
+     mode_t rewritelog_mode  = ( _S_IREAD|_S_IWRITE );
+ #else
+-    mode_t rewritelog_mode  = ( S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH );
++    mode_t rewritelog_mode  = ( S_IRUSR|S_IWUSR|S_IRGRP );
+ #endif
+     conf = ap_get_module_config(s->module_config, &rewrite_module);
diff --git a/apache1-proxy_content_base.patch b/apache1-proxy_content_base.patch
new file mode 100644 (file)
index 0000000..0a5a5c2
--- /dev/null
@@ -0,0 +1,12 @@
+diff -ruN -x Makefile.in -x '*~' -x build-tree.orig -x 'ap_ctx.[ch]' -x 'ap_hook.[ch]' -x 'ap_mm.[ch]' -x os-inline.c -x os.h build-tree.orig/apache_1.3.34/src/modules/proxy/proxy_http.c build-tree/apache_1.3.34/src/modules/proxy/proxy_http.c
+--- build-tree.orig/apache_1.3.34/src/modules/proxy/proxy_http.c       2003-02-03 12:13:26.000000000 -0500
++++ build-tree/apache_1.3.34/src/modules/proxy/proxy_http.c    2003-10-17 12:24:51.000000000 -0400
+@@ -552,6 +595,8 @@
+         ap_table_set(resp_hdrs, "URI", proxy_location_reverse_map(r, urlstr));
+     if ((urlstr = ap_table_get(resp_hdrs, "Content-Location")) != NULL)
+         ap_table_set(resp_hdrs, "Content-Location", proxy_location_reverse_map(r, urlstr));
++    if ((urlstr = ap_table_get(resp_hdrs, "Content-Base")) != NULL)
++        ap_table_set(resp_hdrs, "Content-Base", proxy_location_reverse_map(r, urlstr));
+ /* check if NoCache directive on this host */
+     if (nocache == 0) {
diff --git a/apache1-regex_must_conform_to_posix_for_LFS_to_work.patch b/apache1-regex_must_conform_to_posix_for_LFS_to_work.patch
new file mode 100644 (file)
index 0000000..44fc273
--- /dev/null
@@ -0,0 +1,12 @@
+diff -ruN -x Makefile.in -x configure -x *~ -x apache_1.3.14.orig apache_1.3.14.orig/src/include/hsregex.h apache_1.3.14/src/include/hsregex.h
+--- build-tree/apache_1.3.34/src/include/hsregex.h     Mon Sep 25 16:48:24 2000
++++ build-tree/apache_1.3.34/src/include/hsregex.h     Wed Dec  6 15:20:03 2000
+@@ -24,7 +24,7 @@
+ #endif
+ #endif
+-typedef off_t regoff_t;
++typedef int regoff_t;
+ typedef struct {
+       int re_magic;
+       size_t re_nsub;         /* number of parenthesized subexpressions */
diff --git a/apache1-security_check_forensic_tempfiles.patch b/apache1-security_check_forensic_tempfiles.patch
new file mode 100644 (file)
index 0000000..0d971fd
--- /dev/null
@@ -0,0 +1,47 @@
+diff -ur build-tree-apache.orig/apache_1.3.34/src/helpers/fmn.sh build-tree-apache/apache_1.3.34/src/helpers/fmn.sh
+--- build-tree-apache.orig/apache_1.3.34/src/helpers/fmn.sh    2004-02-16 22:23:09.000000000 +0000
++++ build-tree-apache/apache_1.3.34/src/helpers/fmn.sh 2005-01-18 13:22:08.505238696 +0000
+@@ -24,8 +24,8 @@
+ modfile=$1
+ #   the part from the Configure script
+-tmpfile=${TMPDIR-/tmp}/fmn.tmp.$$
+-rm -f $tmpfile
++tmpfile=`mktemp -t fmn.XXXXXX || tempfile --prefix=fmn` || {echo "$0: Cannot create temporary file" >&2; exit 1; }
++trap "rm -f -- \"$tmpfile\";" 0 1 2 3 13 15
+ modname=''
+ ext=`echo $modfile | sed 's/^.*\.//'`
+ modbase=`echo $modfile | sed 's/\.[^.]*$//'`
+@@ -52,8 +52,8 @@
+     modname=`echo $modbase | sed 's/^.*\///' | \
+         sed 's/^mod_//' | sed 's/^lib//' | sed 's/$/_module/'`
+ fi
+-rm -f $tmpfile
+ #   output: the name of the module structure symbol
+ echo "$modname"
++exit 0
+diff -ur build-tree-apache.orig/apache_1.3.34/src/support/check_forensic build-tree-apache/apache_1.3.34/src/support/check_forensic
+--- build-tree-apache.orig/apache_1.3.34/src/support/check_forensic    2005-01-18 13:19:22.532470000 +0000
++++ build-tree-apache/apache_1.3.34/src/support/check_forensic 2005-01-18 13:27:58.132087336 +0000
+@@ -7,9 +7,14 @@
+ F=$1
+-cut -f 1 -d '|' $F  > /tmp/fc-all.$$
+-grep + < /tmp/fc-all.$$ | cut -c2- | sort > /tmp/fc-in.$$
+-grep -- - < /tmp/fc-all.$$ | cut -c2- | sort > /tmp/fc-out.$$
++all=`mktemp -t fcall.XXXXXX || tempfile --prefix=fcall` || { echo "$0: Cannot create temporary file" >&2; exit 1; }
++in=`mktemp -t fcin.XXXXXX || tempfile --prefix=fcin` || { echo "$0: Cannot create temporary file" >&2; exit 1; }
++out=`mktemp -t fcout.XXXXXX || tempfile --prefix=fcout` || { echo "$0: Cannot create temporary file" >&2; exit 1; }
++trap "rm -f -- \"$all\" \"$in\" \"$out\";" 0 1 2 3 13 15
++
++cut -f 1 -d '|' $F >$all
++grep + < $all|cut -c2- | sort >$in
++grep -- - < $all cut -c2- | sort >$out
+ # use -i instead of -I for GNU xargs
+-join -v 1 /tmp/fc-in.$$ /tmp/fc-out.$$ | xargs -ixx egrep "^\\+xx" $F
+-rm /tmp/fc-all.$$ /tmp/fc-in.$$ /tmp/fc-out.$$
++join -v 1 $in $out |xargs -ixx egrep "^\\+xx" $F
++exit 0
diff --git a/apache1-security_htdigest_local_buffer_overflow.patch b/apache1-security_htdigest_local_buffer_overflow.patch
new file mode 100644 (file)
index 0000000..c94ea63
--- /dev/null
@@ -0,0 +1,29 @@
+diff -Naurd build-tree.orig/apache_1.3.34/src/support/htdigest.c build-tree/apache_1.3.34/src/support/htdigest.c
+--- build-tree.orig/apache_1.3.34/src/support/htdigest.c       2004-05-15 08:34:22.000000000 +0200
++++ build-tree/apache_1.3.34/src/support/htdigest.c    2004-05-15 08:35:14.000000000 +0200
+@@ -124,7 +124,8 @@
+     fprintf(f, "%s:%s:", user, realm);
+     /* Do MD5 stuff */
+-    sprintf(string, "%s:%s:%s", user, realm, pw);
++    memset(string, '\0',sizeof(string));
++    snprintf(string, sizeof(string)-1, "%s:%s:%s", user, realm, pw);
+     ap_MD5Init(&context);
+     ap_MD5Update(&context, (unsigned char *) string, strlen(string));
+@@ -241,11 +242,13 @@
+     }   
+     fclose(f);
+     fclose(tfp);
++
++    memset(command,'\0', sizeof(command));
+ #ifndef NETWARE
+ #if defined(OS2) || defined(WIN32)
+-    sprintf(command, "copy \"%s\" \"%s\"", tn, argv[1]);
++    snprintf(command, sizeof(command)-1, "copy \"%s\" \"%s\"", tn, argv[1]);
+ #else
+-    sprintf(command, "cp %s %s", tn, argv[1]);
++    snprintf(command, sizeof(command)-1, "cp %s %s", tn, argv[1]);
+ #endif
+     system(command);
+ #else
diff --git a/apache1-security_htpasswd_user_buffer_overflow.patch b/apache1-security_htpasswd_user_buffer_overflow.patch
new file mode 100644 (file)
index 0000000..447db82
--- /dev/null
@@ -0,0 +1,19 @@
+--- build-tree/apache_1.3.34/src/support/htpasswd.c    2004-11-13 04:52:08.000000000 -0700
++++ build-tree/apache_1.3.34/src/support/htpasswd.c    2004-11-13 04:53:44.000000000 -0700
+@@ -414,11 +414,11 @@
+           return ERR_OVERFLOW;
+       }
+       strcpy(pwfilename, argv[i]);
+-      if (strlen(argv[i + 1]) > (sizeof(user) - 1)) {
+-          fprintf(stderr, "%s: username too long (>%lu)\n", argv[0],
+-                  (unsigned long)(sizeof(user) - 1));
+-          return ERR_OVERFLOW;
+-      }
++    }
++    if (strlen(argv[i + 1]) > (sizeof(user) - 1)) {
++      fprintf(stderr, "%s: username too long (>%lu)\n", argv[0],
++              (unsigned long)(sizeof(user) - 1));
++      return ERR_OVERFLOW;
+     }
+     strcpy(user, argv[i + 1]);
+     if ((arg = strchr(user, ':')) != NULL) {
diff --git a/apache1-suexec_of_death.patch b/apache1-suexec_of_death.patch
new file mode 100644 (file)
index 0000000..34f6d85
--- /dev/null
@@ -0,0 +1,24 @@
+--- build-tree/apache_1.3.34/src/main/http_core.c
++++ build-tree/apache_1.3.34/src/main/http_core.c
+@@ -1892,8 +1892,9 @@
+       else {
+           cmd->server->server_uid = ap_user_id;
+           fprintf(stderr,
+-                  "Warning: User directive in <VirtualHost> "
++                  "ERROR: User directive in <VirtualHost> "
+                   "requires SUEXEC wrapper.\n");
++          exit (1);
+       }
+     }
+ #if !defined (BIG_SECURITY_HOLE) && !defined (OS2)
+@@ -1933,8 +1934,9 @@
+       else {
+           cmd->server->server_gid = ap_group_id;
+           fprintf(stderr,
+-                  "Warning: Group directive in <VirtualHost> requires "
++                  "ERROR: Group directive in <VirtualHost> requires "
+                   "SUEXEC wrapper.\n");
++          exit (1);
+       }
+     }
diff --git a/apache1-suexec_reopenlog.patch b/apache1-suexec_reopenlog.patch
new file mode 100644 (file)
index 0000000..4bab1cb
--- /dev/null
@@ -0,0 +1,44 @@
+diff -Naurd build-tree.orig/apache_1.3.34/src/support/suexec.c build-tree/apache_1.3.34/src/support/suexec.c
+--- build-tree.orig/apache_1.3.34/src/support/suexec.c 2004-08-23 23:36:55.000000000 +0200
++++ build-tree/apache_1.3.34/src/support/suexec.c      2004-08-23 23:40:35.000000000 +0200
+@@ -49,6 +49,10 @@
+ #include <stdarg.h>
+ #include <strings.h>
++/* for fcntl(fileno(log), F_SETFD, FD_CLOEXEC); */
++#include <unistd.h>
++#include <fcntl.h>
++
+ #include "suexec.h"
+ /*
+@@ -151,6 +155,8 @@
+           perror("fopen");
+           exit(1);
+       }
++      /* Set the close-on-exec flag -- Liyang HU <liyang@nerv.cx> */
++      fcntl(fileno(log), F_SETFD, FD_CLOEXEC);
+     }
+     time(&timevar);
+@@ -823,20 +829,6 @@
+     umask(SUEXEC_UMASK);
+ #endif /* SUEXEC_UMASK */
+-    /* 
+-     * Be sure to close the log file so the CGI can't
+-     * mess with it.  If the exec fails, it will be reopened 
+-     * automatically when log_err is called.  Note that the log
+-     * might not actually be open if LOG_EXEC isn't defined.
+-     * However, the "log" cell isn't ifdef'd so let's be defensive
+-     * and assume someone might have done something with it
+-     * outside an ifdef'd LOG_EXEC block.
+-     */
+-    if (log != NULL) {
+-      fclose(log);
+-      log = NULL;
+-    }
+-
+     /*
+      * Execute the command, replacing our image with its own.
+      */
This page took 0.136074 seconds and 4 git commands to generate.