You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by GitBox <gi...@apache.org> on 2022/12/20 19:27:39 UTC

[GitHub] [mina-sshd] ThanasisBarekas opened a new issue, #296: [Support Request] Read only VirtualFileSystemFactory

ThanasisBarekas opened a new issue, #296:
URL: https://github.com/apache/mina-sshd/issues/296

   Hello,
   
   Is it possible to create a read only VirtualFileSystemFactory ? if yes can you please share an example ?
   
   Thank you,
   Thanasis


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org


[GitHub] [mina-sshd] tomaswolf commented on issue #296: [Support Request] Read only VirtualFileSystemFactory

Posted by GitBox <gi...@apache.org>.
tomaswolf commented on issue #296:
URL: https://github.com/apache/mina-sshd/issues/296#issuecomment-1360277406

   I looked at that a while ago myself in the context of [Gerrit issue 15944](https://bugs.chromium.org/p/gerrit/issues/detail?id=15944). I didn't see immediately how to do that. Perhaps someone more knowledgeable with FileSystems can chime in here.
   
   To enforce read-only SFTP access, another approach might be using a `org.apache.sshd.contrib.server.subsystem.sftp.SimpleAccessControlSftpEventListener.READ_ONLY_ACCESSOR`. Something like
   
   ```
     SftpSubsystemFactory.Builder builder = new SftpSubsystemFactory.Builder();
     builder.addSftpEventListener(SimpleAccessControlSftpEventListener.READ_ONLY_ACCESSOR);
     server.setSubsystemFactories(Collections.singletonList(builder.build())); // Actually, add the SFTP factory to whatever other factories there are.
     server.setFileSystemFactory(new VirtualFileSystemFactory(rootPath));
   ```
   
   Otherwise look at `org.apache.sshd.common.file.root.RootedFileSystem`. It does have an `isReadOnly()` method. It might perhaps be necessary to override more methods to make it truly read-only, and you'd need a provider for it, and probably override parts of the `VirtualFileSystemFactory` to use your own read-only filesystem implementation.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org