--- apache_1.3.35/src/main/http_config.c~ 2006-05-03 01:17:59.162162254 +0300 +++ apache_1.3.35/src/main/http_config.c 2006-05-03 01:17:16.131203177 +0300 @@ -1345,6 +1345,7 @@ fnames *fnew; char *path = ap_pstrdup(p,fname); char *pattern = NULL; + size_t slen; if(ispatt && (pattern = strrchr(path, '/')) != NULL) { *pattern++ = '\0'; @@ -1390,13 +1391,21 @@ } candidates = ap_make_array(p, 1, sizeof(fnames)); while ((dir_entry = readdir(dirp)) != NULL) { + slen = strlen(dir_entry->d_name); /* strip out '.' and '..' */ if (strcmp(dir_entry->d_name, ".") && strcmp(dir_entry->d_name, "..") && (!ispatt || - !ap_fnmatch(pattern,dir_entry->d_name, FNM_PERIOD)) ) { - fnew = (fnames *) ap_push_array(candidates); - fnew->fname = ap_make_full_path(p, path, dir_entry->d_name); + !ap_fnmatch(pattern,dir_entry->d_name, FNM_PERIOD)) && + (dir_entry->d_name)[slen-1] != '~') { + if (slen < 8 || strcmp((dir_entry->d_name + slen - 7), ".rpmnew")) { + if (slen < 9 || + strcmp((dir_entry->d_name + slen - 8), ".rpmorig") && + strcmp((dir_entry->d_name + slen - 8), ".rpmsave")) { + fnew = (fnames *) ap_push_array(candidates); + fnew->fname = ap_make_full_path(p, path, dir_entry->d_name); + } + } } } ap_pclosedir(p, dirp);