You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NetBox appears to trim trailing spaces on FTP listings (and in other places).
While at least CFtpListResult::parseAsMlsd() honours RFC 3659 and says it does not trim, that function is fed data from CFtpListResult::GetLine(), that explicitly removes tailing spaces and tabs.
This leads to an invalid directory listing that can't be used for further operations.
Assuming one knows the correct name of a directory, punching in CD "test " in the command line can work around this.
Behaviour reproduced at least with pure-ftpd (over MLSD) and vsftpd (on whatever it emits for LIST) and I imagine it should be similar with any backing filesystem and FTP server allowing trailing spaces in filenames.
While I agree that this is bad practice, more so with a badly defined protocol, this is compatibility problem first.
From the log for MLSD:
. 2020-09-15 19:18:03.395 type=dir;sizd=2;modify=20200915124101;UNIX.mode=0755;UNIX.uid=1001;UNIX.gid=1001;unique=39g45c4e1; test
Related trailing spaces issues I did not investigate much
with logging disabled, copying a file from local disk to FTP will error out(suggesting the path was trimmed beforehand) with
Can't open file
'C:\Path\test.bin '.
System Error. Code: 2.
The system cannot find the file specified
with logging enabled the same silently fails(and no, the file is not 0 sized), but logs
. 2020-09-15 19:18:02.936 Copying 1 files/directories to remote directory "/path/" - total size: 0
creating a directory from the interface(F7) first strips trailing spaces (but not leading ones). an MKD test from the command line properly creates it with trailing space (or underscore, in the case of pure-ftpd, but it does reach the server properly). In both cases the log shows > 2020-09-15 20:14:59.692 mkd test without the trailing space
The text was updated successfully, but these errors were encountered:
FarGroup#5 by @carton-of-mice:
NetBox appears to trim trailing spaces on FTP listings (and in other places).
While at least
CFtpListResult::parseAsMlsd()
honours RFC 3659 and says it does not trim, that function is fed data fromCFtpListResult::GetLine()
, that explicitly removes tailing spaces and tabs.This leads to an invalid directory listing that can't be used for further operations.
Assuming one knows the correct name of a directory, punching in
CD "test "
in the command line can work around this.Behaviour reproduced at least with pure-ftpd (over MLSD) and vsftpd (on whatever it emits for LIST) and I imagine it should be similar with any backing filesystem and FTP server allowing trailing spaces in filenames.
While I agree that this is bad practice, more so with a badly defined protocol, this is compatibility problem first.
From the log for MLSD:
Related trailing spaces issues I did not investigate much
MKD test
from the command line properly creates it with trailing space (or underscore, in the case of pure-ftpd, but it does reach the server properly). In both cases the log shows> 2020-09-15 20:14:59.692 mkd test
without the trailing spaceThe text was updated successfully, but these errors were encountered: