← Commit list

d4dc5b4ce8

Daniel Stenberg
Daniel Stenberg
2026-09-25
SUCCESS Duration: 428s

Subject

ftplistparser: when wildcarding, skip files with slashes

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

lib/ftplistparser.c+4 -1
@@ -323,7 +323,10 @@ static CURLcode ftp_pl_insert_finfo(struct Curl_easy *data,
compare = Curl_fnmatch;
/* filter pattern-corresponding filenames */
- {
+ if(strchr(finfo->filename, '/'))
+ add = FALSE;
+ else {
+ /* a real file name cannot contain a slash */
struct Curl_mapi_guard guard;
CURL_CBAPI_START(&guard, data, easy_fnmatch_data);
if(compare(data->set.fnmatch_data, wc->pattern, finfo->filename) == 0) {
tests/directories.pm+10 -1
@@ -187,9 +187,18 @@ my %file_percent_txt = (
'perm' => "rw-r--r--"
);
+my %file_slash = (
+ 'name' => "really/special",
+ 'content' => "slash in the name \n",
+ 'time' => "Jan 17 11:01",
+ 'dostime' => "01-17-10 11:01AM",
+ 'perm' => "rw-rw-rw-"
+);
+
my %lists = (
'/fully_simulated/percent/' => {
- 'files' => [ \%file_someothertext_txt, \%file_percent_txt],
+ 'files' => [ \%file_someothertext_txt, \%file_percent_txt,
+ \%file_slash],
'eol' => "\r\n",
'type' => "unix"
},