1 Author: Martin Nagy <mnagy@redhat.com>
2 Description: Fix file listing issue with wildcard (Bugzilla: #392181).
4 diff -Naurp vsftpd.orig/ls.c vsftpd/ls.c
5 --- vsftpd.orig/ls.c 2009-10-02 14:15:18.000000000 +0200
6 +++ vsftpd/ls.c 2009-10-18 11:48:29.000000000 +0200
7 @@ -281,6 +281,25 @@ vsf_filename_passes_filter(const struct
11 + if (!must_match_at_current_pos)
13 + struct mystr scan_fwd = INIT_MYSTR;
15 + str_mid_to_end(&name_remain_str, &scan_fwd,
16 + indexx + str_getlen(&s_match_needed_str));
17 + /* We're allowed to be greedy, test if it match further along
18 + * keep advancing indexx while we can still match.
20 + while( (locate_result = str_locate_str(&scan_fwd, &s_match_needed_str)),
21 + locate_result.found )
23 + indexx += locate_result.index + str_getlen(&s_match_needed_str);
24 + str_mid_to_end(&scan_fwd, &temp_str,
25 + locate_result.index + str_getlen(&s_match_needed_str));
26 + str_copy(&scan_fwd, &temp_str);
28 + str_free(&scan_fwd);
30 /* Chop matched string out of remainder */
31 str_mid_to_end(&name_remain_str, &temp_str,
32 indexx + str_getlen(&s_match_needed_str));