]> TLD Linux GIT Repositories - packages/apache.git/blobdiff - apache-configdir_skip_backups.patch
- Up to 2.4.52
[packages/apache.git] / apache-configdir_skip_backups.patch
index a0ff92e1cf322e33c669449e62b9cab931e9425d..07aba85679d584cc75e18b25ff73b16fc89a6aad 100644 (file)
@@ -1,26 +1,18 @@
-diff -ur httpd-2.2.0.org/server/config.c httpd-2.2.0/server/config.c
---- httpd-2.2.0.org/server/config.c    2005-11-17 14:39:15.000000000 +0100
-+++ httpd-2.2.0/server/config.c        2005-12-21 16:04:35.970963000 +0100
-@@ -1537,6 +1537,7 @@
-         apr_dir_t *dirp;
-         apr_finfo_t dirent;
-         int current;
-+      size_t slen;
-         apr_array_header_t *candidates = NULL;
-         fnames *fnew;
-         char *path = apr_pstrdup(p, fname);
-@@ -1562,8 +1563,13 @@
+--- httpd-2.4.41/server/util.c~        2019-07-22 21:28:14.000000000 +0200
++++ httpd-2.4.41/server/util.c 2019-08-17 10:09:47.225371702 +0200
+@@ -3477,8 +3477,14 @@ AP_DECLARE(const char *)ap_dir_fnmatch(a
  
-         candidates = apr_array_make(p, 1, sizeof(fnames));
-         while (apr_dir_read(&dirent, APR_FINFO_DIRENT, dirp) == APR_SUCCESS) {
-+          slen = strlen(dirent.name);
-             /* strip out '.' and '..' */
--            if (strcmp(dirent.name, ".")
-+            if (strcmp(dirent.name, ".") && (dirent.name)[slen-1] != '~'
-+                          && (dirent.name)[0] != '.'
-+                          && (slen < 8 || strcmp((dirent.name + slen - 7), ".rpmnew"))
-+                          && (slen < 9 || ( strcmp((dirent.name + slen - 8), ".rpmorig")
-+                                          && strcmp((dirent.name + slen - 8), ".rpmsave")))
-                 && strcmp(dirent.name, "..")) {
-                 fnew = (fnames *) apr_array_push(candidates);
-                 fnew->fname = ap_make_full_path(p, path, dirent.name);
+     candidates = apr_array_make(w->ptemp, 1, sizeof(fnames));
+     while (apr_dir_read(&dirent, APR_FINFO_DIRENT | APR_FINFO_TYPE, dirp) == APR_SUCCESS) {
++        size_t slen;
++        slen = strlen(dirent.name);
+         /* strip out '.' and '..' */
+-        if (strcmp(dirent.name, ".")
++        if (strcmp(dirent.name, ".") && (dirent.name)[slen-1] != '~'
++            && (dirent.name)[0] != '.'
++            && (slen < 8 || strcmp((dirent.name + slen - 7), ".rpmnew"))
++            && (slen < 9 || ( strcmp((dirent.name + slen - 8), ".rpmorig")
++            && strcmp((dirent.name + slen - 8), ".rpmsave")))
+             && strcmp(dirent.name, "..")
+             && (apr_fnmatch(fname, dirent.name,
+                             APR_FNM_PERIOD) == APR_SUCCESS)) {