--- apache_1.3.17/src/main/http_config.c.wiget Thu May 10 14:41:08 2001 +++ apache_1.3.17/src/main/http_config.c Thu May 10 15:42:12 2001 @@ -1287,6 +1287,7 @@ DIR *dirp; struct DIR_TYPE *dir_entry; int current; + size_t slen; array_header *candidates = NULL; fnames *fnew; @@ -1309,13 +1310,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);