]> TLD Linux GIT Repositories - packages/apache.git/blob - apache-configdir_skip_backups.patch
- fix install
[packages/apache.git] / apache-configdir_skip_backups.patch
1 diff -ur httpd-2.2.0.org/server/config.c httpd-2.2.0/server/config.c
2 --- httpd-2.2.0.org/server/config.c     2005-11-17 14:39:15.000000000 +0100
3 +++ httpd-2.2.0/server/config.c 2005-12-21 16:04:35.970963000 +0100
4 @@ -1537,6 +1537,7 @@
5          apr_dir_t *dirp;
6          apr_finfo_t dirent;
7          int current;
8 +       size_t slen;
9          apr_array_header_t *candidates = NULL;
10          fnames *fnew;
11          char *path = apr_pstrdup(p, fname);
12 @@ -1562,8 +1563,13 @@
13  
14          candidates = apr_array_make(p, 1, sizeof(fnames));
15          while (apr_dir_read(&dirent, APR_FINFO_DIRENT, dirp) == APR_SUCCESS) {
16 +           slen = strlen(dirent.name);
17              /* strip out '.' and '..' */
18 -            if (strcmp(dirent.name, ".")
19 +            if (strcmp(dirent.name, ".") && (dirent.name)[slen-1] != '~'
20 +                           && (dirent.name)[0] != '.'
21 +                           && (slen < 8 || strcmp((dirent.name + slen - 7), ".rpmnew"))
22 +                           && (slen < 9 || ( strcmp((dirent.name + slen - 8), ".rpmorig")
23 +                                           && strcmp((dirent.name + slen - 8), ".rpmsave")))
24                  && strcmp(dirent.name, "..")) {
25                  fnew = (fnames *) apr_array_push(candidates);
26                  fnew->fname = ap_make_full_path(p, path, dirent.name);