]>
Commit | Line | Data |
---|---|---|
173c825e ER |
1 | --- apache_1.3.35/src/main/http_config.c~ 2006-05-03 01:17:59.162162254 +0300 |
2 | +++ apache_1.3.35/src/main/http_config.c 2006-05-03 01:17:16.131203177 +0300 | |
3 | @@ -1345,6 +1345,7 @@ | |
0f05f0de | 4 | fnames *fnew; |
173c825e ER |
5 | char *path = ap_pstrdup(p,fname); |
6 | char *pattern = NULL; | |
7 | + size_t slen; | |
0f05f0de | 8 | |
173c825e ER |
9 | if(ispatt && (pattern = strrchr(path, '/')) != NULL) { |
10 | *pattern++ = '\0'; | |
11 | @@ -1390,13 +1391,21 @@ | |
0f05f0de JB |
12 | } |
13 | candidates = ap_make_array(p, 1, sizeof(fnames)); | |
14 | while ((dir_entry = readdir(dirp)) != NULL) { | |
15 | + slen = strlen(dir_entry->d_name); | |
16 | /* strip out '.' and '..' */ | |
17 | if (strcmp(dir_entry->d_name, ".") && | |
18 | strcmp(dir_entry->d_name, "..") && | |
19 | (!ispatt || | |
20 | - !ap_fnmatch(pattern,dir_entry->d_name, FNM_PERIOD)) ) { | |
21 | - fnew = (fnames *) ap_push_array(candidates); | |
22 | - fnew->fname = ap_make_full_path(p, path, dir_entry->d_name); | |
23 | + !ap_fnmatch(pattern,dir_entry->d_name, FNM_PERIOD)) && | |
24 | + (dir_entry->d_name)[slen-1] != '~') { | |
25 | + if (slen < 8 || strcmp((dir_entry->d_name + slen - 7), ".rpmnew")) { | |
26 | + if (slen < 9 || | |
27 | + strcmp((dir_entry->d_name + slen - 8), ".rpmorig") && | |
28 | + strcmp((dir_entry->d_name + slen - 8), ".rpmsave")) { | |
29 | + fnew = (fnames *) ap_push_array(candidates); | |
30 | + fnew->fname = ap_make_full_path(p, path, dir_entry->d_name); | |
31 | + } | |
32 | + } | |
33 | } | |
34 | } | |
35 | ap_pclosedir(p, dirp); |