SHA256
1
0
forked from pool/vsftpd

ENOENT, ensure we sent both dir+file to filter verification:

OBS-URL: https://build.opensuse.org/package/show/network/vsftpd?expand=0&rev=82
This commit is contained in:
Tomáš Chvátal 2015-04-05 11:40:52 +00:00 committed by Git OBS Bridge
parent e939f108e5
commit 1cbf7ab3a0
2 changed files with 37 additions and 13 deletions

View File

@ -1,15 +1,3 @@
Index: vsftpd-3.0.2/ls.c
===================================================================
--- vsftpd-3.0.2.orig/ls.c
+++ vsftpd-3.0.2/ls.c
@@ -249,6 +249,7 @@ vsf_filename_passes_filter(const struct
int matched = 0;
str_copy(&filter_remain_str, p_filter_str);
+ str_normalize_filepath(p_filename_str);
if (!str_isempty (&filter_remain_str) && !str_isempty(p_filename_str)) {
if (str_get_char_at(p_filter_str, 0) == '/') {
Index: vsftpd-3.0.2/str.c Index: vsftpd-3.0.2/str.c
=================================================================== ===================================================================
--- vsftpd-3.0.2.orig/str.c --- vsftpd-3.0.2.orig/str.c
@ -100,3 +88,39 @@ Index: vsftpd-3.0.2/str.h
/* PURPOSE: Extract a line of text (delimited by \n or EOF) from a string /* PURPOSE: Extract a line of text (delimited by \n or EOF) from a string
* buffer, starting at character position 'p_pos'. The extracted line will * buffer, starting at character position 'p_pos'. The extracted line will
Index: vsftpd-3.0.2/ls.c
===================================================================
--- vsftpd-3.0.2.orig/ls.c
+++ vsftpd-3.0.2/ls.c
@@ -117,11 +117,13 @@ vsf_ls_populate_dir_list(struct mystr_li
{
continue;
}
+ str_copy(&s_next_path_and_filename_str, &normalised_base_dir_str);
+ str_append_str(&s_next_path_and_filename_str, &s_next_filename_str);
/* If we have an ls option which is a filter, apply it */
if (!str_isempty(p_filter_str))
{
unsigned int iters = 0;
- if (!vsf_filename_passes_filter(&s_next_filename_str, p_filter_str,
+ if (!vsf_filename_passes_filter(&s_next_path_and_filename_str, p_filter_str,
&iters))
{
continue;
@@ -130,8 +132,6 @@ vsf_ls_populate_dir_list(struct mystr_li
/* Calculate the full path (relative to CWD) for lstat() and
* output purposes
*/
- str_copy(&s_next_path_and_filename_str, &normalised_base_dir_str);
- str_append_str(&s_next_path_and_filename_str, &s_next_filename_str);
if (do_stat)
{
/* lstat() the file. Of course there's a race condition - the
@@ -249,6 +249,7 @@ vsf_filename_passes_filter(const struct
int matched = 0;
str_copy(&filter_remain_str, p_filter_str);
+ str_normalize_filepath(p_filename_str);
if (!str_isempty (&filter_remain_str) && !str_isempty(p_filename_str)) {
if (str_get_char_at(p_filter_str, 0) == '/') {

View File

@ -2,7 +2,7 @@
Sun Apr 5 10:25:50 UTC 2015 - tchvatal@suse.com Sun Apr 5 10:25:50 UTC 2015 - tchvatal@suse.com
- bnc#925963 stat is sometimes run on wrong path and results with - bnc#925963 stat is sometimes run on wrong path and results with
ENOENT: ENOENT, ensure we sent both dir+file to filter verification:
* vsftpd-path-normalize.patch * vsftpd-path-normalize.patch
------------------------------------------------------------------- -------------------------------------------------------------------