troglobit/uftpd

path issues

Spacewalker2 opened this issue · 10 comments

If the path parameter on cli is something like uftpd … Downloads and not uftpd … ~/Downloads I get a ls: Access failed: 550 No such file or directory. error message.

Sometimes I get error messages like below. But I'm not sure what it means and I'm not able to reproduce it with other paths. Besides everything in my $HOME is writable to uftpd. The only difference here is that I used a chattr +i on the files in the folder but when I cut the last element of the path I can access the folder and download the files.

7333> Initializing ...
7333> FTP root <path> writable, possible security violation!
7333> Failed initializing, exiting.

Thanks for this cool tool!

The first part of this report I cannot make heads or tails of. What do you do to get ls: Access failed ...?

The second part is an attempt at helping users not shooting themselves in the foot. I just noticed it's a little buggy ... but the intention is: If you really want to serve a folder that is writable to uftpd, then start it with uftpd -o writable PATH

The latter part of your report is now fixed, it now always complains about security violation, unless -o writable.

Sorry for the misconceptions. The first part is that a relative path as parameter isn't working here. I guess the shell expands ~/Downloads to a full path and this works here all the time.

About the second part. Does it mean that the ftp root isn't writable except I use -o writable but sub-directories are writable every time?

No worries, I just cannot reproduce the first part so anything you could assist with to help reproduce it would be greatly appreciated.

Second part: Yes. This to support an "upload/" sub-directory or similar.

I'm not sure if this helps. If I execute uftpd -l debug -n -o tftp=0,ftp=12345 ~/Pictures/eBay/ then it is working as expected.

Version: 2.6

$ uftpd -l debug -n -o tftp=0,ftp=12345 Pictures/eBay/
15221> Initializing ...
15221> Serving files as PID 15221 ...
15221> Starting services ...
15221> Opened socket for port 12345
15221> Starting FTP server on port 12345 ...
15221> Serving files from Pictures/eBay ...
15221> Created new client session as PID 15224
15224> Client connection from 127.0.0.1
15224> Sent: 220 uftpd (2.6) ready.

15224> Recv: FEAT 
15224> Sent: 
211-Features:
 EPSV
 PASV
 SIZE
 UTF8
 REST STREAM
 MLST modify*;perm*;size*;type*;
211 End

15224> Recv: OPTS UTF8 ON
15224> Sent: 200 UTF8 OPTS ON

15224> Recv: USER anonymous
15224> Guest logged in from 127.0.0.1
15224> Sent: 230 Guest login OK, access restrictions apply.
15221> Starting services ...
15221> Opened socket for port 12345
15221> Starting FTP server on port 12345 ...
15221> Serving files from Pictures/eBay ...
15221> Created new client session as PID 15224
15224> Client connection from 127.0.0.1
15224> Sent: 220 uftpd (2.6) ready.

15224> Recv: FEAT 
15224> Sent: 
211-Features:
 EPSV
 PASV
 SIZE
 UTF8
 REST STREAM
 MLST modify*;perm*;size*;type*;
211 End

15224> Recv: OPTS UTF8 ON
15224> Sent: 200 UTF8 OPTS ON

15224> Recv: USER anonymous
15224> Guest logged in from 127.0.0.1
15224> Sent: 230 Guest login OK, access restrictions apply.

15224> Recv: PWD 
15224> Sent: 257 "/"

15224> Recv: PASV 
15224> Data server port estabished.  Waiting for client connnect ...
15224> Sent: 227 Entering Passive Mode (127,0,0,1,130,31)

15224> Event on data_listen_sd ...
15224> Client PASV data connection from 127.0.0.1:52580
15224> No pending command, waiting ...
15224> Recv: LIST 
15224> Compose path from cwd: /, arg: 
15224> Server path from CWD: /
15224> Resulting non-chroot path: Pictures/eBay/
15224> Failed realpath(Pictures). Error 2: No such file or directory
15224> Sent: 550 No such file or directory.

15224> Recv: QUIT 
15224> Sent: 221 Goodbye.

15224> Client exiting, bye
15224> FTP Client session ended.
^C15221> Recieved signal 2, exiting ...

Ah, thanks reproduced! :)

Looking into it ...

There, pretty sure I fixed it! :-)

Thanks for the great work you have done now and before! If it isn't too much to ask then maybe you can create a new release please. It would allow me to use AUR for upgrading.

Working on it! ;-)