commit | e225862d350ffc0e86e2d22378dd0ba0d4e1ea0f | [log] [tgz] |
---|---|---|
author | Thomas Wolf <twolf@apache.org> | Sun May 28 16:38:20 2023 +0200 |
committer | Thomas Wolf <twolf@apache.org> | Mon Jun 05 19:53:12 2023 +0200 |
tree | 92fad4b977e2f9583b45551e9f337c712deb4345 | |
parent | a14d27ba884106fd5f9cfb72ac4314e716c5b252 [diff] |
GH-384: SFTP: improve FileChannel locking SSH_FXP_BLOCK is available only in SFTPv6. It was introduced in draft 08. Throw an UnsupportedOperationException if the negotiated SFTP version is lower. Respect the contract of FileChannel.lock(): a shared lock can be requested only if the channel was opened for reading, and an exclusive lock only if the channel is writable. Check this, and throw appropriate exceptions if the condition is violated. Pass on the correct lock flags to the server. At the server, repeat the version check, and respect the flags passed. Since Java does not have delete locks we map them to write locks. The draft RFC[1] is silent on what to do if no flags are passed at all: we use an exclusive write lock if the handle was opened for writing, and a shared read lock otherwise. We cannot throw an exception since we must be able to support old Apache MINA sshd clients that sent zero as lock flags. [1] https://www.ietf.org/archive/id/draft-ietf-secsh-filexfer-13.txt Bug: https://github.com/apache/mina-sshd/issues/384
Apache MINA SSHD is a 100% pure java library to support the SSH protocols on both the client and server side. It does not aim at being a replacement for the SSH client or SSH server from Unix operating systems, but rather provides support for Java based applications requiring SSH support.
The library can leverage several I/O back-ends:
AsynchronousSocketChannel
s.Releases of Apache MINA sshd are available at Maven Central. tar.gz
and ZIP source and binary distributions are available at the Apache MINA sshd web site.
Snapshot releases from the main branch are published on each push or merge on the main branch, if the tests pass successfully. These snapshot releases are available at the Apache Snapshot maven repository.
Bug reports and improvement or feature requests can be filed at the GitHub issue tracker or at the Apache issue tracker.
Sensitive issues such as security vulnerabilities must be reported through private channels, not via either issue tracker.
Java 8+ (as of version 1.3)
The code only requires the core abstract slf4j-api module. The actual implementation of the logging API can be selected from the many existing adaptors.
sshd-common - contains basic classes used throughout the project as well as code that does not require client or server network support.
sshd-core - contains the basic SSH client/server code implementing the connection, transport, channels, forwarding, etc..
sshd-sftp - contains the server side SFTP subsystem and the SFTP client code.
sshd-scp - contains the server side SCP command handler and the SCP client code.
sshd-ldap - contains server-side password and public key authenticators that use an LDAP server.
sshd-git - contains replacements for JGit SSH session factory.
sshd-osgi - contains an artifact that combines sshd-common and sshd-core so it can be deployed in OSGi environments.
sshd-putty - contains code that can parse PUTTY key files.
sshd-openpgp - contains code that can parse OpenPGP key files (with some limitations - see relevant section)
sshd-cli - contains simple templates for command-line client/server - used to provide look-and-feel similar to the Linux ssh/sshd commands.
sshd-contrib - experimental code that is currently under review and may find its way into one of the other artifacts (or become an entirely new artifact - e.g., sshd-putty evolved this way).
Including tests
mvn clean install
Without tests
mvn -Pquick clean install