Closed garywill closed 5 years ago
OK, I see two bugs here:
1) The client sends all commands in CAPS except for 'list', or 'list -la' -- the client should send LIST, but admittedly uftpd should handle mixed caps as well 2) Absolute path argument to uftpd seems to have stopped working
Thanks for the report, I'll look into it!
Should be fixed now. If you have chance, I'd be grateful if you could verify the fix. Hopefully I can get a fully-tested release out during the weekend.
Thank you for the work! If you upload a linux x64 binary to somewhere so I can get it run easily , I will be able to verify soon
Uh, I'm not really comfortable distributing binaries to end-users ... but here goes. It's statically linked and packed with upx: http://ftp.troglobit.com/uftpd/uftpd
I tested it. I can connect with dolphin. There's always an "a" in the path
$ ./uftpd -l debug -n -o ftp=2121 -o writable .
17469> Initializing ...
17469> Serving files as PID 17469 ...
17469> Starting services ...
17469> Opened socket for port 2121
17469> Starting FTP server on port 2121 ...
17469> Not allowed to start TFTP service. Privileged port.
17469> Serving files from /dev/shm/mem ...
17469> Created new client session as PID 17470
17470> Client connection from 127.0.0.1
17470> Sent: 220 uftpd (2.7) ready.
17470> Recv: USER anonymous
17470> Guest logged in from 127.0.0.1
17470> Sent: 230 Guest login OK, access restrictions apply.
17470> Recv: SYST
17470> Sent: 215 UNIX Type: L8
17470> Recv: PWD
17470> Sent: 257 "/"
17470> Recv: PASV
17470> Data server port estabished. Waiting for client connnect ...
17470> Sent: 227 Entering Passive Mode (127,0,0,1,139,211)
17470> Event on data_listen_sd ...
17470> Client PASV data connection from 127.0.0.1:54130
17470> No pending command, waiting ...
17470> Recv: LIST -la
17470> Compose path from cwd: /, arg: a
17470> Server path from CWD: /a
17470> Resulting non-chroot path: /dev/shm/mem/a
17470> Reading directory /dev/shm/mem/a ... 4 number of entries
17470> Sent: 125 Data connection already open; transfer starting.
17470> Sending LIST entry 0 of 4 to 127.0.0.1 ...
17470> Found directory entry .
17470> Found directory entry ..
17470> Found directory entry 888
17470> Compose path from cwd: /, arg: a/888
17470> Server path from CWD: /a/888
17470> Resulting non-chroot path: /dev/shm/mem/a/888
17470> LIST drwxr-xr-x 1 0 0 60 Mar 15 22:28 888
17470> Found directory entry t
17470> Compose path from cwd: /, arg: a/t
17470> Server path from CWD: /a/t
17470> Resulting non-chroot path: /dev/shm/mem/a/t
17470> Found directory entry .
17470> Found directory entry ..
17470> Found directory entry 888
17470> Compose path from cwd: /, arg: a/888
17470> Server path from CWD: /a/888
17470> Resulting non-chroot path: /dev/shm/mem/a/888
17470> Found directory entry t
17470> Compose path from cwd: /, arg: a/t
17470> Server path from CWD: /a/t
17470> Resulting non-chroot path: /dev/shm/mem/a/t
17470> LIST -rw-r--r-- 1 0 0 9 Mar 15 22:27 t
However if I manually create a folder "a" in the path, it can list the files inside "a".
Thank you for taking the time to test! Interesting behavior ... your cwd was /dev/shm/mem/
when you started uftpd, right?
Reopening
Found it, uftpd only read "-l" and "a" became the argument to LIST. I've tested with Dolphin and it seems to work properly now, finally. There's a new binary uploaded as well, if you'd like to verify.
Filzilla works fine as client. But when I use KDE dolphin as ftp client, I can't list files.