★ wanayoo — archive 1999 https://github.com/nodeftpd/nodeftpd/pull/100Nouvelle recherche | Portail wanayoo
Skip to content
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

Standardize Path Names for readdir #100

Open
wants to merge 1 commit into
base: master
from

Conversation

@brandonmartinez
Copy link

brandonmartinez commented Apr 28, 2016

Different clients will use different characters for path delimiting (e.g. the Windows command line FTP client uses \ instead of /).Standardize on / to ease wildcard lookup.

Different clients will use different characters for path delimiting (e.g. the Windows command line FTP client uses \ instead of /).Standardize on / to ease wildcard lookup.
@mk-pmb
Copy link
Contributor

mk-pmb commented Apr 28, 2016

As far as I can see, current Travis failure is due to coding style, which could be rewritten. I foresee a real problem however in globbing files that have a backslash in their name.
Do we want to support such filenames?
Should support depend on the filesystem's capability to use backslashes in filenames? (We could guess based on OS name.)
Shall I try and write a glob test for them?

e.g. the Windows command line FTP client uses \ instead of /

Is this really a client issue, or could these backslashes be verbatim user input? Could there be confusion about whether to supply an FTP path or windows path?
What arguments and commands can we feed to a Windows (also, which version?) FTP client to make it send FTP commands with backslashes?

@brandonmartinez
Copy link
Author

brandonmartinez commented Apr 29, 2016

So, after some further testing, the point about blinding replacing the \ character can definitely cause some issues (e.g. UNIX only prevents / and \0 from being in file names, where Windows limits more characters). In my testing with the command line Windows ftp client, even if you specific say cd /my/directory, it translates it to \my\directory.

Is there a way to detect what client is connect and what their OS is? If so, we could just have a shim for specific clients (e.g. if we detect a window client, then do this type of replacement).

@mk-pmb
Copy link
Contributor

mk-pmb commented Apr 29, 2016

I don't have time to test client detection yet, but in case all fails, as a last resort we could make an option for server admins to define an option separator string to append arbitrary options to usernames in the login process. One such login option could state that the client requests backslash conversion for path strings sent by that client in that control session.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.