-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle StartDir differently in case of VirtFS #354
Conversation
Now it's ready to review. |
Over the years I had similar issues with some clients 😄
Well, I also see that current code and behavior is not perfect. With current code it would be possible to access files on root folder which is not possible with new code. But would be ok for me to change this. |
Oh, and this change breaks my test script. |
So, I think I've found finally an even better solution:
|
That seems to be a good and elegant approach 👍 |
UPDATE: complete rewrite of this comment
Without this PR, pftpd VirtFS behaves errorneously:
/storage/emulated/0
is selected as startDir/fs
/fs
to/fs/storage/emulated/0
, that's OK, we can..
out, and when on/fs
again, it shows the startDir's content, but can't access the folders in it anymore, so gets broken/
is the startDir, works everythingWith this PR:
the startDir's content is seen under/fs
, eg. we have/fs/Android
if startDir is/storage/emulated/0
or we have/fs/storage
if startDir is/
/fs/storage/emulated/0
(Note: SSHFS must select/
as start folder)this is analogous to the/saf
and/rosaf
folders, where we can see the content of the selected SD card folderJust fun fact: I made a version (https://github.com/lmagyar/prim-ftpd/tree/dev-dual-root-and-home-for-sshfs), where depending on SSHFS's start dir,
/
or nothing=user's home, it was able to see the/
folder under/fs
(when/
is SSHFS's start dir), or the selected startDir, eg./storage/emulated/0
under/fs
(when `` is the SSHFS start dir), it was soo cool, but WinSCP got completely broken and couldn't figure out the reason, even my fake symlink experiments on/fs
etc. folders were broken, so gave up. :(