~ubuntu-branches/ubuntu/breezy/apache2/breezy

« back to all changes in this revision

Viewing changes to debian/patches/027_autoindex_ignore_bad_files.patch

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-04-01 16:30:56 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050401163056-ve71h4qd7f4plu7j
Tags: 2.0.53-5ubuntu5
Fix the init script to not exit with an error when asked to
stop a daemon that isn't running (Was the root cause of #8374)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
===================================================================
2
 
RCS file: /home/cvspublic/httpd-2.0/modules/generators/mod_autoindex.c,v
3
 
retrieving revision 1.132
4
 
retrieving revision 1.133
5
 
diff -u -r1.132 -r1.133
6
 
--- build-tree/apache2/modules/generators/mod_autoindex.c       2004/02/09 20:29:19     1.132
7
 
+++ build-tree/apache2/modules/generators/mod_autoindex.c       2004/03/10 20:51:10     1.133
8
 
@@ -2126,8 +2126,16 @@
9
 
     fullpath = apr_palloc(r->pool, APR_PATH_MAX);
10
 
     dirpathlen = strlen(name);
11
 
     memcpy(fullpath, name, dirpathlen);
12
 
-    while (apr_dir_read(&dirent, APR_FINFO_MIN | APR_FINFO_NAME,
13
 
-                        thedir) == APR_SUCCESS) {
14
 
+
15
 
+    do {
16
 
+        status = apr_dir_read(&dirent, APR_FINFO_MIN | APR_FINFO_NAME, thedir);
17
 
+        if (APR_STATUS_IS_INCOMPLETE(status)) {
18
 
+            continue; /* ignore un-stat()able files */
19
 
+        }
20
 
+        else if (status != APR_SUCCESS) {
21
 
+            break;
22
 
+        }
23
 
+
24
 
         /* We want to explode symlinks here. */
25
 
         if (dirent.filetype == APR_LNK) {
26
 
             const char *savename;
27
 
@@ -2153,7 +2161,8 @@
28
 
             head = p;
29
 
             num_ent++;
30
 
         }
31
 
-    }
32
 
+    } while (1);
33
 
+
34
 
     if (num_ent > 0) {
35
 
         ar = (struct ent **) apr_palloc(r->pool,
36
 
                                         num_ent * sizeof(struct ent *));