I think the message on the exception is sent back to the user, but currently there's no way to return a different error code than SSH_FX_FAILURE. I suppose we could define an exception containing the error code and use it if such an exception is caught.
On Mon, Sep 12, 2011 at 17:10, Davis Ford <[email protected]> wrote: > Ok, I figured this out by implementing my own FileSystemView interface, and > related interfaces, and I can detect when a user tries to cd .. up to a > parent dir -- if I detect this, I'm just throwing a RuntimeException and the > client just gets an error indicating the SFTP command was not received. > > Technically this works, but it isn't clear to me how to do this gracefully > so they would get some kind of permissions error. > > This is in my own implementation of FileSystemView#getFile(String file) > which returns SshFile. Is there some way to code this, so the Sftp > subsystem will return some kind of auth or permissions error to the client? > > -----Original Message----- > From: Davis Ford > Sent: Friday, September 09, 2011 3:42 PM > To: '[email protected]' > Subject: RE: sftp questions > > Guillame -- Thanks for the info, appreciate it. One other quick follow-up > if I may - is there an easy way to pin a client into a specific directory > for uploads? > > > -- ------------------------ Guillaume Nodet ------------------------ Blog: http://gnodet.blogspot.com/ ------------------------ Open Source SOA http://fusesource.com
