PDA

View Full Version : How to prevent CWD?


scull
03-19-2004, 12:55 AM
Hi ..

I have a VB6 question.

I have made a script that prevent unwanted dirs to be uploaded. I'm exiting my program and leave 1 ... This BLOCKS the PRE-MKD event, so far so god. BUT ( why are there always a but ? ) then ioFTPD or the client wants to CWD ( change owner dir ) to the NOT made "MKD" dir. And while searching it ioFTPD finally times out .. ( the unwanted dir however is NOT uploaded and all the other files is uploaded after the timeout and reconnet ).

The Question: How does i prevent the CWD to the unexisting, blocked dir ?

//Scull

ADDiCT
03-19-2004, 03:30 AM
Do u send a '550 MKD failed' reply to the client? If u exit your script with -1, u have to return an error to the client yourself, as ioFTPD will abort it's own procedure.

scull
03-20-2004, 10:00 AM
Thanx for the help!

It does work now :) ..

But i used "226 Closing data connection." and "426 connection closed; transfer aborted." in a combination ... that worked too.

//Scull

Mouton
03-21-2004, 11:21 AM
Except 226 and 426 aren't allowed response to a MKD according to the RFC.

http://www.w3.org/Protocols/rfc959/9_References.html
Check 4.2. FTP REPLIES

5yz Permanent Negative Completion reply
...
x5z File system - These replies indicate the status of the
Server file system vis-a-vis the requested transfer or
other file system action.
...