You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "tomaswolf (via GitHub)" <gi...@apache.org> on 2023/05/29 11:24:25 UTC
[GitHub] [mina-sshd] tomaswolf opened a new issue, #383: SftpFileSystemProvider.newFileChannel() uses wrong default mode
tomaswolf opened a new issue, #383:
URL: https://github.com/apache/mina-sshd/issues/383
### Version
master
### Bug description
According to the contract of `FileSystemProvider.newFileChannel()` per its javadoc, the channel is opened read-only if no `OpenOption`s are passed.
`SftpFileSystemProvider` opens the channel in read-write mode in this case.
### Actual behavior
Channel is opened read-write, which fails if the remote file is read-only.
### Expected behavior
Channel is opened read-only if `SftpFileSystemProvider.newFileChannel(path)` is called without `OpenOption`s.
### Relevant log output
_No response_
### Other information
_No response_
--
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] hannibal218bc commented on issue #383: SftpFileSystemProvider.newFileChannel() uses wrong default mode
Posted by "hannibal218bc (via GitHub)" <gi...@apache.org>.
hannibal218bc commented on issue #383:
URL: https://github.com/apache/mina-sshd/issues/383#issuecomment-1571086381
Sure, I've just force-pushed faf88ec0fd25c1907a75ffb415427ac7c9b7581c , could you please approve the action workflow run? :+1:
--
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
[GitHub] [mina-sshd] hannibal218bc commented on issue #383: SftpFileSystemProvider.newFileChannel() uses wrong default mode
Posted by "hannibal218bc (via GitHub)" <gi...@apache.org>.
hannibal218bc commented on issue #383:
URL: https://github.com/apache/mina-sshd/issues/383#issuecomment-1569060812
> Yes, but I would not read this too literally. All the other options imply write access, don't they?
I thought specs are meant to be taken literally ;-) but yes, I agree that e.g. `SYNC` probably isn't useful on a read-only file. However, I think with e.g. `CREATE` it is not that clear.
--
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
[GitHub] [mina-sshd] tomaswolf commented on issue #383: SftpFileSystemProvider.newFileChannel() uses wrong default mode
Posted by "tomaswolf (via GitHub)" <gi...@apache.org>.
tomaswolf commented on issue #383:
URL: https://github.com/apache/mina-sshd/issues/383#issuecomment-1569044104
Yes, but I would not read this too literally. All the other options imply write access, don't they?
--
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
[GitHub] [mina-sshd] tomaswolf commented on issue #383: SftpFileSystemProvider.newFileChannel() uses wrong default mode
Posted by "tomaswolf (via GitHub)" <gi...@apache.org>.
tomaswolf commented on issue #383:
URL: https://github.com/apache/mina-sshd/issues/383#issuecomment-1570475586
No sure there's a use case for CREATE, READ. For now I think your change #372 is fine (setting READ if no options). We can change it later to "set READ if neither WRITE nor APPEND present", if needed, but then that should probably be done in other places as well.
Do you want to fix the failing tests? I prefer to have master working at any commit, so if you could amend your commit, that'd be great; then I could merge it.
--
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
[GitHub] [mina-sshd] tomaswolf closed issue #383: SftpFileSystemProvider.newFileChannel() uses wrong default mode
Posted by "tomaswolf (via GitHub)" <gi...@apache.org>.
tomaswolf closed issue #383: SftpFileSystemProvider.newFileChannel() uses wrong default mode
URL: https://github.com/apache/mina-sshd/issues/383
--
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
[GitHub] [mina-sshd] hannibal218bc commented on issue #383: SftpFileSystemProvider.newFileChannel() uses wrong default mode
Posted by "hannibal218bc (via GitHub)" <gi...@apache.org>.
hannibal218bc commented on issue #383:
URL: https://github.com/apache/mina-sshd/issues/383#issuecomment-1569020724
Hi,
thank you for taking care of this issue. Sorry for nickpicking, but the description "the channel is opened read-only if no OpenOptions are passed" is not correct.
[The contract](https://docs.oracle.com/javase/8/docs/api/java/nio/channels/FileChannel.html#open-java.nio.file.Path-java.util.Set-java.nio.file.attribute.FileAttribute...-) actually is "If neither option (`WRITE` or `APPEND`, ed.) is contained in the array then the file is opened for reading".
--
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