Bug #11407
closedNet::FTP nlst method return wrong data and don't raise Error when path is wrong
Description
I found bug in nlst function. When we have situatiuon on ftp like this
/
my_folder/
some_file.txt
some_another_file.txt
and we go to "my_folder"
ftp_handler.chdir("my_folder")
and use nlst from this folder on file "some_another_file.txt"
ftp_handler.nlst("../some_another_file.txt") it return
['../some_another_file.txt/some_another_file.txt']
I think this is bug. In this case function should return ['../some_another_file.txt']
It still "working" when my path is worong. When I'm still in "my_folder" and I use nlst with weird path
ftp_handler.nlst("../../../../../../some_another_file.txt")
it return ["../../../../../../some_another_file.txt/some_another_file.txt"]. I think it should raise FTPPermError with code 550. This path does not exist.
I found this bug in ruby version 1.9.3 and it still exist in ruby 2.3.0dev.
Can someone confirm me this is bug?
Best regards.
Files
Updated by Draqun (Damian Giebas) over 8 years ago
- Assignee set to shugo (Shugo Maeda)
Updated by shugo (Shugo Maeda) over 8 years ago
- Status changed from Open to Feedback
Damian Giebas wrote:
I found bug in nlst function. When we have situatiuon on ftp like this
/
my_folder/
some_file.txt
some_another_file.txtand we go to "my_folder"
ftp_handler.chdir("my_folder")
and use nlst from this folder on file "some_another_file.txt"ftp_handler.nlst("../some_another_file.txt") it return
['../some_another_file.txt/some_another_file.txt']
I think this is bug. In this case function should return ['../some_another_file.txt']
I couldn't reproduce the problem....
require "net/ftp"
ftp = Net::FTP.new("ftp.ruby-lang.org")
ftp.passive = true
ftp.login
ftp.chdir("pub/ruby/2.2")
p ftp.nlst("..")
p ftp.nlst("../ruby-2.2.2.zip") #=> ["../ruby-2.2.2.zip"]
Does the nlist command of /usr/bin/ftp works well with that server?
Updated by Draqun (Damian Giebas) over 8 years ago
When ftp server is on Linux all is fine. Problem is when FTP is on IIS Server 8.0 (and probably with other version of IIS).
Updated by shugo (Shugo Maeda) over 8 years ago
Damian Giebas wrote:
When ftp server is on Linux all is fine. Problem is when FTP is on IIS Server 8.0 (and probably with other version of IIS).
I think it's more likely a server-side problem.
Do you any other FTP client which works with IIS as you expect?
Updated by shugo (Shugo Maeda) over 8 years ago
- Status changed from Feedback to Third Party's Issue