wolpi / prim-ftpd

FTP server app for android
Other
620 stars 78 forks source link

Listing directories starting with `/` does not work #299

Closed qwerty287 closed 1 year ago

qwerty287 commented 1 year ago

Hi, if you try to list a directory starting with a / (e.g. / or /Camera), your app does not work and just returns an empty file list. I'm using the plain old filesystem storage. You can "fix" this by prefixing the path with /storage/emulated/0 (e.g. /storage/emulated/0/Camera), then it works. This means that primFTPd seems to try to get the absolute path from the filesystem. I'm not totally sure if this isn't intentional, but I think it would be better to list the content root directory if requesting /, just like it happens without /. (This could be easily fixed by just removing the prefixed / from all requested paths if I'm not mistaken). This affects both FTP and SFTP.

Thanks!

wolpi commented 1 year ago

That behavior is intentional. Just removing / from paths would surly cause all kinds of side effects. You can get desired behavior by using SAF or Virtual-Folders (in latter case you would have to prefix paths with /fs).

qwerty287 commented 1 year ago

Ok, thanks for the explanation.