[ruby-core:70203] [Ruby trunk - Bug #11407] Net::FTP nlst method return wrong data and don't raise Error when path is wrong

From: damian.giebas@...
Date: 2015-07-31 11:41:58 UTC
List: ruby-core #70203
Issue #11407 has been updated by Damian Giebas.


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).

----------------------------------------
Bug #11407: Net::FTP nlst method return wrong data and don't raise Error when path is wrong
https://bugs.ruby-lang.org/issues/11407#change-53629

* Author: Damian Giebas
* Status: Feedback
* Priority: Normal
* Assignee: Shugo Maeda
* ruby -v: 2.3.0
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
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--------------------------------
net_ftp_bug.png (141 KB)


-- 
https://bugs.ruby-lang.org/

In This Thread

Prev Next