Preventing operations in a virtual file system?

0 votes
asked Nov 2, 2017 by Paula (200 points)

Hello,

What is the recommended approach for preventing directory/file creation/renaming/removal in some circumstances (e.g. only in the file system's root)?

For renaming, I have attempted:

  • cancelling the operation in FileSystemNotifier.RenamePreview event; in this situation I'm not able to provide a meaningful feedback to the sftp client (it receives "Internal server error")
  • not doing anything in ReadWriteFileSystemProvider.Rename; in this situation, there is no feedback at all for the client and the server logs the operation as successful (which is a bit confusing for my purpose...)

Thanks!

Applies to: File Server, Rebex SFTP

1 Answer

0 votes
answered Nov 2, 2017 by renestein (1,190 points)
selected Nov 8, 2017 by Paula
 
Best answer

Hello,
I think that option 1 (Cancelling the operation in FileSystemNotifier.RenamePreview event) is correct.

I understand that message returned to the client is confusing.
What message do you need/prefer on the client?

1) We can prepare beta for you. In the beta we will return better message whenever FS operation is canceled in the preview event.

2) We are considering to add better support for the error messages generated from the custom file system.

commented Nov 3, 2017 by Paula (200 points)
Hi,

The message is "Operation not allowed", but it would be nice to be able to pass the message when cancelling, for different scenarios.
Beta would help.

Thanks for the support, really appreciated.
commented Nov 3, 2017 by renestein (1,190 points)
Hi Paula,
 I have sent hotfix to your e-mail.
...