Path names supplied with ftp commands will be normalized, causing:
excess slash characters to be removed
. path elements to be removed
.. path elements backing up the path one level
tools/ftpserver.c: Refactoring of ftpserver.c
Consisting of mostly editorial work and additional checks
Removed
commented out code
if 0 deselected code
code for WIN32
Optimize LIST and NLIST
Both commands use the same function now, which is told by
a parameter which format to use. This function do_list() now
also receives a buffer for temporary strings, reducing it's stack
usage.
Always build pathname from the parameter
Since many commands use the parameter as filename, build it
always. It does not hurt, if the parameter is not a filename, since
building the path has no side effects.
Checks:
Check, that the resulting path created by build_full_path()
does not exceed the buffer size.
Test, that the target given with CWD exists and is a dir
Bug fixes:
do not call chdir(). Just change the session->current_dir
variable
tools/ftpserver.c: Normalize path names
Path names supplied with ftp commands will be normalized, causing:
tools/ftpserver.c: Refactoring of ftpserver.c
Consisting of mostly editorial work and additional checks
Removed
if 0 deselected code
Optimize LIST and NLIST
Always build pathname from the parameter
Checks: Check, that the resulting path created by build_full_path() does not exceed the buffer size.
Bug fixes: