]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Backport from HEAD:
authorJoe Orton <jorton@apache.org>
Thu, 26 Aug 2004 13:01:21 +0000 (13:01 +0000)
committerJoe Orton <jorton@apache.org>
Thu, 26 Aug 2004 13:01:21 +0000 (13:01 +0000)
* Makefile.in: Link httpd against user-supplied $(LIBS).

* modules/standard/mod_autoindex.c (index_directory): If stat() fails
for a particular dirent, ignore that entry rather than truncating the
directory listing.

PR: 7882, 17357
Reviewed by: stoddard, trawick

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/APACHE_2_0_BRANCH@104815 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
Makefile.in
STATUS
modules/generators/mod_autoindex.c

diff --git a/CHANGES b/CHANGES
index 2fa6196d5fa91a8cf37299163e9c31cc928a3fde..9a0c476ac90d23b1d23092de404106c764bb7f59 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,12 @@
 Changes with Apache 2.0.51
 
+  *) mod_autoindex: Don't truncate the directory listing if a stat()
+     call fails (for instance on a >2Gb file).  PR 17357.
+     [Joe Orton]
+
+  *) Makefile fix: httpd is linked against LIBS given to the
+     'make' invocation.  PR 7882.  [Joe Orton]
+
   *) WinNT MPM: Fix a broken log message at termination.  PR 28063.
      [Eider Oliveira <eider bol.com.br>]
 
@@ -76,7 +83,7 @@ Changes with Apache 2.0.51
      This makes the cache work on Linux again. [Graham Leggett]
 
   *) Enable special ErrorDocument value 'default' which restores the
-     canned server response for the scope of the directive
+     canned server response for the scope of the directive.
      [Geoffrey Young, Andre Malo]
 
   *) work around MSIE Digest auth bug - if AuthDigestEnableQueryStringHack
index baa6c8ccce2ef471e1e52f1963fee7b38f004e7e..5664d9769b36b7851a1d76ea34484ddd520fe70e 100644 (file)
@@ -4,7 +4,7 @@ CLEAN_SUBDIRS = test
 
 PROGRAM_NAME         = $(progname)
 PROGRAM_SOURCES      = modules.c
-PROGRAM_LDADD        = $(HTTPD_LDFLAGS) $(PROGRAM_DEPENDENCIES) $(EXTRA_LIBS) $(AP_LIBS)
+PROGRAM_LDADD        = $(HTTPD_LDFLAGS) $(PROGRAM_DEPENDENCIES) $(EXTRA_LIBS) $(AP_LIBS) $(LIBS)
 PROGRAM_DEPENDENCIES = \
   $(BUILTIN_LIBS) \
   $(MPM_LIB) \
diff --git a/STATUS b/STATUS
index 85bcdeeab7b70ef114cb6148b581c6f1817b1b96..4db8f86780a680e7e22fe547b4a59212c0e44d36 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -1,5 +1,5 @@
 APACHE 2.0 STATUS:                                              -*-text-*-
-Last modified at [$Date: 2004/08/26 12:12:00 $]
+Last modified at [$Date: 2004/08/26 13:01:17 $]
 
 Release:
 
@@ -94,17 +94,6 @@ PATCHES TO BACKPORT FROM 2.1
        PR: 30134
        +1: jorton, trawick
 
-    *) Build fix: ensure httpd is linked against user-supplied LIBS during make.
-       http://cvs.apache.org/viewcvs.cgi/httpd-2.0/Makefile.in?r1=1.138&r2=1.139
-       PR: 7882
-       +1: jorton, stoddard, trawick
-
-    *) mod_autoindex: Don't truncate directory listing when a stat call fails.
-       http://cvs.apache.org/viewcvs.cgi/httpd-2.0/modules/generators/mod_autoindex.c?r1=1.132&r2=1.133
-       PR: 17357
-       +1: jorton, stoddard (stat fails when file size > 2GB even if
-           large file support is enabled), trawick
-
     *) unixd_accept: Eliminate now-unnecessary apr_os_sock_get() call.
        http://cvs.apache.org/viewcvs.cgi/httpd-2.0/os/unix/unixd.c?r1=1.66&r2=1.67
        +1: jorton, trawick
index bebdf42044b604e03823bf18a48282c624f774f1..a82d261cd66d29221012ba4538c90dd304bc55c1 100644 (file)
@@ -2098,8 +2098,16 @@ static int index_directory(request_rec *r,
     fullpath = apr_palloc(r->pool, APR_PATH_MAX);
     dirpathlen = strlen(name);
     memcpy(fullpath, name, dirpathlen);
-    while (apr_dir_read(&dirent, APR_FINFO_MIN | APR_FINFO_NAME,
-                        thedir) == APR_SUCCESS) {
+
+    do {
+        status = apr_dir_read(&dirent, APR_FINFO_MIN | APR_FINFO_NAME, thedir);
+        if (APR_STATUS_IS_INCOMPLETE(status)) {
+            continue; /* ignore un-stat()able files */
+        }
+        else if (status != APR_SUCCESS) {
+            break;
+        }
+
         /* We want to explode symlinks here. */
         if (dirent.filetype == APR_LNK) {
             const char *savename;
@@ -2125,7 +2133,8 @@ static int index_directory(request_rec *r,
             head = p;
             num_ent++;
         }
-    }
+    } while (1);
+
     if (num_ent > 0) {
         ar = (struct ent **) apr_palloc(r->pool,
                                         num_ent * sizeof(struct ent *));