Thread: ioNiNJA ALPHA
View Single Post
Old 05-03-2008, 03:39 AM  
Yil
Too much time...
 
Join Date: May 2005
Posts: 1,194
Default

Decided to use your script to test out some changes in the upcoming v6.5 and noticed a bug in the configuration.

Under [FTP_Pre-Command_Events]
dele = TCL ..\scripts\ioNiNJA\ioNiNJA.itcl
rmd = TCL ..\scripts\ioNiNJA\ioNiNJA.itcl

You probably don't want this from what I can tell. Pre-Commands run BEFORE the actual command and thus BEFORE permission validation and are really designed for permission validation inside the script. What this means is if you try to delete a file or directory for which you don't have permission the zipscript will think that action took place. I tried deleting a file from a dir with a .sfv in it and sure enough I got a .missing file popping up and an incomplete tag, but the original file was still there and everything was complete.

Just move these to FTP_Post-Command_Events and all will be good.

One option you may choose to implement in your config file is to prevent users without certain user flags from deleting files from complete releases. This really only makes sense when you have a site wipe/nuke script also running but in that case it's probably useful. This is an example of what PRE events are useful for.


On a different note, I've run into a stuck/zombie style user problem with ioFTPD a couple of times and one crashlog sent to me looks like ioNiNJA was stuck sleeping forever. I'm assuming this can happen based on a really quick look if a .lock file is leftover from a crash or something. Perhaps a timeout before throwing an exception or validate the timestamp on the lock or something? Another option to consider is doing away with a file lock at all and use the [waitobject] itcl feature. You can name the lock the name of the real path of the file/dir and then no .lock files needed and no cleanup if a crash happens. I'm not sure who uses waitobjects, but they're in the code... doc/itcl.txt has the details.
Yil is offline   Reply With Quote