Bug 1166741

Summary: Wildcard "?" does not work correctly in vsftpd-3.0.2-9.el7
Product: Red Hat Enterprise Linux 7 Reporter: Javier Coscia <jcoscia>
Component: vsftpdAssignee: Martin Sehnoutka <msehnout>
Status: CLOSED ERRATA QA Contact: Stefan Kremen <skremen>
Severity: high Docs Contact:
Priority: urgent    
Version: 7.0CC: amarecek, cspicer, fkrska, lunix, mosvald, ovasik, psimerda, sdordevi, thozza, tspeetje, zpytela
Target Milestone: rcKeywords: Patch, Regression, ZStream
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: vsftpd-3.0.2-11.el7_2 Doc Type: Bug Fix
Doc Text:
Previously, due a bug, the vsftpd service did not handle the question mark character "?" correctly when used in the middle of filenames. As a result, the service sent incorrect responses to clients using question marks in this way. This has been fixed and vsftpd now responds correctly in this situation.
Story Points: ---
Clone Of:
: 1311475 (view as bug list) Environment:
Last Closed: 2016-11-04 01:32:27 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1203710, 1295829, 1311475    
Attachments:
Description Flags
Patch from Bug 799245 none

Description Javier Coscia 2014-11-21 15:40:23 UTC
Description of problem:

While trying to list files using the "?" wildcard through ftp linux clients, if the wildcard isn't at the end of the query it won't list the file

Version-Release number of selected component (if applicable):

Red Hat Enterprise Linux Server release 7.0 (Maipo)
vsftpd-3.0.2-9.el7.x86_64

How reproducible:

Always

Steps to Reproduce:
1. ftp to localhost
2. use wildcard "?" to list files in path

Actual results:

If the wildcard "?" is in the middle it won't list the file(s)

Expected results:

It should list the file using the "?" character in any location

Additional info:

Testing on RHEL 7 with vsftpd-3.0.2-9.el7.x86_64

ftp> ls aaa.tx?
229 Entering Extended Passive Mode (|||18064|).
150 Here comes the directory listing.
-rw-r--r--    1 0        0               0 Nov 21 15:04 aaa.txt
226 Directory send OK.

ftp> ls aaa.t?t
229 Entering Extended Passive Mode (|||25136|).
150 Here comes the directory listing.
226 Directory send OK.

ftp> ls aa?.txt
229 Entering Extended Passive Mode (|||65270|).
150 Here comes the directory listing.
226 Directory send OK.

ftp> ls ?aa.txt
229 Entering Extended Passive Mode (|||34540|).
150 Here comes the directory listing.
226 Directory send OK.

Testing on RHEL 6 with vsftpd-2.2.2-13.el6_6.1.x86_64

ftp> ls aaa.tx?
227 Entering Passive Mode (127,0,0,1,137,146).
150 Here comes the directory listing.
-rw-r--r--    1 0        0               0 Nov 21 15:13 aaa.txt
226 Directory send OK.

ftp> ls aaa.t?t
227 Entering Passive Mode (127,0,0,1,145,44).
150 Here comes the directory listing.
-rw-r--r--    1 0        0               0 Nov 21 15:13 aaa.txt
226 Directory send OK.

ftp> ls aaa.?xt
227 Entering Passive Mode (127,0,0,1,233,19).
150 Here comes the directory listing.
-rw-r--r--    1 0        0               0 Nov 21 15:13 aaa.txt
226 Directory send OK.

This seems to be a regression of BZ [799245](https://bugzilla.redhat.com/show_bug.cgi?id=799245)

Comment 3 lunix4knmi 2015-02-17 15:58:53 UTC
Any update on this?

Comment 10 Bryan Mason 2016-02-03 19:45:07 UTC
Created attachment 1120893 [details]
Patch from Bug 799245

This patch applies cleanly and appears to resolve the issue:

Before (vsftpd-3.0.2-9.el7.x86_64):

$ lftp sf01551872-test
lftp sf01551872-test:~> user anonymous
Password: 

lftp anonymous@sf01551872-test:~> ls
-rw-r--r--    1 0        0               0 Feb 03 19:37 aaa.txt
-rw-r--r--    1 0        0               0 Feb 03 19:37 file
drwxr-xr-x    2 0        0            4096 Mar 07  2014 pub

lftp anonymous@sf01551872-test:/> ls aaa.tx?
-rw-r--r--    1 0        0               0 Feb 03 19:37 aaa.txt

lftp anonymous@sf01551872-test:/> ls aaa.t?t
lftp anonymous@sf01551872-test:/>

After (vsftpd-3.0.2-10.el7_2.bz1166741.1.x86_64)

$ lftp sf01551872-test
lftp sf01551872-test:~> user anonymous              
Password: 

lftp anonymous@sf01551872-test:~> ls
-rw-r--r--    1 0        0               0 Feb 03 19:37 aaa.txt
-rw-r--r--    1 0        0               0 Feb 03 19:37 file
drwxr-xr-x    2 0        0            4096 Feb 03 18:43 pub

lftp anonymous@sf01551872-test:/> ls aaa.tx?
-rw-r--r--    1 0        0               0 Feb 03 19:37 aaa.txt

lftp anonymous@sf01551872-test:/> ls aaa.t?t
-rw-r--r--    1 0        0               0 Feb 03 19:37 aaa.txt

Comment 21 Martin Sehnoutka 2016-04-05 11:53:25 UTC
*** Bug 1086873 has been marked as a duplicate of this bug. ***

Comment 25 errata-xmlrpc 2016-11-04 01:32:27 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-2242.html