View Single Post
Old 10-06-2009, 09:51 PM  
Yil
Too much time...
 
Join Date: May 2005
Posts: 1,194
Default

Quote:
Originally Posted by dr.owned View Post
i'm trying to prevent direct execution of a CWD command and CWD to different directory instead. how can i do it? pre-cwd doesn't seem to help much.
it's an attempt to lock user one level below the root folder to be able to return links to other root-level directories (in virtual directory script) while user is stuck in a separate one.
I don' t think there is a way you can re-direct the user to a different location for a CWD in the normal filesystem right now. Best bet it to wait a bit for v7.1 where I can find a solution to your problem via hidden pass-through only mountpoints, +x-r dir support, the pre-cmd rewrite idea, or a feature from previous discussions which includes locking users into their home directories. Some variants of locked home dirs make it a VFS path inside a mountfile BUT it acts like '/' and you need to provide links to paths outside of it to expose directory trees. When you CDUP or CWD / you end up back in home as a special cased feature. If coupled with virtual dirs that would allow you to do whatever...

I'm also tempted to support a much more powerful form of pre-cmd. Instead of just being able to accept/reject I think it would be simple to add a new ioTCL command that would allow you to provide replacement text. Thus you could re-write CWD to redirect wherever you wanted and/or do a whole host of other cool things. You would still have to watch out for RETR/STOR/LIST /foo/bar/baz type commands as well but it would allow you to lock down where users could wander which would make it more powerful than -r+x ever could be...

Perhaps I'll have to write a script to shadow a real directory tree virtually as a local test. That might be interesting and see if I can't support virtual directory creation, etc all without too much hassle...
Yil is offline   Reply With Quote