[06/16] mina-sshd git commit: [SSHD-698] Use <> when possible

2016-09-15 Thread gnodet
[SSHD-698] Use <> when possible

Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/195874b4
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/195874b4
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/195874b4

Branch: refs/heads/master
Commit: 195874b47c807fee4c4a3fb84fd43eb5d04c0925
Parents: 8804691
Author: Guillaume Nodet 
Authored: Thu Sep 15 11:25:18 2016 +0200
Committer: Guillaume Nodet 
Committed: Thu Sep 15 21:06:31 2016 +0200

--
 .../main/java/org/apache/sshd/agent/unix/AgentClient.java| 2 +-
 .../sshd/client/auth/AuthenticationIdentitiesProvider.java   | 2 +-
 .../sshd/client/auth/hostbased/HostKeyIdentityProvider.java  | 2 +-
 .../sshd/client/auth/password/PasswordIdentityProvider.java  | 2 +-
 .../client/config/hosts/ConfigFileHostEntryResolver.java | 2 +-
 .../org/apache/sshd/client/config/hosts/HostConfigEntry.java | 2 +-
 .../apache/sshd/client/config/hosts/HostPatternsHolder.java  | 2 +-
 .../sshd/client/keyverifier/KnownHostsServerKeyVerifier.java | 4 ++--
 .../sftp/extensions/helpers/AbstractCheckFileExtension.java  | 2 +-
 .../main/java/org/apache/sshd/common/SyspropsMapWrapper.java | 2 +-
 .../apache/sshd/common/channel/BufferedIoOutputStream.java   | 4 ++--
 .../java/org/apache/sshd/common/channel/SttySupport.java | 6 +++---
 .../java/org/apache/sshd/common/config/TimeValueConfig.java  | 2 +-
 .../apache/sshd/common/config/keys/AuthorizedKeyEntry.java   | 2 +-
 .../main/java/org/apache/sshd/common/forward/SocksProxy.java | 2 +-
 .../sshd/common/keyprovider/AbstractFileKeyPairProvider.java | 2 +-
 .../sshd/common/keyprovider/MappedKeyPairProvider.java   | 2 +-
 .../sshd/common/session/helpers/SessionTimeoutListener.java  | 2 +-
 .../org/apache/sshd/common/subsystem/sftp/SftpHelper.java| 4 ++--
 .../common/subsystem/sftp/extensions/AclSupportedParser.java | 4 ++--
 .../sshd/common/subsystem/sftp/extensions/ParserUtils.java   | 2 +-
 .../main/java/org/apache/sshd/common/util/SelectorUtils.java | 2 +-
 .../java/org/apache/sshd/common/util/closeable/Builder.java  | 4 ++--
 .../apache/sshd/common/util/io/ModifiableFileWatcher.java| 4 ++--
 .../org/apache/sshd/common/util/net/SshdSocketAddress.java   | 2 +-
 .../org/apache/sshd/common/util/threads/ThreadUtils.java | 4 ++--
 .../server/auth/keyboard/UserAuthKeyboardInteractive.java| 2 +-
 .../server/auth/pubkey/CachingPublicKeyAuthenticator.java| 2 +-
 .../sshd/server/config/keys/AuthorizedKeysAuthenticator.java | 2 +-
 .../src/main/java/org/apache/sshd/server/kex/Moduli.java | 2 +-
 .../main/java/org/apache/sshd/git/pack/GitPackCommand.java   | 2 +-
 .../java/org/apache/sshd/git/pgm/EmbeddedCommandRunner.java  | 2 +-
 .../apache/sshd/common/util/net/LdapNetworkConnector.java| 8 
 .../sshd/server/auth/pubkey/LdapPublickeyAuthenticator.java  | 2 +-
 34 files changed, 46 insertions(+), 46 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/195874b4/sshd-core/src/main/java/org/apache/sshd/agent/unix/AgentClient.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/agent/unix/AgentClient.java 
b/sshd-core/src/main/java/org/apache/sshd/agent/unix/AgentClient.java
index ac9fab8..97acd90 100644
--- a/sshd-core/src/main/java/org/apache/sshd/agent/unix/AgentClient.java
+++ b/sshd-core/src/main/java/org/apache/sshd/agent/unix/AgentClient.java
@@ -67,7 +67,7 @@ public class AgentClient extends AbstractAgentProxy 
implements Runnable {
 throwException(result);
 }
 receiveBuffer = new ByteArrayBuffer();
-messages = new ArrayBlockingQueue(10);
+messages = new ArrayBlockingQueue<>(10);
 
 ExecutorService service = getExecutorService();
 pumper = service.submit(this);

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/195874b4/sshd-core/src/main/java/org/apache/sshd/client/auth/AuthenticationIdentitiesProvider.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/client/auth/AuthenticationIdentitiesProvider.java
 
b/sshd-core/src/main/java/org/apache/sshd/client/auth/AuthenticationIdentitiesProvider.java
index 56ef102..7afd266 100644
--- 
a/sshd-core/src/main/java/org/apache/sshd/client/auth/AuthenticationIdentitiesProvider.java
+++ 
b/sshd-core/src/main/java/org/apache/sshd/client/auth/AuthenticationIdentitiesProvider.java
@@ -128,7 +128,7 @@ public interface AuthenticationIdentitiesProvider extends 
KeyIdentityProvider, P
 }
 
 if (matches == null) {
-matches = new LinkedList();
+  

[01/16] mina-sshd git commit: [SSHD-698] Code cleanup

2016-09-15 Thread gnodet
Repository: mina-sshd
Updated Branches:
  refs/heads/master 13989b4f2 -> 977b7b529


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/57f6a6b0/sshd-core/src/test/java/org/apache/sshd/server/channel/ChannelSessionTest.java
--
diff --git 
a/sshd-core/src/test/java/org/apache/sshd/server/channel/ChannelSessionTest.java
 
b/sshd-core/src/test/java/org/apache/sshd/server/channel/ChannelSessionTest.java
index 13ce2a9..4cc8fc5 100644
--- 
a/sshd-core/src/test/java/org/apache/sshd/server/channel/ChannelSessionTest.java
+++ 
b/sshd-core/src/test/java/org/apache/sshd/server/channel/ChannelSessionTest.java
@@ -53,7 +53,7 @@ public class ChannelSessionTest extends BaseTestSupport {
 try (ChannelSession channelSession = new ChannelSession() {
 {
 Window wRemote = getRemoteWindow();
-
wRemote.init(PropertyResolverUtils.toPropertyResolver(Collections.emptyMap()));
+
wRemote.init(PropertyResolverUtils.toPropertyResolver(Collections.emptyMap()));
 }
 }) {
 final AtomicBoolean expanded = new AtomicBoolean(false);
@@ -75,7 +75,7 @@ public class ChannelSessionTest extends BaseTestSupport {
 try (ChannelSession session = new ChannelSession() {
 {
 Window wRemote = getRemoteWindow();
-
wRemote.init(PropertyResolverUtils.toPropertyResolver(Collections.emptyMap()));
+
wRemote.init(PropertyResolverUtils.toPropertyResolver(Collections.emptyMap()));
 }
 }) {
 session.addCloseFutureListener(new 
SshFutureListener() {

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/57f6a6b0/sshd-core/src/test/java/org/apache/sshd/server/shell/TtyFilterOutputStreamTest.java
--
diff --git 
a/sshd-core/src/test/java/org/apache/sshd/server/shell/TtyFilterOutputStreamTest.java
 
b/sshd-core/src/test/java/org/apache/sshd/server/shell/TtyFilterOutputStreamTest.java
index e15aa44..5b41665 100644
--- 
a/sshd-core/src/test/java/org/apache/sshd/server/shell/TtyFilterOutputStreamTest.java
+++ 
b/sshd-core/src/test/java/org/apache/sshd/server/shell/TtyFilterOutputStreamTest.java
@@ -77,9 +77,9 @@ public class TtyFilterOutputStreamTest extends 
BaseTestSupport {
 }
 }
 };
-TtyFilterOutputStream ttyOut = new TtyFilterOutputStream(
-output, null, PtyMode.ECHO.equals(mode) ? 
Collections.emptySet() : EnumSet.of(mode));
-Writer writer = new OutputStreamWriter(ttyOut, 
StandardCharsets.UTF_8)) {
+ TtyFilterOutputStream ttyOut = new TtyFilterOutputStream(
+output, null, PtyMode.ECHO.equals(mode) ? 
Collections.emptySet() : EnumSet.of(mode));
+ Writer writer = new OutputStreamWriter(ttyOut, 
StandardCharsets.UTF_8)) {
 
 for (String l : lines) {
 writer.append(l).append("\r\n");

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/57f6a6b0/sshd-core/src/test/java/org/apache/sshd/server/subsystem/sftp/SshFsMounter.java
--
diff --git 
a/sshd-core/src/test/java/org/apache/sshd/server/subsystem/sftp/SshFsMounter.java
 
b/sshd-core/src/test/java/org/apache/sshd/server/subsystem/sftp/SshFsMounter.java
index 4cc9472..7c328a1 100644
--- 
a/sshd-core/src/test/java/org/apache/sshd/server/subsystem/sftp/SshFsMounter.java
+++ 
b/sshd-core/src/test/java/org/apache/sshd/server/subsystem/sftp/SshFsMounter.java
@@ -32,7 +32,6 @@ import java.util.Map;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Future;
 
-import org.apache.sshd.common.NamedFactory;
 import org.apache.sshd.common.config.SshConfigFileReader;
 import org.apache.sshd.common.io.IoServiceFactory;
 import org.apache.sshd.common.io.mina.MinaServiceFactory;
@@ -319,7 +318,7 @@ public final class SshFsMounter {
 sshd.setPasswordAuthenticator(AcceptAllPasswordAuthenticator.INSTANCE);
 sshd.setTcpipForwardingFilter(AcceptAllForwardingFilter.INSTANCE);
 sshd.setCommandFactory(new 
ScpCommandFactory.Builder().withDelegate(MounterCommandFactory.INSTANCE).build());
-
sshd.setSubsystemFactories(Collections.singletonList(new 
SftpSubsystemFactory()));
+sshd.setSubsystemFactories(Collections.singletonList(new 
SftpSubsystemFactory()));
 sshd.start();
 
 Thread.sleep(Long.MAX_VALUE);

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/57f6a6b0/sshd-core/src/test/java/org/apache/sshd/util/test/BaseTestSupport.java
--
diff --git 
a/sshd-core/src/test/java/org/apache/sshd/util/test/BaseTestSupport.java 

[04/16] mina-sshd git commit: [SSHD-698] Remove unnecessary boxing / unboxing

2016-09-15 Thread gnodet
[SSHD-698] Remove unnecessary boxing / unboxing

Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/83fc8d8a
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/83fc8d8a
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/83fc8d8a

Branch: refs/heads/master
Commit: 83fc8d8a8542bc93a1c5a2adff63bee68f85e413
Parents: 57f6a6b
Author: Guillaume Nodet 
Authored: Thu Sep 15 11:24:14 2016 +0200
Committer: Guillaume Nodet 
Committed: Thu Sep 15 21:06:22 2016 +0200

--
 .../org/apache/sshd/agent/common/AbstractAgentClient.java| 4 ++--
 .../java/org/apache/sshd/agent/unix/AgentServerProxy.java| 6 +++---
 .../client/channel/exit/ExitStatusChannelRequestHandler.java | 2 +-
 .../org/apache/sshd/client/config/hosts/HostConfigEntry.java | 6 +++---
 .../apache/sshd/client/config/hosts/HostPatternsHolder.java  | 6 +++---
 .../org/apache/sshd/client/future/DefaultAuthFuture.java | 6 +++---
 .../org/apache/sshd/client/future/DefaultOpenFuture.java | 4 ++--
 .../java/org/apache/sshd/client/scp/AbstractScpClient.java   | 4 ++--
 .../apache/sshd/client/session/ClientConnectionService.java  | 2 +-
 .../java/org/apache/sshd/client/session/ClientSession.java   | 2 +-
 .../apache/sshd/client/subsystem/sftp/DefaultSftpClient.java | 2 +-
 .../sshd/client/subsystem/sftp/SftpDirEntryIterator.java | 4 ++--
 .../sshd/client/subsystem/sftp/SftpVersionSelector.java  | 2 +-
 .../java/org/apache/sshd/common/PropertyResolverUtils.java   | 6 +++---
 .../main/java/org/apache/sshd/common/channel/PtyMode.java| 4 ++--
 .../main/java/org/apache/sshd/common/forward/SocksProxy.java | 2 +-
 .../apache/sshd/common/future/DefaultKeyExchangeFuture.java  | 2 +-
 .../src/main/java/org/apache/sshd/common/scp/ScpHelper.java  | 8 
 .../common/session/helpers/AbstractConnectionService.java| 2 +-
 .../apache/sshd/common/session/helpers/AbstractSession.java  | 2 +-
 .../org/apache/sshd/common/subsystem/sftp/SftpHelper.java| 6 +++---
 .../common/subsystem/sftp/extensions/AclSupportedParser.java | 6 +++---
 .../main/java/org/apache/sshd/common/util/NumberUtils.java   | 8 
 .../src/main/java/org/apache/sshd/common/util/OsUtils.java   | 4 ++--
 sshd-core/src/main/java/org/apache/sshd/server/Signal.java   | 4 ++--
 .../java/org/apache/sshd/server/channel/ChannelSession.java  | 2 +-
 .../src/main/java/org/apache/sshd/server/scp/ScpCommand.java | 2 +-
 .../apache/sshd/server/session/ServerUserAuthService.java| 2 +-
 .../org/apache/sshd/server/subsystem/sftp/FileHandle.java| 4 ++--
 .../org/apache/sshd/server/subsystem/sftp/SftpSubsystem.java | 4 ++--
 .../java/org/apache/sshd/git/pgm/EmbeddedCommandRunner.java  | 2 +-
 .../org/apache/sshd/git/transport/GitSshdSessionProcess.java | 2 +-
 32 files changed, 61 insertions(+), 61 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/83fc8d8a/sshd-core/src/main/java/org/apache/sshd/agent/common/AbstractAgentClient.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/agent/common/AbstractAgentClient.java 
b/sshd-core/src/main/java/org/apache/sshd/agent/common/AbstractAgentClient.java
index 3c90403..796cbdd 100644
--- 
a/sshd-core/src/main/java/org/apache/sshd/agent/common/AbstractAgentClient.java
+++ 
b/sshd-core/src/main/java/org/apache/sshd/agent/common/AbstractAgentClient.java
@@ -48,7 +48,7 @@ public abstract class AbstractAgentClient extends 
AbstractLoggingBean {
 if (avail < 4) {
 if (log.isTraceEnabled()) {
 log.trace("Received message total length ({}) below minuimum 
({})",
-  Integer.valueOf(avail), Integer.valueOf(4));
+avail, 4);
 }
 return;
 }
@@ -61,7 +61,7 @@ public abstract class AbstractAgentClient extends 
AbstractLoggingBean {
 if (avail < (len + 4)) {
 if (log.isTraceEnabled()) {
 log.trace("Received request length ({}) below minuimum ({})",
-  Integer.valueOf(avail), Integer.valueOf(len + 4));
+avail, len + 4);
 }
 return;
 }

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/83fc8d8a/sshd-core/src/main/java/org/apache/sshd/agent/unix/AgentServerProxy.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/agent/unix/AgentServerProxy.java 
b/sshd-core/src/main/java/org/apache/sshd/agent/unix/AgentServerProxy.java
index e59265b..cd0f22b 100644
--- a/sshd-core/src/main/java/org/apache/sshd/agent/unix/AgentServerProxy.java
+++ 

[12/16] mina-sshd git commit: [SSHD-698] Use lambda and method references, streams Deprecate Utils inner classes and use interface methods instead.

2016-09-15 Thread gnodet
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/977b7b52/sshd-core/src/main/java/org/apache/sshd/common/util/buffer/Buffer.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/common/util/buffer/Buffer.java 
b/sshd-core/src/main/java/org/apache/sshd/common/util/buffer/Buffer.java
index b040853..5da403c 100644
--- a/sshd-core/src/main/java/org/apache/sshd/common/util/buffer/Buffer.java
+++ b/sshd-core/src/main/java/org/apache/sshd/common/util/buffer/Buffer.java
@@ -284,7 +284,7 @@ public abstract class Buffer implements Readable {
 }
 
 public PublicKey getPublicKey() throws SshException {
-return getPublicKey(BufferPublicKeyParser.Utils.DEFAULT);
+return getPublicKey(BufferPublicKeyParser.DEFAULT);
 }
 
 /**
@@ -306,7 +306,7 @@ public abstract class Buffer implements Readable {
 }
 
 public PublicKey getRawPublicKey() throws SshException {
-return getRawPublicKey(BufferPublicKeyParser.Utils.DEFAULT);
+return getRawPublicKey(BufferPublicKeyParser.DEFAULT);
 }
 
 /**

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/977b7b52/sshd-core/src/main/java/org/apache/sshd/common/util/buffer/BufferUtils.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/common/util/buffer/BufferUtils.java 
b/sshd-core/src/main/java/org/apache/sshd/common/util/buffer/BufferUtils.java
index ab62c0e..3f8ee1e 100644
--- 
a/sshd-core/src/main/java/org/apache/sshd/common/util/buffer/BufferUtils.java
+++ 
b/sshd-core/src/main/java/org/apache/sshd/common/util/buffer/BufferUtils.java
@@ -48,12 +48,7 @@ public final class BufferUtils {
 public static final Level DEFAULT_HEXDUMP_LEVEL = Level.FINEST;
 
 public static final Int2IntFunction DEFAULT_BUFFER_GROWTH_FACTOR =
-new Int2IntFunction() {
-@Override
-public int apply(int value) {
-return getNextPowerOf2(value);
-}
-};
+BufferUtils::getNextPowerOf2;
 
 /**
  * Private Constructor

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/977b7b52/sshd-core/src/main/java/org/apache/sshd/common/util/buffer/keys/BufferPublicKeyParser.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/common/util/buffer/keys/BufferPublicKeyParser.java
 
b/sshd-core/src/main/java/org/apache/sshd/common/util/buffer/keys/BufferPublicKeyParser.java
index bcd3173..6d05868 100644
--- 
a/sshd-core/src/main/java/org/apache/sshd/common/util/buffer/keys/BufferPublicKeyParser.java
+++ 
b/sshd-core/src/main/java/org/apache/sshd/common/util/buffer/keys/BufferPublicKeyParser.java
@@ -35,6 +35,7 @@ import org.apache.sshd.common.util.buffer.Buffer;
  * @author mailto:d...@mina.apache.org;>Apache MINA SSHD Project
  */
 public interface BufferPublicKeyParser {
+
 BufferPublicKeyParser EMPTY = new 
BufferPublicKeyParser() {
 @Override
 public boolean isKeyTypeSupported(String keyType) {
@@ -52,6 +53,12 @@ public interface BufferPublicKeyParser {
 }
 };
 
+BufferPublicKeyParser DEFAULT = aggregate(
+Arrays.asList(
+RSABufferPublicKeyParser.INSTANCE,
+DSSBufferPublicKeyParser.INSTANCE,
+ECBufferPublicKeyParser.INSTANCE));
+
 /**
  * @param keyType The key type - e.g., ssh-rsa, 
ssh-dss
  * @return {@code true} if this key type is supported by the parser
@@ -71,51 +78,53 @@ public interface BufferPublicKeyParser {
  * @author mailto:d...@mina.apache.org;>Apache MINA SSHD 
Project
  */
 // CHECKSTYLE:OFF
+@Deprecated
 final class Utils {
 // CHECKSTYLE:ON
-public static final BufferPublicKeyParser DEFAULT = 
aggregate(
-Arrays.asList(
-RSABufferPublicKeyParser.INSTANCE,
-DSSBufferPublicKeyParser.INSTANCE,
-ECBufferPublicKeyParser.INSTANCE));
+
+public static final BufferPublicKeyParser DEFAULT = 
BufferPublicKeyParser.DEFAULT;
 
 private Utils() {
 throw new UnsupportedOperationException("No instance");
 }
 
 public static BufferPublicKeyParser aggregate(final 
Collection> parsers) {
-if (GenericUtils.isEmpty(parsers)) {
-return EMPTY;
-}
+return BufferPublicKeyParser.aggregate(parsers);
+}
+}
 
-return new BufferPublicKeyParser() {
-@Override
-public boolean isKeyTypeSupported(String keyType) {
-for (BufferPublicKeyParser p : 
parsers) {
-if (p.isKeyTypeSupported(keyType)) {
-return true;
-}
-}
+static BufferPublicKeyParser 

mina-sshd git commit: Switch to version 1.3.0-SNAPSHOT

2016-09-15 Thread gnodet
Repository: mina-sshd
Updated Branches:
  refs/heads/master 977b7b529 -> 241551793


Switch to version 1.3.0-SNAPSHOT

Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/24155179
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/24155179
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/24155179

Branch: refs/heads/master
Commit: 2415517934ec24e08c46edd5a24519d620b0baf2
Parents: 977b7b5
Author: Guillaume Nodet 
Authored: Thu Sep 15 21:41:57 2016 +0200
Committer: Guillaume Nodet 
Committed: Thu Sep 15 21:41:57 2016 +0200

--
 assembly/pom.xml | 2 +-
 pom.xml  | 2 +-
 sshd-contrib/pom.xml | 2 +-
 sshd-core/pom.xml| 2 +-
 sshd-git/pom.xml | 2 +-
 sshd-ldap/pom.xml| 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/24155179/assembly/pom.xml
--
diff --git a/assembly/pom.xml b/assembly/pom.xml
index 165b8ab..94e363a 100644
--- a/assembly/pom.xml
+++ b/assembly/pom.xml
@@ -24,7 +24,7 @@
 
 org.apache.sshd
 sshd
-1.2.1-SNAPSHOT
+1.3.0-SNAPSHOT
 
 
 apache-sshd

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/24155179/pom.xml
--
diff --git a/pom.xml b/pom.xml
index 1d4b678..7878d73 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
 
 org.apache.sshd
 sshd
-1.2.1-SNAPSHOT
+1.3.0-SNAPSHOT
 Apache Mina SSHD
 pom
 2008

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/24155179/sshd-contrib/pom.xml
--
diff --git a/sshd-contrib/pom.xml b/sshd-contrib/pom.xml
index 002fd65..7747076 100644
--- a/sshd-contrib/pom.xml
+++ b/sshd-contrib/pom.xml
@@ -24,7 +24,7 @@
 
 org.apache.sshd
 sshd
-1.2.1-SNAPSHOT
+1.3.0-SNAPSHOT
 
 
 

[mina-sshd] Git Push Summary

2016-09-19 Thread gnodet
Repository: mina-sshd
Updated Tags:  refs/tags/sshd-1.3.0 [created] 3e5da1bcd


mina-sshd git commit: [maven-release-plugin] prepare release sshd-1.3.0

2016-09-19 Thread gnodet
Repository: mina-sshd
Updated Branches:
  refs/heads/master eac82acbe -> 0344f79e6


[maven-release-plugin] prepare release sshd-1.3.0


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/0344f79e
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/0344f79e
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/0344f79e

Branch: refs/heads/master
Commit: 0344f79e69100234d0526a1b161031a16a45d824
Parents: eac82ac
Author: Guillaume Nodet 
Authored: Mon Sep 19 08:45:12 2016 +0200
Committer: Guillaume Nodet 
Committed: Mon Sep 19 08:45:12 2016 +0200

--
 assembly/pom.xml | 2 +-
 pom.xml  | 4 ++--
 sshd-contrib/pom.xml | 2 +-
 sshd-core/pom.xml| 2 +-
 sshd-git/pom.xml | 2 +-
 sshd-ldap/pom.xml| 2 +-
 6 files changed, 7 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/0344f79e/assembly/pom.xml
--
diff --git a/assembly/pom.xml b/assembly/pom.xml
index 94e363a..97f01ef 100644
--- a/assembly/pom.xml
+++ b/assembly/pom.xml
@@ -24,7 +24,7 @@
 
 org.apache.sshd
 sshd
-1.3.0-SNAPSHOT
+1.3.0
 
 
 apache-sshd

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/0344f79e/pom.xml
--
diff --git a/pom.xml b/pom.xml
index 7878d73..5e7b8d4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
 
 org.apache.sshd
 sshd
-1.3.0-SNAPSHOT
+1.3.0
 Apache Mina SSHD
 pom
 2008
@@ -76,7 +76,7 @@
 
scm:git:http://git-wip-us.apache.org/repos/asf/mina-sshd.git
 
scm:git:http://git-wip-us.apache.org/repos/asf/mina-sshd.git
 https://git-wip-us.apache.org/repos/asf?p=mina-sshd.git
-HEAD
+sshd-1.3.0
 
 
 

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/0344f79e/sshd-contrib/pom.xml
--
diff --git a/sshd-contrib/pom.xml b/sshd-contrib/pom.xml
index 7747076..36bbcf4 100644
--- a/sshd-contrib/pom.xml
+++ b/sshd-contrib/pom.xml
@@ -24,7 +24,7 @@
 
 org.apache.sshd
 sshd
-1.3.0-SNAPSHOT
+1.3.0
 
 
 

mina-sshd git commit: [maven-release-plugin] prepare for next development iteration

2016-09-19 Thread gnodet
Repository: mina-sshd
Updated Branches:
  refs/heads/master 0344f79e6 -> 389a1ecbd


[maven-release-plugin] prepare for next development iteration


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/389a1ecb
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/389a1ecb
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/389a1ecb

Branch: refs/heads/master
Commit: 389a1ecbddd7483d7d48a909543e99be09e4d681
Parents: 0344f79
Author: Guillaume Nodet 
Authored: Mon Sep 19 08:45:33 2016 +0200
Committer: Guillaume Nodet 
Committed: Mon Sep 19 08:45:33 2016 +0200

--
 assembly/pom.xml | 2 +-
 pom.xml  | 4 ++--
 sshd-contrib/pom.xml | 2 +-
 sshd-core/pom.xml| 2 +-
 sshd-git/pom.xml | 2 +-
 sshd-ldap/pom.xml| 2 +-
 6 files changed, 7 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/389a1ecb/assembly/pom.xml
--
diff --git a/assembly/pom.xml b/assembly/pom.xml
index 97f01ef..c387fb6 100644
--- a/assembly/pom.xml
+++ b/assembly/pom.xml
@@ -24,7 +24,7 @@
 
 org.apache.sshd
 sshd
-1.3.0
+1.4.0-SNAPSHOT
 
 
 apache-sshd

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/389a1ecb/pom.xml
--
diff --git a/pom.xml b/pom.xml
index 5e7b8d4..313fbe5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
 
 org.apache.sshd
 sshd
-1.3.0
+1.4.0-SNAPSHOT
 Apache Mina SSHD
 pom
 2008
@@ -76,7 +76,7 @@
 
scm:git:http://git-wip-us.apache.org/repos/asf/mina-sshd.git
 
scm:git:http://git-wip-us.apache.org/repos/asf/mina-sshd.git
 https://git-wip-us.apache.org/repos/asf?p=mina-sshd.git
-sshd-1.3.0
+HEAD
 
 
 

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/389a1ecb/sshd-contrib/pom.xml
--
diff --git a/sshd-contrib/pom.xml b/sshd-contrib/pom.xml
index 36bbcf4..09bf160 100644
--- a/sshd-contrib/pom.xml
+++ b/sshd-contrib/pom.xml
@@ -24,7 +24,7 @@
 
 org.apache.sshd
 sshd
-1.3.0
+1.4.0-SNAPSHOT
 
 
 

mina-sshd git commit: Fix OSGi imports

2016-11-24 Thread gnodet
Repository: mina-sshd
Updated Branches:
  refs/heads/master cbcda01c3 -> d13c67944


Fix OSGi imports

Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/d13c6794
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/d13c6794
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/d13c6794

Branch: refs/heads/master
Commit: d13c6794473e27ed2c98f3e749b1def458dd3b88
Parents: cbcda01
Author: Guillaume Nodet 
Authored: Thu Nov 24 17:04:21 2016 +0100
Committer: Guillaume Nodet 
Committed: Thu Nov 24 17:04:21 2016 +0100

--
 pom.xml | 5 +
 1 file changed, 5 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/d13c6794/pom.xml
--
diff --git a/pom.xml b/pom.xml
index 01017c2..a40586f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -730,6 +730,11 @@
 
 manifest
 
+
+
+
*;-noimport:=true
+
+
 
 
 



mina-sshd git commit: [SSHD-716] SSHD Reuse of client session for multiple channel connections fails

2016-11-22 Thread gnodet
Repository: mina-sshd
Updated Branches:
  refs/heads/master 3a6aff31f -> cbcda01c3


[SSHD-716] SSHD Reuse of client session for multiple channel connections fails

Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/cbcda01c
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/cbcda01c
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/cbcda01c

Branch: refs/heads/master
Commit: cbcda01c336c0523e5e13254a10262ce30941ea3
Parents: 3a6aff3
Author: Guillaume Nodet 
Authored: Tue Nov 22 19:21:36 2016 +0100
Committer: Guillaume Nodet 
Committed: Tue Nov 22 19:21:36 2016 +0100

--
 .../session/helpers/AbstractConnectionService.java   | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/cbcda01c/sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractConnectionService.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractConnectionService.java
 
b/sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractConnectionService.java
index 60f98e8..eff3b5d 100644
--- 
a/sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractConnectionService.java
+++ 
b/sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractConnectionService.java
@@ -463,8 +463,15 @@ public abstract class AbstractConnectionService
  * @throws IOException if an error occurs
  */
 public void channelClose(Buffer buffer) throws IOException {
-Channel channel = getChannel(buffer);
-channel.handleClose();
+// Do not use getChannel to avoid the session being closed
+// if receiving the SSH_MSG_CHANNEL_CLOSE on an already closed channel
+int recipient = buffer.getInt();
+Channel channel = channels.get(recipient);
+if (channel != null) {
+channel.handleClose();
+} else {
+log.warn("Received SSH_MSG_CHANNEL_CLOSE on unknown channel " + 
recipient);
+}
 }
 
 /**



[1/3] mina-sshd git commit: Revert "[SSHD-727] Upgrade used EdDSA artifact version to 1.1"

2017-03-28 Thread gnodet
Repository: mina-sshd
Updated Branches:
  refs/heads/master be51bdc8a -> a1cb02b41


Revert "[SSHD-727] Upgrade used EdDSA artifact version to 1.1"

This reverts commit cbb92d2a89600ee8a34abdf7d84cdc08291dcbf5.


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/31486673
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/31486673
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/31486673

Branch: refs/heads/master
Commit: 3148667309bf37b98714fc87ec20cc089bb4a30a
Parents: be51bdc
Author: Guillaume Nodet 
Authored: Tue Mar 28 11:59:07 2017 +0200
Committer: Guillaume Nodet 
Committed: Tue Mar 28 11:59:07 2017 +0200

--
 pom.xml |   6 +-
 .../common/util/security/SecurityUtils.java |  31 ++-
 .../security/eddsa/EdDSASecurityProvider.java   | 205 +++
 .../eddsa/EdDSASecurityProviderRegistrar.java   |   2 +-
 .../eddsa/EdDSASecurityProviderUtils.java   | 197 --
 .../OpenSSHEd25519PrivateKeyEntryDecoder.java   |   2 +-
 .../common/signature/SignaturesDevelopment.java |   6 +-
 .../util/security/eddsa/Ed25519VectorsTest.java |  12 +-
 .../EdDSASecurityProviderRegistrarTest.java |   2 -
 9 files changed, 234 insertions(+), 229 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/31486673/pom.xml
--
diff --git a/pom.xml b/pom.xml
index 06ec711..806f7fb 100644
--- a/pom.xml
+++ b/pom.xml
@@ -104,7 +104,7 @@
 2.0
 2
 4
-9
+8
 2.0
 
${groovy.major.version}.${groovy.minor.version}.${groovy.release.version}

 
@@ -202,7 +202,7 @@
 
 net.i2p.crypto
 eddsa
-0.1.1
+0.1.0
 
 
 
@@ -594,7 +594,7 @@
 
 com.puppycrawl.tools
 checkstyle
-7.6
+7.5.1
 
 
 

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/31486673/sshd-core/src/main/java/org/apache/sshd/common/util/security/SecurityUtils.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/common/util/security/SecurityUtils.java
 
b/sshd-core/src/main/java/org/apache/sshd/common/util/security/SecurityUtils.java
index b86bcc3..6aff088 100644
--- 
a/sshd-core/src/main/java/org/apache/sshd/common/util/security/SecurityUtils.java
+++ 
b/sshd-core/src/main/java/org/apache/sshd/common/util/security/SecurityUtils.java
@@ -73,7 +73,7 @@ import org.apache.sshd.common.util.buffer.Buffer;
 import 
org.apache.sshd.common.util.security.bouncycastle.BouncyCastleGeneratorHostKeyProvider;
 import 
org.apache.sshd.common.util.security.bouncycastle.BouncyCastleKeyPairResourceParser;
 import 
org.apache.sshd.common.util.security.bouncycastle.BouncyCastleRandomFactory;
-import org.apache.sshd.common.util.security.eddsa.EdDSASecurityProviderUtils;
+import org.apache.sshd.common.util.security.eddsa.EdDSASecurityProvider;
 import org.apache.sshd.common.util.threads.ThreadUtils;
 import org.apache.sshd.server.keyprovider.AbstractGeneratorHostKeyProvider;
 import org.slf4j.Logger;
@@ -91,13 +91,12 @@ public final class SecurityUtils {
 public static final String BOUNCY_CASTLE = "BC";
 
 /**
- * EDDSA support - should match {@code EdDSAKey.KEY_ALGORITHM}
+ * EDDSA support
  */
 public static final String EDDSA = "EdDSA";
 
 // A copy-paste from the original, but we don't want to drag the classes 
into the classpath
-// See EdDSANamedCurveTable.CURVE_ED25519_SHA512
-public static final String CURVE_ED25519_SHA512 = "SHA512withEd25519";
+public static final String CURVE_ED25519_SHA512 = "ed25519-sha-512";
 
 /**
  * System property used to configure the value for the maximum supported 
Diffie-Hellman
@@ -539,7 +538,7 @@ public final class SecurityUtils {
 throw new UnsupportedOperationException(EDDSA + " provider N/A");
 }
 
-return EdDSASecurityProviderUtils.getEDDSAPublicKeyEntryDecoder();
+return EdDSASecurityProvider.getEDDSAPublicKeyEntryDecoder();
 }
 
 public static PrivateKeyEntryDecoder getOpenSSHEDDSAPrivateKeyEntryDecoder() {
@@ -547,35 +546,35 @@ public final class SecurityUtils {
 throw new UnsupportedOperationException(EDDSA + " provider N/A");
 }
 
-return 
EdDSASecurityProviderUtils.getOpenSSHEDDSAPrivateKeyEntryDecoder();
+return 

[2/3] mina-sshd git commit: [SSHD-732] Fixed BuiltinClientIdentitiesWatcherTest in view

2017-03-28 Thread gnodet
[SSHD-732] Fixed BuiltinClientIdentitiesWatcherTest in view


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/6ecd949a
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/6ecd949a
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/6ecd949a

Branch: refs/heads/master
Commit: 6ecd949a9d855feee2f1d2231b7c002d1df7f4cb
Parents: 3148667
Author: Lyor Goldstein 
Authored: Tue Mar 21 06:49:16 2017 +0200
Committer: Guillaume Nodet 
Committed: Tue Mar 28 11:59:15 2017 +0200

--
 .../client/config/keys/ClientIdentitiesWatcher.java | 12 +---
 .../config/keys/BuiltinClientIdentitiesWatcherTest.java |  7 ++-
 2 files changed, 15 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/6ecd949a/sshd-core/src/main/java/org/apache/sshd/client/config/keys/ClientIdentitiesWatcher.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/client/config/keys/ClientIdentitiesWatcher.java
 
b/sshd-core/src/main/java/org/apache/sshd/client/config/keys/ClientIdentitiesWatcher.java
index 6c2bb0b..094766f 100644
--- 
a/sshd-core/src/main/java/org/apache/sshd/client/config/keys/ClientIdentitiesWatcher.java
+++ 
b/sshd-core/src/main/java/org/apache/sshd/client/config/keys/ClientIdentitiesWatcher.java
@@ -76,7 +76,7 @@ public class ClientIdentitiesWatcher extends 
AbstractKeyPairProvider implements
 return loadKeys(null);
 }
 
-protected Iterable loadKeys(Predicate filter) {
+protected Iterable loadKeys(Predicate filter) {
 return () -> {
 Stream stream = safeMap(GenericUtils.stream(providers), 
this::doGetKeyPair);
 if (filter != null) {
@@ -89,14 +89,20 @@ public class ClientIdentitiesWatcher extends 
AbstractKeyPairProvider implements
 /**
  * Performs a mapping operation on the stream, discarding any null values
  * returned by the mapper.
+ *
+ * @param  Original type
+ * @param  Mapped type
+ * @param stream Original values stream
+ * @param mapper Mapper to target type
+ * @return Mapped stream
  */
-private  Stream safeMap(Stream stream, Function mapper) {
+protected  Stream safeMap(Stream stream, Function mapper) {
 return stream.map(u -> Optional.ofNullable(mapper.apply(u)))
 .filter(Optional::isPresent)
 .map(Optional::get);
 }
 
-private KeyPair doGetKeyPair(ClientIdentityProvider p) {
+protected KeyPair doGetKeyPair(ClientIdentityProvider p) {
 try {
 KeyPair kp = p.getClientIdentity();
 if (kp == null) {

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/6ecd949a/sshd-core/src/test/java/org/apache/sshd/client/config/keys/BuiltinClientIdentitiesWatcherTest.java
--
diff --git 
a/sshd-core/src/test/java/org/apache/sshd/client/config/keys/BuiltinClientIdentitiesWatcherTest.java
 
b/sshd-core/src/test/java/org/apache/sshd/client/config/keys/BuiltinClientIdentitiesWatcherTest.java
index 9599684..70cc197 100644
--- 
a/sshd-core/src/test/java/org/apache/sshd/client/config/keys/BuiltinClientIdentitiesWatcherTest.java
+++ 
b/sshd-core/src/test/java/org/apache/sshd/client/config/keys/BuiltinClientIdentitiesWatcherTest.java
@@ -28,6 +28,7 @@ import java.nio.file.Path;
 import java.nio.file.StandardOpenOption;
 import java.security.GeneralSecurityException;
 import java.security.KeyPair;
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Date;
 import java.util.EnumMap;
@@ -141,7 +142,11 @@ public class BuiltinClientIdentitiesWatcherTest extends 
BaseTestSupport {
 }
 
 private static void testMultipleFilesWatch(String phase, 
KeyIdentityProvider watcher, Collection expected) {
-Collection actual = (Collection) 
watcher.loadKeys();
+Iterable keys = watcher.loadKeys();
+Collection actual = new ArrayList<>();
+for (KeyPair kp : keys) {
+actual.add(kp);
+}
 assertEquals(phase + ": mismatched sizes", 
GenericUtils.size(expected), GenericUtils.size(actual));
 
 if (!GenericUtils.isEmpty(expected)) {



[2/3] mina-sshd git commit: [SSHD-740] Add default methods on PropertyResolver to actually do the property resolution

2017-04-12 Thread gnodet
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/d6bb25d6/sshd-core/src/main/java/org/apache/sshd/server/session/ServerUserAuthService.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/server/session/ServerUserAuthService.java
 
b/sshd-core/src/main/java/org/apache/sshd/server/session/ServerUserAuthService.java
index 46365b6..c33261e 100644
--- 
a/sshd-core/src/main/java/org/apache/sshd/server/session/ServerUserAuthService.java
+++ 
b/sshd-core/src/main/java/org/apache/sshd/server/session/ServerUserAuthService.java
@@ -85,7 +85,7 @@ public class ServerUserAuthService extends AbstractCloseable 
implements Service,
 Object phase = PropertyResolverUtils.getObject(s, 
ServerAuthenticationManager.WELCOME_BANNER_PHASE);
 phase = PropertyResolverUtils.toEnum(WelcomeBannerPhase.class, phase, 
true, WelcomeBannerPhase.VALUES);
 welcomePhase = (phase == null) ? 
ServerAuthenticationManager.DEFAULT_BANNER_PHASE : (WelcomeBannerPhase) phase;
-maxAuthRequests = PropertyResolverUtils.getIntProperty(s, 
ServerAuthenticationManager.MAX_AUTH_REQUESTS, 
ServerAuthenticationManager.DEFAULT_MAX_AUTH_REQUESTS);
+maxAuthRequests = 
s.getIntProperty(ServerAuthenticationManager.MAX_AUTH_REQUESTS, 
ServerAuthenticationManager.DEFAULT_MAX_AUTH_REQUESTS);
 
 List factories = 
ValidateUtils.checkNotNullAndNotEmpty(
 serverSession.getUserAuthFactories(), "No user auth factories 
for %s", s);
@@ -93,7 +93,7 @@ public class ServerUserAuthService extends AbstractCloseable 
implements Service,
 // Get authentication methods
 authMethods = new ArrayList<>();
 
-String mths = PropertyResolverUtils.getString(s, 
ServerAuthenticationManager.AUTH_METHODS);
+String mths = s.getString(ServerAuthenticationManager.AUTH_METHODS);
 if (GenericUtils.isEmpty(mths)) {
 for (NamedFactory uaf : factories) {
 authMethods.add(new 
ArrayList<>(Collections.singletonList(uaf.getName(;
@@ -272,7 +272,7 @@ public class ServerUserAuthService extends 
AbstractCloseable implements Service,
 }
 
 if (success) {
-Integer maxSessionCount = 
PropertyResolverUtils.getInteger(session, 
ServerFactoryManager.MAX_CONCURRENT_SESSIONS);
+Integer maxSessionCount = 
session.getInteger(ServerFactoryManager.MAX_CONCURRENT_SESSIONS);
 if (maxSessionCount != null) {
 int currentSessionCount = 
session.getActiveSessionCountForUser(username);
 if (currentSessionCount >= maxSessionCount) {
@@ -396,7 +396,7 @@ public class ServerUserAuthService extends 
AbstractCloseable implements Service,
 }
 
 protected String resolveWelcomeBanner(ServerSession session) throws 
IOException {
-Object bannerValue = PropertyResolverUtils.getObject(session, 
ServerAuthenticationManager.WELCOME_BANNER);
+Object bannerValue = 
session.getObject(ServerAuthenticationManager.WELCOME_BANNER);
 if (bannerValue == null) {
 return null;
 }

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/d6bb25d6/sshd-core/src/main/java/org/apache/sshd/server/shell/InvertedShellWrapper.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/server/shell/InvertedShellWrapper.java
 
b/sshd-core/src/main/java/org/apache/sshd/server/shell/InvertedShellWrapper.java
index 0bf2e27..bb24619 100644
--- 
a/sshd-core/src/main/java/org/apache/sshd/server/shell/InvertedShellWrapper.java
+++ 
b/sshd-core/src/main/java/org/apache/sshd/server/shell/InvertedShellWrapper.java
@@ -25,7 +25,6 @@ import java.util.Objects;
 import java.util.concurrent.Executor;
 import java.util.concurrent.ExecutorService;
 
-import org.apache.sshd.common.PropertyResolverUtils;
 import org.apache.sshd.common.RuntimeSshException;
 import org.apache.sshd.common.util.GenericUtils;
 import org.apache.sshd.common.util.ValidateUtils;
@@ -139,7 +138,7 @@ public class InvertedShellWrapper extends 
AbstractLoggingBean implements Command
 
 @Override
 public void setSession(ServerSession session) {
-pumpSleepTime = PropertyResolverUtils.getLongProperty(session, 
PUMP_SLEEP_TIME, DEFAULT_PUMP_SLEEP_TIME);
+pumpSleepTime = session.getLongProperty(PUMP_SLEEP_TIME, 
DEFAULT_PUMP_SLEEP_TIME);
 ValidateUtils.checkTrue(pumpSleepTime > 0L, "Invalid " + 
PUMP_SLEEP_TIME + ": %d", pumpSleepTime);
 shell.setSession(session);
 }

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/d6bb25d6/sshd-core/src/main/java/org/apache/sshd/server/subsystem/sftp/SftpSubsystem.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/server/subsystem/sftp/SftpSubsystem.java
 

[3/3] mina-sshd git commit: [SSHD-740] Add default methods on PropertyResolver to actually do the property resolution

2017-04-12 Thread gnodet
[SSHD-740] Add default methods on PropertyResolver to actually do the property 
resolution

Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/d6bb25d6
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/d6bb25d6
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/d6bb25d6

Branch: refs/heads/master
Commit: d6bb25d6ecabdc9876a2c49a7023c6d84eec41f3
Parents: 655e7db
Author: Guillaume Nodet 
Authored: Wed Apr 12 20:55:43 2017 +0200
Committer: Guillaume Nodet 
Committed: Wed Apr 12 21:18:49 2017 +0200

--
 .../sshd/agent/local/AgentServerProxy.java  |  5 ++-
 .../sshd/agent/local/ProxyAgentFactory.java |  3 +-
 .../sshd/agent/unix/AgentServerProxy.java   |  7 ++--
 .../sshd/agent/unix/ChannelAgentForwarding.java |  5 ++-
 .../sshd/agent/unix/UnixAgentFactory.java   |  3 +-
 .../java/org/apache/sshd/client/SshClient.java  |  4 +--
 .../keyboard/UserAuthKeyboardInteractive.java   |  7 ++--
 .../client/channel/AbstractClientChannel.java   |  2 +-
 .../apache/sshd/client/channel/ChannelExec.java |  3 +-
 .../sshd/client/channel/ChannelShell.java   |  3 +-
 .../sshd/client/channel/ChannelSubsystem.java   |  3 +-
 .../channel/PtyCapableChannelSession.java   |  3 +-
 .../sshd/client/scp/AbstractScpClient.java  |  5 ++-
 .../client/session/ClientConnectionService.java |  5 ++-
 .../client/session/ClientUserAuthService.java   |  3 +-
 .../subsystem/sftp/DefaultSftpClient.java   |  3 +-
 .../client/subsystem/sftp/SftpFileSystem.java   |  3 +-
 .../subsystem/sftp/SftpFileSystemProvider.java  | 14 
 .../subsystem/sftp/SftpRemotePathChannel.java   |  3 +-
 .../java/org/apache/sshd/common/Closeable.java  |  2 +-
 .../apache/sshd/common/PropertyResolver.java| 36 
 .../sshd/common/channel/AbstractChannel.java|  3 +-
 .../common/channel/ChannelOutputStream.java |  3 +-
 .../common/channel/ChannelPipedInputStream.java |  3 +-
 .../org/apache/sshd/common/channel/Window.java  | 27 ---
 .../common/forward/DefaultTcpipForwarder.java   |  3 +-
 .../common/helpers/AbstractFactoryManager.java  |  2 +-
 .../common/io/AbstractIoServiceFactory.java |  3 +-
 .../sshd/common/io/mina/MinaAcceptor.java   |  5 ++-
 .../apache/sshd/common/io/mina/MinaService.java |  5 ++-
 .../sshd/common/io/nio2/Nio2Acceptor.java   |  3 +-
 .../apache/sshd/common/io/nio2/Nio2Service.java |  3 +-
 .../apache/sshd/common/io/nio2/Nio2Session.java |  7 ++--
 .../helpers/AbstractConnectionService.java  |  3 +-
 .../common/session/helpers/AbstractSession.java | 22 ++--
 .../sshd/common/subsystem/sftp/SftpHelper.java  |  3 +-
 .../sshd/common/util/buffer/BufferUtils.java|  3 +-
 .../util/io/LoggingFilterOutputStream.java  |  3 +-
 .../security/SecurityProviderRegistrar.java |  4 +--
 .../BouncyCastleSecurityProviderRegistrar.java  |  5 ++-
 .../eddsa/EdDSASecurityProviderRegistrar.java   |  3 +-
 .../java/org/apache/sshd/server/SshServer.java  |  2 +-
 ...DefaultKeyboardInteractiveAuthenticator.java | 11 +++---
 .../server/channel/AbstractServerChannel.java   |  2 +-
 .../org/apache/sshd/server/kex/DHGEXServer.java |  3 +-
 .../sshd/server/session/ServerSessionImpl.java  |  3 +-
 .../server/session/ServerUserAuthService.java   |  8 ++---
 .../sshd/server/shell/InvertedShellWrapper.java |  3 +-
 .../server/subsystem/sftp/SftpSubsystem.java| 27 +++
 .../server/x11/DefaultX11ForwardSupport.java| 11 +++---
 .../subsystem/sftp/SftpFileSystemTest.java  |  3 +-
 .../sshd/common/channel/WindowInitTest.java |  3 +-
 .../sshd/common/channel/WindowTimeoutTest.java  |  5 +--
 .../sshd/git/transport/GitSshdSession.java  |  6 ++--
 54 files changed, 153 insertions(+), 169 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/d6bb25d6/sshd-core/src/main/java/org/apache/sshd/agent/local/AgentServerProxy.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/agent/local/AgentServerProxy.java 
b/sshd-core/src/main/java/org/apache/sshd/agent/local/AgentServerProxy.java
index 90e6b9d..24a34cd 100644
--- a/sshd-core/src/main/java/org/apache/sshd/agent/local/AgentServerProxy.java
+++ b/sshd-core/src/main/java/org/apache/sshd/agent/local/AgentServerProxy.java
@@ -25,7 +25,6 @@ import java.util.concurrent.atomic.AtomicBoolean;
 
 import org.apache.sshd.agent.SshAgent;
 import org.apache.sshd.agent.SshAgentServer;
-import org.apache.sshd.common.PropertyResolverUtils;
 import org.apache.sshd.common.session.ConnectionService;
 import org.apache.sshd.common.session.Session;
 import org.apache.sshd.common.util.logging.AbstractLoggingBean;
@@ -46,10 +45,10 @@ public class AgentServerProxy 

[1/3] mina-sshd git commit: [SSHD-739] A call to resolvePropertyValue can be very inefficient

2017-04-12 Thread gnodet
Repository: mina-sshd
Updated Branches:
  refs/heads/master 655e7dbd7 -> 87b87f7da


[SSHD-739] A call to resolvePropertyValue can be very inefficient

Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/87b87f7d
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/87b87f7d
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/87b87f7d

Branch: refs/heads/master
Commit: 87b87f7dad2f28b94e616688e4e5bb47dc75f459
Parents: d6bb25d
Author: Guillaume Nodet 
Authored: Wed Apr 12 21:17:32 2017 +0200
Committer: Guillaume Nodet 
Committed: Wed Apr 12 21:18:49 2017 +0200

--
 .../sshd/common/PropertyResolverUtils.java  | 22 ++--
 1 file changed, 11 insertions(+), 11 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/87b87f7d/sshd-core/src/main/java/org/apache/sshd/common/PropertyResolverUtils.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/common/PropertyResolverUtils.java 
b/sshd-core/src/main/java/org/apache/sshd/common/PropertyResolverUtils.java
index a4fc994..584668e 100644
--- a/sshd-core/src/main/java/org/apache/sshd/common/PropertyResolverUtils.java
+++ b/sshd-core/src/main/java/org/apache/sshd/common/PropertyResolverUtils.java
@@ -355,7 +355,7 @@ public final class PropertyResolverUtils {
 
 public static Object resolvePropertyValue(Map props, String 
name) {
 String key = ValidateUtils.checkNotNullAndNotEmpty(name, "No property 
name");
-return GenericUtils.isEmpty(props) ? null : props.get(key);
+return props != null ? props.get(key) : null;
 }
 
 /**
@@ -392,16 +392,14 @@ public final class PropertyResolverUtils {
 String key = ValidateUtils.checkNotNullAndNotEmpty(name, "No property 
name");
 for (PropertyResolver r = resolver; r != null; r = 
r.getParentPropertyResolver()) {
 Map props = r.getProperties();
-Object value = GenericUtils.isEmpty(props) ? null : props.get(key);
-if (value != null) {
-return value;
+if (props != null) {
+Object value = props.get(key);
+if (value != null) {
+return value;
+}
 }
 }
 
-if (key.startsWith("org.apache.sshd")) {
-return System.getProperty(key);
-}
-
 return null;
 }
 
@@ -417,9 +415,11 @@ public final class PropertyResolverUtils {
 String key = ValidateUtils.checkNotNullAndNotEmpty(name, "No property 
name");
 for (PropertyResolver r = resolver; r != null; r = 
r.getParentPropertyResolver()) {
 Map props = r.getProperties();
-Object value = GenericUtils.isEmpty(props) ? null : props.get(key);
-if (value != null) {
-return props;
+if (props != null) {
+Object value = props.get(key);
+if (value != null) {
+return props;
+}
 }
 }
 



[1/2] mina-sshd git commit: [SSHD-732] ClientIdentitiesWatcher should load keys one at a time

2017-03-10 Thread gnodet
Repository: mina-sshd
Updated Branches:
  refs/heads/master cbb92d2a8 -> be51bdc8a


[SSHD-732] ClientIdentitiesWatcher should load keys one at a time

Make sure iterators are lazy, i.e. they don't call hasNext() or next() unless 
actually required.  Use the Stream api in some cases to simplify the code.

Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/612218b7
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/612218b7
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/612218b7

Branch: refs/heads/master
Commit: 612218b7739435e2596fa47d010f3628d91569e4
Parents: cbb92d2
Author: Guillaume Nodet 
Authored: Fri Mar 10 11:58:37 2017 +0100
Committer: Guillaume Nodet 
Committed: Fri Mar 10 11:58:37 2017 +0100

--
 .../auth/hostbased/HostKeyIdentityProvider.java |  5 +-
 .../auth/pubkey/UserAuthPublicKeyIterator.java  | 36 
 .../keys/BuiltinClientIdentitiesWatcher.java| 38 -
 .../config/keys/ClientIdentitiesWatcher.java| 59 +---
 .../common/keyprovider/KeyIdentityProvider.java | 20 ++-
 .../apache/sshd/common/util/GenericUtils.java   | 45 +++
 6 files changed, 90 insertions(+), 113 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/612218b7/sshd-core/src/main/java/org/apache/sshd/client/auth/hostbased/HostKeyIdentityProvider.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/client/auth/hostbased/HostKeyIdentityProvider.java
 
b/sshd-core/src/main/java/org/apache/sshd/client/auth/hostbased/HostKeyIdentityProvider.java
index 62206a1..b141eb5 100644
--- 
a/sshd-core/src/main/java/org/apache/sshd/client/auth/hostbased/HostKeyIdentityProvider.java
+++ 
b/sshd-core/src/main/java/org/apache/sshd/client/auth/hostbased/HostKeyIdentityProvider.java
@@ -47,9 +47,6 @@ public interface HostKeyIdentityProvider {
 }
 
 static HostKeyIdentityProvider wrap(Iterable pairs) {
-return () -> () -> {
-Iterator iter = GenericUtils.iteratorOf(pairs);
-return GenericUtils.wrapIterator(iter, kp -> new Pair<>(kp, 
Collections.emptyList()));
-};
+return () -> GenericUtils.wrapIterable(pairs, kp -> new Pair<>(kp, 
Collections.emptyList()));
 }
 }

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/612218b7/sshd-core/src/main/java/org/apache/sshd/client/auth/pubkey/UserAuthPublicKeyIterator.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/client/auth/pubkey/UserAuthPublicKeyIterator.java
 
b/sshd-core/src/main/java/org/apache/sshd/client/auth/pubkey/UserAuthPublicKeyIterator.java
index 0ecb740..e1c7c86 100644
--- 
a/sshd-core/src/main/java/org/apache/sshd/client/auth/pubkey/UserAuthPublicKeyIterator.java
+++ 
b/sshd-core/src/main/java/org/apache/sshd/client/auth/pubkey/UserAuthPublicKeyIterator.java
@@ -27,6 +27,7 @@ import java.util.LinkedList;
 import java.util.NoSuchElementException;
 import java.util.Objects;
 import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.stream.Stream;
 
 import org.apache.sshd.agent.SshAgent;
 import org.apache.sshd.agent.SshAgentFactory;
@@ -42,22 +43,21 @@ import org.apache.sshd.common.util.GenericUtils;
 public class UserAuthPublicKeyIterator extends 
AbstractKeyPairIterator implements Channel {
 
 private final AtomicBoolean open = new AtomicBoolean(true);
-private final Iterator iterators;
 private Iterator current;
 private SshAgent agent;
 
 public UserAuthPublicKeyIterator(ClientSession session, 
SignatureFactoriesManager signatureFactories) throws Exception {
 super(session);
 
-Collection identities = new 
LinkedList<>();
-identities.add(new SessionKeyPairIterator(session, signatureFactories, 
KeyIdentityProvider.iteratorOf(session)));
+Collection identities = new 
LinkedList<>();
 
 FactoryManager manager = 
Objects.requireNonNull(session.getFactoryManager(), "No session factory 
manager");
 SshAgentFactory factory = manager.getAgentFactory();
 if (factory != null) {
 try {
 agent = Objects.requireNonNull(factory.createClient(manager), 
"No agent created");
-identities.add(new SshAgentPublicKeyIterator(session, agent));
+identities.add(agent.getIdentities().stream()
+.map(kp -> new KeyAgentIdentity(agent, kp.getFirst(), 
kp.getSecond(;
 } catch (Exception e) {
 try {
 closeAgent();
@@ -69,8 +69,12 @@ public class UserAuthPublicKeyIterator extends 
AbstractKeyPairIterator new 

[2/2] mina-sshd git commit: Fix the ssh/sshd distribution scripts

2017-03-10 Thread gnodet
Fix the ssh/sshd distribution scripts

Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/be51bdc8
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/be51bdc8
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/be51bdc8

Branch: refs/heads/master
Commit: be51bdc8af529060e6b4ac568884c07bed74b983
Parents: 612218b
Author: Guillaume Nodet 
Authored: Fri Mar 10 11:59:02 2017 +0100
Committer: Guillaume Nodet 
Committed: Fri Mar 10 11:59:02 2017 +0100

--
 assembly/src/main/distribution/bin/ssh.bat  | 2 +-
 assembly/src/main/distribution/bin/ssh.sh   | 2 +-
 assembly/src/main/distribution/bin/sshd.bat | 2 +-
 assembly/src/main/distribution/bin/sshd.sh  | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/be51bdc8/assembly/src/main/distribution/bin/ssh.bat
--
diff --git a/assembly/src/main/distribution/bin/ssh.bat 
b/assembly/src/main/distribution/bin/ssh.bat
index 57b9000..14b5b41 100644
--- a/assembly/src/main/distribution/bin/ssh.bat
+++ b/assembly/src/main/distribution/bin/ssh.bat
@@ -91,7 +91,7 @@ goto :EOF
 SET ARGS=%1 %2 %3 %4 %5 %6 %7 %8
 rem Execute the Java Virtual Machine
 cd %SSHD_HOME%
-"%JAVA%" %JAVA_OPTS% %OPTS% -classpath "%CLASSPATH%" -Dsshd.home="%SSHD_HOME%" 
org.apache.sshd.SshClient %ARGS%
+"%JAVA%" %JAVA_OPTS% %OPTS% -classpath "%CLASSPATH%" -Dsshd.home="%SSHD_HOME%" 
org.apache.sshd.client.SshClient %ARGS%
 
 rem # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
 

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/be51bdc8/assembly/src/main/distribution/bin/ssh.sh
--
diff --git a/assembly/src/main/distribution/bin/ssh.sh 
b/assembly/src/main/distribution/bin/ssh.sh
index ac58a55..3e29813 100644
--- a/assembly/src/main/distribution/bin/ssh.sh
+++ b/assembly/src/main/distribution/bin/ssh.sh
@@ -255,7 +255,7 @@ run() {
 CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
 fi
 cd $SSHD_BASE
-exec $JAVA $JAVA_OPTS -Dsshd.home="$SSHD_HOME" $OPTS -classpath 
"$CLASSPATH" org.apache.sshd.SshClient "$@"
+exec $JAVA $JAVA_OPTS -Dsshd.home="$SSHD_HOME" $OPTS -classpath 
"$CLASSPATH" org.apache.sshd.client.SshClient "$@"
 }
 
 main() {

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/be51bdc8/assembly/src/main/distribution/bin/sshd.bat
--
diff --git a/assembly/src/main/distribution/bin/sshd.bat 
b/assembly/src/main/distribution/bin/sshd.bat
index d7a5c0c..0863f7f 100644
--- a/assembly/src/main/distribution/bin/sshd.bat
+++ b/assembly/src/main/distribution/bin/sshd.bat
@@ -91,7 +91,7 @@ goto :EOF
 SET ARGS=%1 %2 %3 %4 %5 %6 %7 %8
 rem Execute the Java Virtual Machine
 cd %SSHD_HOME%
-"%JAVA%" %JAVA_OPTS% %OPTS% -classpath "%CLASSPATH%" -Dsshd.home="%SSHD_HOME%" 
org.apache.sshd.SshServer %ARGS%
+"%JAVA%" %JAVA_OPTS% %OPTS% -classpath "%CLASSPATH%" -Dsshd.home="%SSHD_HOME%" 
org.apache.sshd.server.SshServer %ARGS%
 
 rem # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
 

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/be51bdc8/assembly/src/main/distribution/bin/sshd.sh
--
diff --git a/assembly/src/main/distribution/bin/sshd.sh 
b/assembly/src/main/distribution/bin/sshd.sh
index da28516..d07e203 100644
--- a/assembly/src/main/distribution/bin/sshd.sh
+++ b/assembly/src/main/distribution/bin/sshd.sh
@@ -255,7 +255,7 @@ run() {
 CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
 fi
 cd $SSHD_BASE
-exec $JAVA $JAVA_OPTS -Dsshd.home="$SSHD_HOME" $OPTS -classpath 
"$CLASSPATH" org.apache.sshd.SshServer "$@"
+exec $JAVA $JAVA_OPTS -Dsshd.home="$SSHD_HOME" $OPTS -classpath 
"$CLASSPATH" org.apache.sshd.server.SshServer "$@"
 }
 
 main() {



mina-sshd git commit: [SSHD-760] Fixed some checkstyle issues

2017-08-03 Thread gnodet
Repository: mina-sshd
Updated Branches:
  refs/heads/master 072215ea8 -> 33555f14e


[SSHD-760] Fixed some checkstyle issues


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/33555f14
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/33555f14
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/33555f14

Branch: refs/heads/master
Commit: 33555f14e0b64d1ac5292bf6c89823237f42731b
Parents: 072215e
Author: Christian Schneider 
Authored: Thu Aug 3 10:19:53 2017 +0200
Committer: Christian Schneider 
Committed: Thu Aug 3 10:19:53 2017 +0200

--
 .../loader/pem/PKCS8PEMResourceKeyPairParser.java  |  1 -
 .../loader/pem/PemKeyPairResourceParserTest.java   | 17 +
 2 files changed, 9 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/33555f14/sshd-core/src/main/java/org/apache/sshd/common/config/keys/loader/pem/PKCS8PEMResourceKeyPairParser.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/common/config/keys/loader/pem/PKCS8PEMResourceKeyPairParser.java
 
b/sshd-core/src/main/java/org/apache/sshd/common/config/keys/loader/pem/PKCS8PEMResourceKeyPairParser.java
index cc28967..91a65b4 100644
--- 
a/sshd-core/src/main/java/org/apache/sshd/common/config/keys/loader/pem/PKCS8PEMResourceKeyPairParser.java
+++ 
b/sshd-core/src/main/java/org/apache/sshd/common/config/keys/loader/pem/PKCS8PEMResourceKeyPairParser.java
@@ -38,7 +38,6 @@ import org.apache.sshd.common.config.keys.KeyUtils;
 import org.apache.sshd.common.util.GenericUtils;
 import org.apache.sshd.common.util.ValidateUtils;
 import org.apache.sshd.common.util.io.IoUtils;
-import org.apache.sshd.common.util.io.NoCloseInputStream;
 import org.apache.sshd.common.util.io.der.ASN1Object;
 import org.apache.sshd.common.util.io.der.DERParser;
 import org.apache.sshd.common.util.security.SecurityUtils;

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/33555f14/sshd-core/src/test/java/org/apache/sshd/common/config/keys/loader/pem/PemKeyPairResourceParserTest.java
--
diff --git 
a/sshd-core/src/test/java/org/apache/sshd/common/config/keys/loader/pem/PemKeyPairResourceParserTest.java
 
b/sshd-core/src/test/java/org/apache/sshd/common/config/keys/loader/pem/PemKeyPairResourceParserTest.java
index 3cf60e0..ba5c6a9 100644
--- 
a/sshd-core/src/test/java/org/apache/sshd/common/config/keys/loader/pem/PemKeyPairResourceParserTest.java
+++ 
b/sshd-core/src/test/java/org/apache/sshd/common/config/keys/loader/pem/PemKeyPairResourceParserTest.java
@@ -18,11 +18,6 @@
  */
 package org.apache.sshd.common.config.keys.loader.pem;
 
-import org.apache.commons.ssl.PEMItem;
-import org.apache.commons.ssl.PEMUtil;
-import org.apache.sshd.common.util.security.SecurityUtils;
-import org.junit.Test;
-
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.security.KeyPair;
@@ -30,9 +25,15 @@ import java.security.KeyPairGenerator;
 import java.util.ArrayList;
 import java.util.Collection;
 
-import static org.junit.Assert.assertEquals;
+import org.apache.commons.ssl.PEMItem;
+import org.apache.commons.ssl.PEMUtil;
+import org.apache.sshd.common.util.security.SecurityUtils;
+import org.junit.Assert;
+import org.junit.Test;
 
 public class PemKeyPairResourceParserTest {
+public PemKeyPairResourceParserTest() {
+}
 
 @Test
 public void testPkcs8() throws Exception {
@@ -51,7 +52,7 @@ public class PemKeyPairResourceParserTest {
 
 KeyPair kp2 = SecurityUtils.loadKeyPairIdentity("the-key", new 
ByteArrayInputStream(os.toByteArray()), null);
 
-assertEquals(kp.getPublic(), kp2.getPublic());
-assertEquals(kp.getPrivate(), kp2.getPrivate());
+Assert.assertEquals(kp.getPublic(), kp2.getPublic());
+Assert.assertEquals(kp.getPrivate(), kp2.getPrivate());
 }
 }



mina-sshd git commit: [SSHD-760] Unable to read PKCS8 key files

2017-08-02 Thread gnodet
Repository: mina-sshd
Updated Branches:
  refs/heads/master 76988ba83 -> 072215ea8


[SSHD-760] Unable to read PKCS8 key files

Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/072215ea
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/072215ea
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/072215ea

Branch: refs/heads/master
Commit: 072215ea8981ccb66723a2a876633d96190adf8d
Parents: 76988ba
Author: Guillaume Nodet 
Authored: Wed Aug 2 14:57:16 2017 +0200
Committer: Guillaume Nodet 
Committed: Wed Aug 2 14:57:23 2017 +0200

--
 pom.xml |  5 ++
 sshd-core/pom.xml   |  5 ++
 .../pem/PKCS8PEMResourceKeyPairParser.java  |  6 +--
 .../pem/PemKeyPairResourceParserTest.java   | 57 
 4 files changed, 70 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/072215ea/pom.xml
--
diff --git a/pom.xml b/pom.xml
index ad4f298..296914d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -385,6 +385,11 @@
 org.eclipse.jgit.pgm
 ${jgit.version}
 
+
+org.apache.servicemix.bundles
+
org.apache.servicemix.bundles.not-yet-commons-ssl
+0.3.11_1
+
 
 
 

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/072215ea/sshd-core/pom.xml
--
diff --git a/sshd-core/pom.xml b/sshd-core/pom.xml
index 8174dd0..a27b588 100644
--- a/sshd-core/pom.xml
+++ b/sshd-core/pom.xml
@@ -117,6 +117,11 @@
 ganymed-ssh2
 test
 
+
+org.apache.servicemix.bundles
+
org.apache.servicemix.bundles.not-yet-commons-ssl
+test
+
 
 
 

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/072215ea/sshd-core/src/main/java/org/apache/sshd/common/config/keys/loader/pem/PKCS8PEMResourceKeyPairParser.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/common/config/keys/loader/pem/PKCS8PEMResourceKeyPairParser.java
 
b/sshd-core/src/main/java/org/apache/sshd/common/config/keys/loader/pem/PKCS8PEMResourceKeyPairParser.java
index a8b3075..cc28967 100644
--- 
a/sshd-core/src/main/java/org/apache/sshd/common/config/keys/loader/pem/PKCS8PEMResourceKeyPairParser.java
+++ 
b/sshd-core/src/main/java/org/apache/sshd/common/config/keys/loader/pem/PKCS8PEMResourceKeyPairParser.java
@@ -70,7 +70,7 @@ public class PKCS8PEMResourceKeyPairParser extends 
AbstractPEMResourceKeyPairPar
 throws IOException, GeneralSecurityException {
 // Save the data before getting the algorithm OID since we will need it
 byte[] encBytes = IoUtils.toByteArray(stream);
-List oidAlgorithm = getPKCS8AlgorithmIdentifier(stream, 
false);
+List oidAlgorithm = getPKCS8AlgorithmIdentifier(encBytes);
 PrivateKey prvKey = decodePEMPrivateKeyPKCS8(oidAlgorithm, encBytes, 
passwordProvider);
 PublicKey pubKey = 
ValidateUtils.checkNotNull(KeyUtils.recoverPublicKey(prvKey),
 "Failed to recover public key of OID=%s", oidAlgorithm);
@@ -101,8 +101,8 @@ public class PKCS8PEMResourceKeyPairParser extends 
AbstractPEMResourceKeyPairPar
 return factory.generatePrivate(keySpec);
 }
 
-public static List getPKCS8AlgorithmIdentifier(InputStream input, 
boolean okToClose) throws IOException {
-try (DERParser parser = new 
DERParser(NoCloseInputStream.resolveInputStream(input, okToClose))) {
+public static List getPKCS8AlgorithmIdentifier(byte[] input) 
throws IOException {
+try (DERParser parser = new DERParser(input)) {
 return getPKCS8AlgorithmIdentifier(parser);
 }
 }

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/072215ea/sshd-core/src/test/java/org/apache/sshd/common/config/keys/loader/pem/PemKeyPairResourceParserTest.java
--
diff --git 
a/sshd-core/src/test/java/org/apache/sshd/common/config/keys/loader/pem/PemKeyPairResourceParserTest.java
 
b/sshd-core/src/test/java/org/apache/sshd/common/config/keys/loader/pem/PemKeyPairResourceParserTest.java
new file mode 100644
index 000..3cf60e0
--- /dev/null
+++ 
b/sshd-core/src/test/java/org/apache/sshd/common/config/keys/loader/pem/PemKeyPairResourceParserTest.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work 

svn commit: r20300 - /release/mina/sshd/1.6.0/

2017-07-05 Thread gnodet
Author: gnodet
Date: Wed Jul  5 06:59:14 2017
New Revision: 20300

Log:
Add sshd 1.6.0 release

Added:
release/mina/sshd/1.6.0/
release/mina/sshd/1.6.0/apache-sshd-1.6.0-src.tar.gz   (with props)
release/mina/sshd/1.6.0/apache-sshd-1.6.0-src.tar.gz.asc
release/mina/sshd/1.6.0/apache-sshd-1.6.0-src.tar.gz.md5
release/mina/sshd/1.6.0/apache-sshd-1.6.0-src.tar.gz.sha1
release/mina/sshd/1.6.0/apache-sshd-1.6.0-src.zip   (with props)
release/mina/sshd/1.6.0/apache-sshd-1.6.0-src.zip.asc
release/mina/sshd/1.6.0/apache-sshd-1.6.0-src.zip.md5
release/mina/sshd/1.6.0/apache-sshd-1.6.0-src.zip.sha1
release/mina/sshd/1.6.0/apache-sshd-1.6.0.pom
release/mina/sshd/1.6.0/apache-sshd-1.6.0.pom.asc
release/mina/sshd/1.6.0/apache-sshd-1.6.0.pom.md5
release/mina/sshd/1.6.0/apache-sshd-1.6.0.pom.sha1
release/mina/sshd/1.6.0/apache-sshd-1.6.0.tar.gz   (with props)
release/mina/sshd/1.6.0/apache-sshd-1.6.0.tar.gz.asc
release/mina/sshd/1.6.0/apache-sshd-1.6.0.tar.gz.md5
release/mina/sshd/1.6.0/apache-sshd-1.6.0.tar.gz.sha1
release/mina/sshd/1.6.0/apache-sshd-1.6.0.zip   (with props)
release/mina/sshd/1.6.0/apache-sshd-1.6.0.zip.asc
release/mina/sshd/1.6.0/apache-sshd-1.6.0.zip.md5
release/mina/sshd/1.6.0/apache-sshd-1.6.0.zip.sha1

Added: release/mina/sshd/1.6.0/apache-sshd-1.6.0-src.tar.gz
==
Binary file - no diff available.

Propchange: release/mina/sshd/1.6.0/apache-sshd-1.6.0-src.tar.gz
--
svn:mime-type = application/octet-stream

Added: release/mina/sshd/1.6.0/apache-sshd-1.6.0-src.tar.gz.asc
==
--- release/mina/sshd/1.6.0/apache-sshd-1.6.0-src.tar.gz.asc (added)
+++ release/mina/sshd/1.6.0/apache-sshd-1.6.0-src.tar.gz.asc Wed Jul  5 
06:59:14 2017
@@ -0,0 +1,6 @@
+-BEGIN PGP SIGNATURE-
+
+iEYEABECAAYFAllUx4IACgkQ7N/qPLRJO5SAOACg66z5XfSLOVLdZXy9a6ADfqc0
+lpgAn0PjOcpwXlLAxNjmSGGj6WAz+LkS
+=IUKZ
+-END PGP SIGNATURE-

Added: release/mina/sshd/1.6.0/apache-sshd-1.6.0-src.tar.gz.md5
==
--- release/mina/sshd/1.6.0/apache-sshd-1.6.0-src.tar.gz.md5 (added)
+++ release/mina/sshd/1.6.0/apache-sshd-1.6.0-src.tar.gz.md5 Wed Jul  5 
06:59:14 2017
@@ -0,0 +1 @@
+1a1890c01beb4ea694a4ddf5ffb5914e
\ No newline at end of file

Added: release/mina/sshd/1.6.0/apache-sshd-1.6.0-src.tar.gz.sha1
==
--- release/mina/sshd/1.6.0/apache-sshd-1.6.0-src.tar.gz.sha1 (added)
+++ release/mina/sshd/1.6.0/apache-sshd-1.6.0-src.tar.gz.sha1 Wed Jul  5 
06:59:14 2017
@@ -0,0 +1 @@
+6c62759fa7fe48be95af342254005c762b4f1a2f
\ No newline at end of file

Added: release/mina/sshd/1.6.0/apache-sshd-1.6.0-src.zip
==
Binary file - no diff available.

Propchange: release/mina/sshd/1.6.0/apache-sshd-1.6.0-src.zip
--
svn:mime-type = application/octet-stream

Added: release/mina/sshd/1.6.0/apache-sshd-1.6.0-src.zip.asc
==
--- release/mina/sshd/1.6.0/apache-sshd-1.6.0-src.zip.asc (added)
+++ release/mina/sshd/1.6.0/apache-sshd-1.6.0-src.zip.asc Wed Jul  5 06:59:14 
2017
@@ -0,0 +1,6 @@
+-BEGIN PGP SIGNATURE-
+
+iEYEABECAAYFAllUx4IACgkQ7N/qPLRJO5RHNwCg7yhfbpVeD1DoqYV2iiXmREBo
+QFwAnA04OpL5kRmmbmDlfqX9c5+kEbLC
+=uUs7
+-END PGP SIGNATURE-

Added: release/mina/sshd/1.6.0/apache-sshd-1.6.0-src.zip.md5
==
--- release/mina/sshd/1.6.0/apache-sshd-1.6.0-src.zip.md5 (added)
+++ release/mina/sshd/1.6.0/apache-sshd-1.6.0-src.zip.md5 Wed Jul  5 06:59:14 
2017
@@ -0,0 +1 @@
+1b04d0d65a72548bc5ea7baa8c252a17
\ No newline at end of file

Added: release/mina/sshd/1.6.0/apache-sshd-1.6.0-src.zip.sha1
==
--- release/mina/sshd/1.6.0/apache-sshd-1.6.0-src.zip.sha1 (added)
+++ release/mina/sshd/1.6.0/apache-sshd-1.6.0-src.zip.sha1 Wed Jul  5 06:59:14 
2017
@@ -0,0 +1 @@
+49179db560f5414fe1561819981d493d56b6757a
\ No newline at end of file

Added: release/mina/sshd/1.6.0/apache-sshd-1.6.0.pom
==
--- release/mina/sshd/1.6.0/apache-sshd-1.6.0.pom (added)
+++ release/mina/sshd/1.6.0/apache-sshd-1.6.0.pom Wed Jul  5 06:59:14 2017
@@ -0,0 +1,126 @@
+http://maven.apache.org/POM/4.0.0; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd;>
+
+
+

svn commit: r1015002 - in /websites/production/mina/content: ./ mina-project/apidocs/ mina-project/testapidocs/ mina-project/xref-test/ mina-project/xref/ sshd-project/apidocs/

2017-07-05 Thread gnodet
Author: gnodet
Date: Wed Jul  5 07:46:36 2017
New Revision: 1015002

Log:
Update for SSHD 1.6.0 release

Added:
websites/production/mina/content/
  - copied from r1015001, websites/staging/mina/trunk/content/
websites/production/mina/content/mina-project/apidocs/
  - copied from r1015001, 
websites/production/mina/content/mina-project/apidocs/
websites/production/mina/content/mina-project/testapidocs/
  - copied from r1015001, 
websites/production/mina/content/mina-project/testapidocs/
websites/production/mina/content/mina-project/xref/
  - copied from r1015001, 
websites/production/mina/content/mina-project/xref/
websites/production/mina/content/mina-project/xref-test/
  - copied from r1015001, 
websites/production/mina/content/mina-project/xref-test/
websites/production/mina/content/sshd-project/apidocs/
  - copied from r1015001, 
websites/production/mina/content/sshd-project/apidocs/



mina-sshd git commit: [maven-release-plugin] prepare for next development iteration

2017-06-29 Thread gnodet
Repository: mina-sshd
Updated Branches:
  refs/heads/master ec07ea7f4 -> 701b53ca2


[maven-release-plugin] prepare for next development iteration


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/701b53ca
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/701b53ca
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/701b53ca

Branch: refs/heads/master
Commit: 701b53ca2a3ca8e762326e5157e91a56fadc257a
Parents: ec07ea7
Author: Guillaume Nodet 
Authored: Thu Jun 29 11:12:54 2017 +0200
Committer: Guillaume Nodet 
Committed: Thu Jun 29 11:12:54 2017 +0200

--
 assembly/pom.xml | 2 +-
 pom.xml  | 4 ++--
 sshd-contrib/pom.xml | 2 +-
 sshd-core/pom.xml| 2 +-
 sshd-git/pom.xml | 2 +-
 sshd-ldap/pom.xml| 2 +-
 sshd-spring-sftp/pom.xml | 2 +-
 7 files changed, 8 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/701b53ca/assembly/pom.xml
--
diff --git a/assembly/pom.xml b/assembly/pom.xml
index 3e8cec0..3f2715b 100644
--- a/assembly/pom.xml
+++ b/assembly/pom.xml
@@ -24,7 +24,7 @@
 
 org.apache.sshd
 sshd
-1.6.0
+1.7.0-SNAPSHOT
 
 
 apache-sshd

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/701b53ca/pom.xml
--
diff --git a/pom.xml b/pom.xml
index 848a8e0..f787a6a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
 
 org.apache.sshd
 sshd
-1.6.0
+1.7.0-SNAPSHOT
 Apache Mina SSHD
 pom
 2008
@@ -76,7 +76,7 @@
 
scm:git:http://git-wip-us.apache.org/repos/asf/mina-sshd.git
 
scm:git:http://git-wip-us.apache.org/repos/asf/mina-sshd.git
 https://git-wip-us.apache.org/repos/asf?p=mina-sshd.git
-sshd-1.6.0
+HEAD
 
 
 

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/701b53ca/sshd-contrib/pom.xml
--
diff --git a/sshd-contrib/pom.xml b/sshd-contrib/pom.xml
index 0cb1a8d..04be272 100644
--- a/sshd-contrib/pom.xml
+++ b/sshd-contrib/pom.xml
@@ -24,7 +24,7 @@
 
 org.apache.sshd
 sshd
-1.6.0
+1.7.0-SNAPSHOT
 
 
 

mina-sshd git commit: [maven-release-plugin] prepare release sshd-1.6.0

2017-06-29 Thread gnodet
Repository: mina-sshd
Updated Branches:
  refs/heads/master 270d91b14 -> ec07ea7f4


[maven-release-plugin] prepare release sshd-1.6.0


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/ec07ea7f
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/ec07ea7f
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/ec07ea7f

Branch: refs/heads/master
Commit: ec07ea7f4700ad8540960210ddb4e9bc120bb889
Parents: 270d91b
Author: Guillaume Nodet 
Authored: Thu Jun 29 11:12:36 2017 +0200
Committer: Guillaume Nodet 
Committed: Thu Jun 29 11:12:36 2017 +0200

--
 assembly/pom.xml | 2 +-
 pom.xml  | 4 ++--
 sshd-contrib/pom.xml | 2 +-
 sshd-core/pom.xml| 2 +-
 sshd-git/pom.xml | 2 +-
 sshd-ldap/pom.xml| 2 +-
 sshd-spring-sftp/pom.xml | 2 +-
 7 files changed, 8 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/ec07ea7f/assembly/pom.xml
--
diff --git a/assembly/pom.xml b/assembly/pom.xml
index f46cc24..3e8cec0 100644
--- a/assembly/pom.xml
+++ b/assembly/pom.xml
@@ -24,7 +24,7 @@
 
 org.apache.sshd
 sshd
-1.6.0-SNAPSHOT
+1.6.0
 
 
 apache-sshd

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/ec07ea7f/pom.xml
--
diff --git a/pom.xml b/pom.xml
index e420c3d..848a8e0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
 
 org.apache.sshd
 sshd
-1.6.0-SNAPSHOT
+1.6.0
 Apache Mina SSHD
 pom
 2008
@@ -76,7 +76,7 @@
 
scm:git:http://git-wip-us.apache.org/repos/asf/mina-sshd.git
 
scm:git:http://git-wip-us.apache.org/repos/asf/mina-sshd.git
 https://git-wip-us.apache.org/repos/asf?p=mina-sshd.git
-HEAD
+sshd-1.6.0
 
 
 

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/ec07ea7f/sshd-contrib/pom.xml
--
diff --git a/sshd-contrib/pom.xml b/sshd-contrib/pom.xml
index eedd97f..0cb1a8d 100644
--- a/sshd-contrib/pom.xml
+++ b/sshd-contrib/pom.xml
@@ -24,7 +24,7 @@
 
 org.apache.sshd
 sshd
-1.6.0-SNAPSHOT
+1.6.0
 
 
 

[mina-sshd] Git Push Summary

2017-06-29 Thread gnodet
Repository: mina-sshd
Updated Tags:  refs/tags/sshd-1.6.0 [created] c8105e635


mina-sshd git commit: [maven-release-plugin] prepare release sshd-1.5.0

2017-05-15 Thread gnodet
Repository: mina-sshd
Updated Branches:
  refs/heads/master 5b0b163c5 -> b958e2c73


[maven-release-plugin] prepare release sshd-1.5.0


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/b958e2c7
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/b958e2c7
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/b958e2c7

Branch: refs/heads/master
Commit: b958e2c737dfe6952dab9dc6d9ce50d5bd79432e
Parents: 5b0b163
Author: Guillaume Nodet 
Authored: Mon May 15 09:05:56 2017 +0200
Committer: Guillaume Nodet 
Committed: Mon May 15 09:05:56 2017 +0200

--
 assembly/pom.xml | 2 +-
 pom.xml  | 4 ++--
 sshd-contrib/pom.xml | 2 +-
 sshd-core/pom.xml| 2 +-
 sshd-git/pom.xml | 2 +-
 sshd-ldap/pom.xml| 2 +-
 6 files changed, 7 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/b958e2c7/assembly/pom.xml
--
diff --git a/assembly/pom.xml b/assembly/pom.xml
index db30f58..adfa903 100644
--- a/assembly/pom.xml
+++ b/assembly/pom.xml
@@ -24,7 +24,7 @@
 
 org.apache.sshd
 sshd
-1.5.0-SNAPSHOT
+1.5.0
 
 
 apache-sshd

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/b958e2c7/pom.xml
--
diff --git a/pom.xml b/pom.xml
index bc06820..cfd3959 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
 
 org.apache.sshd
 sshd
-1.5.0-SNAPSHOT
+1.5.0
 Apache Mina SSHD
 pom
 2008
@@ -76,7 +76,7 @@
 
scm:git:http://git-wip-us.apache.org/repos/asf/mina-sshd.git
 
scm:git:http://git-wip-us.apache.org/repos/asf/mina-sshd.git
 https://git-wip-us.apache.org/repos/asf?p=mina-sshd.git
-HEAD
+sshd-1.5.0
 
 
 

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/b958e2c7/sshd-contrib/pom.xml
--
diff --git a/sshd-contrib/pom.xml b/sshd-contrib/pom.xml
index e6feca2..6e61720 100644
--- a/sshd-contrib/pom.xml
+++ b/sshd-contrib/pom.xml
@@ -24,7 +24,7 @@
 
 org.apache.sshd
 sshd
-1.5.0-SNAPSHOT
+1.5.0
 
 
 

mina-sshd git commit: [maven-release-plugin] prepare for next development iteration

2017-05-15 Thread gnodet
Repository: mina-sshd
Updated Branches:
  refs/heads/master b958e2c73 -> 376d1aee5


[maven-release-plugin] prepare for next development iteration


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/376d1aee
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/376d1aee
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/376d1aee

Branch: refs/heads/master
Commit: 376d1aee51a2ff37c7904f8c646d031db6b89069
Parents: b958e2c
Author: Guillaume Nodet 
Authored: Mon May 15 09:06:15 2017 +0200
Committer: Guillaume Nodet 
Committed: Mon May 15 09:06:15 2017 +0200

--
 assembly/pom.xml | 2 +-
 pom.xml  | 4 ++--
 sshd-contrib/pom.xml | 2 +-
 sshd-core/pom.xml| 2 +-
 sshd-git/pom.xml | 2 +-
 sshd-ldap/pom.xml| 2 +-
 6 files changed, 7 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/376d1aee/assembly/pom.xml
--
diff --git a/assembly/pom.xml b/assembly/pom.xml
index adfa903..f46cc24 100644
--- a/assembly/pom.xml
+++ b/assembly/pom.xml
@@ -24,7 +24,7 @@
 
 org.apache.sshd
 sshd
-1.5.0
+1.6.0-SNAPSHOT
 
 
 apache-sshd

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/376d1aee/pom.xml
--
diff --git a/pom.xml b/pom.xml
index cfd3959..ab6d31c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
 
 org.apache.sshd
 sshd
-1.5.0
+1.6.0-SNAPSHOT
 Apache Mina SSHD
 pom
 2008
@@ -76,7 +76,7 @@
 
scm:git:http://git-wip-us.apache.org/repos/asf/mina-sshd.git
 
scm:git:http://git-wip-us.apache.org/repos/asf/mina-sshd.git
 https://git-wip-us.apache.org/repos/asf?p=mina-sshd.git
-sshd-1.5.0
+HEAD
 
 
 

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/376d1aee/sshd-contrib/pom.xml
--
diff --git a/sshd-contrib/pom.xml b/sshd-contrib/pom.xml
index 6e61720..eedd97f 100644
--- a/sshd-contrib/pom.xml
+++ b/sshd-contrib/pom.xml
@@ -24,7 +24,7 @@
 
 org.apache.sshd
 sshd
-1.5.0
+1.6.0-SNAPSHOT
 
 
 

[mina-sshd] Git Push Summary

2017-05-15 Thread gnodet
Repository: mina-sshd
Updated Tags:  refs/tags/sshd-1.5.0 [created] 360c23c53


mina-sshd git commit: Enhance legal files set up

2017-05-30 Thread gnodet
Repository: mina-sshd
Updated Branches:
  refs/heads/master 9dbe5fe08 -> b0c5ca22d


Enhance legal files set up

Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/b0c5ca22
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/b0c5ca22
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/b0c5ca22

Branch: refs/heads/master
Commit: b0c5ca22d413d67d5a857f3506eb840f58ae0a18
Parents: 9dbe5fe
Author: Guillaume Nodet 
Authored: Tue May 30 15:47:02 2017 +0200
Committer: Guillaume Nodet 
Committed: Tue May 30 15:47:02 2017 +0200

--
 LICENSE.bouncycastle.txt  |  18 ++
 LICENSE.slf4j.txt |  21 ++
 NOTICE-bin.txt|  16 ++
 NOTICE.txt|   5 +-
 assembly/src/main/descriptors/unix-bin.xml|  14 ++
 assembly/src/main/descriptors/windows-bin.xml |  17 ++
 assembly/src/main/distribution/LICENSE.txt| 251 -
 assembly/src/main/distribution/NOTICE.txt |   5 -
 pom.xml   |   2 +
 9 files changed, 92 insertions(+), 257 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/b0c5ca22/LICENSE.bouncycastle.txt
--
diff --git a/LICENSE.bouncycastle.txt b/LICENSE.bouncycastle.txt
new file mode 100644
index 000..35b0af6
--- /dev/null
+++ b/LICENSE.bouncycastle.txt
@@ -0,0 +1,18 @@
+Copyright (c) 2000 - 2017 The Legion Of The Bouncy Castle 
(http://www.bouncycastle.org)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in 
the
+Software without restriction, including without limitation the rights to use, 
copy,
+modify, merge, publish, distribute, sublicense, and/or sell copies of the 
Software,
+and to permit persons to whom the Software is furnished to do so, subject to 
the
+following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
IMPLIED,
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 
COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 
ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/b0c5ca22/LICENSE.slf4j.txt
--
diff --git a/LICENSE.slf4j.txt b/LICENSE.slf4j.txt
new file mode 100644
index 000..744377c
--- /dev/null
+++ b/LICENSE.slf4j.txt
@@ -0,0 +1,21 @@
+Copyright (c) 2004-2017 QOS.ch
+All rights reserved.
+
+Permission is hereby granted, free  of charge, to any person obtaining
+a  copy  of this  software  and  associated  documentation files  (the
+"Software"), to  deal in  the Software without  restriction, including
+without limitation  the rights to  use, copy, modify,  merge, publish,
+distribute,  sublicense, and/or sell  copies of  the Software,  and to
+permit persons to whom the Software  is furnished to do so, subject to
+the following conditions:
+
+The  above  copyright  notice  and  this permission  notice  shall  be
+included in all copies or substantial portions of the Software.
+
+THE  SOFTWARE IS  PROVIDED  "AS  IS", WITHOUT  WARRANTY  OF ANY  KIND,
+EXPRESS OR  IMPLIED, INCLUDING  BUT NOT LIMITED  TO THE  WARRANTIES OF
+MERCHANTABILITY,FITNESSFORA   PARTICULARPURPOSEAND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE,  ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/b0c5ca22/NOTICE-bin.txt
--
diff --git a/NOTICE-bin.txt b/NOTICE-bin.txt
new file mode 100644
index 000..df14b3f
--- /dev/null
+++ b/NOTICE-bin.txt
@@ -0,0 +1,16 @@
+Apache MINA SSHD
+Copyright 2008-2017 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+Please refer to each LICENSE..txt file for the
+license terms of the components that Apache MINA depends on.
+
+Message logging is provided by the SLF4J library package,
+which is open source software, written by Ceki Gülcü, 

mina-sshd git commit: [SSHD-737] "Invalid encoding: redundant leading 0s" when establishing session

2017-09-14 Thread gnodet
Repository: mina-sshd
Updated Branches:
  refs/heads/master 7ab52ddfd -> 0f6976447


[SSHD-737] "Invalid encoding: redundant leading 0s" when establishing session


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/0f697644
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/0f697644
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/0f697644

Branch: refs/heads/master
Commit: 0f6976447afad1ffb1f8f26bdaaa5169bf76770f
Parents: 7ab52dd
Author: Guillaume Nodet 
Authored: Wed Sep 13 13:19:58 2017 +0200
Committer: Guillaume Nodet 
Committed: Thu Sep 14 09:37:23 2017 +0200

--
 .../sshd/common/util/io/der/DERWriter.java  |  32 --
 .../sshd/common/signature/SignatureDSATest.java | 104 +++
 .../sshd/common/util/io/der/DERWriterTest.java  |  61 +++
 3 files changed, 190 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/0f697644/sshd-core/src/main/java/org/apache/sshd/common/util/io/der/DERWriter.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/common/util/io/der/DERWriter.java 
b/sshd-core/src/main/java/org/apache/sshd/common/util/io/der/DERWriter.java
index 870ea4a..2d55bfd 100644
--- a/sshd-core/src/main/java/org/apache/sshd/common/util/io/der/DERWriter.java
+++ b/sshd-core/src/main/java/org/apache/sshd/common/util/io/der/DERWriter.java
@@ -75,23 +75,41 @@ public class DERWriter extends FilterOutputStream {
 writeBigInteger(Objects.requireNonNull(value, "No 
value").toByteArray());
 }
 
+/**
+ * The integer is always considered to be positive, so if the first byte 
is < 0,
+ * we pad with a zero to make it positive
+ */
 public void writeBigInteger(byte... bytes) throws IOException {
 writeBigInteger(bytes, 0, NumberUtils.length(bytes));
 }
 
+/**
+ * The integer is always considered to be positive, so if the first byte 
is < 0,
+ * we pad with a zero to make it positive
+ */
 public void writeBigInteger(byte[] bytes, int off, int len) throws 
IOException {
-// ASN.1 - zero padding if 1st byte is > 0x7F
-int padLen = ((len > 0) && ((bytes[off] & 0x80) != 0)) ? 1 : 0;
-
-write(0x02);// indicate it is an INTEGER
-writeLength(len + padLen);
-for (int index = 0; index < padLen; index++) {
+// Strip leading zeroes
+while (len > 1 && bytes[off] == 0 && isPositive(bytes[off + 1])) {
+off++;
+len--;
+}
+// indicate it is an INTEGER
+write(0x02);
+// Pad with a zero if needed
+if (isPositive(bytes[off])) {
+writeLength(len);
+} else {
+writeLength(len + 1);
 write(0);
 }
-
+// Write data
 write(bytes, off, len);
 }
 
+private boolean isPositive(byte b) {
+return (b & 0x80) == 0;
+}
+
 
 public void writeObject(ASN1Object obj) throws IOException {
 Objects.requireNonNull(obj, "No ASN.1 object");

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/0f697644/sshd-core/src/test/java/org/apache/sshd/common/signature/SignatureDSATest.java
--
diff --git 
a/sshd-core/src/test/java/org/apache/sshd/common/signature/SignatureDSATest.java
 
b/sshd-core/src/test/java/org/apache/sshd/common/signature/SignatureDSATest.java
new file mode 100644
index 000..a5cfd37
--- /dev/null
+++ 
b/sshd-core/src/test/java/org/apache/sshd/common/signature/SignatureDSATest.java
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sshd.common.signature;
+
+import java.math.BigInteger;
+import java.security.GeneralSecurityException;
+import java.security.KeyFactory;
+import java.security.spec.DSAPublicKeySpec;
+
+import org.apache.sshd.common.config.keys.KeyUtils;
+import 

mina-sshd git commit: [SSHD-738] "BufferException: Underflow" warning is frequently reported [Forced Update!]

2017-10-25 Thread gnodet
Repository: mina-sshd
Updated Branches:
  refs/heads/master 046527707 -> fb4e1fdf0 (forced update)


[SSHD-738] "BufferException: Underflow" warning is frequently reported


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/fb4e1fdf
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/fb4e1fdf
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/fb4e1fdf

Branch: refs/heads/master
Commit: fb4e1fdf0aafbe39c054a13f08f414730d996cca
Parents: 4ea5f2b
Author: Guillaume Nodet 
Authored: Wed Oct 25 18:26:09 2017 +0200
Committer: Guillaume Nodet 
Committed: Wed Oct 25 18:30:38 2017 +0200

--
 .../apache/sshd/common/session/helpers/AbstractSession.java | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/fb4e1fdf/sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
 
b/sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
index e5f40ce..940b830 100644
--- 
a/sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
+++ 
b/sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
@@ -740,7 +740,14 @@ public abstract class AbstractSession extends 
AbstractKexFactoryManager implemen
 protected void handleDisconnect(Buffer buffer) throws Exception  {
 int code = buffer.getInt();
 String message = buffer.getString();
-String languageTag = buffer.getString();
+String languageTag;
+// SSHD-738: avoid spamming the log with uninteresting
+// messages caused by buggy OpenSSH < 5.5
+if (buffer.available() > 0) {
+languageTag = buffer.getString();
+} else {
+languageTag = "";
+}
 handleDisconnect(code, message, languageTag, buffer);
 }
 



mina-sshd git commit: [SSHD-738] "BufferException: Underflow" warning is frequently reported

2017-10-25 Thread gnodet
Repository: mina-sshd
Updated Branches:
  refs/heads/master 4ea5f2b8e -> c703a1f6c


[SSHD-738] "BufferException: Underflow" warning is frequently reported


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/c703a1f6
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/c703a1f6
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/c703a1f6

Branch: refs/heads/master
Commit: c703a1f6c2400c8cc954bd4c6762f69d1091a6f8
Parents: 4ea5f2b
Author: Guillaume Nodet 
Authored: Wed Oct 25 18:26:09 2017 +0200
Committer: Guillaume Nodet 
Committed: Wed Oct 25 18:26:09 2017 +0200

--
 .../sshd/common/session/helpers/AbstractSession.java | 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/c703a1f6/sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
 
b/sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
index e5f40ce..9e265c8 100644
--- 
a/sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
+++ 
b/sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
@@ -22,6 +22,7 @@ import java.io.IOException;
 import java.io.InterruptedIOException;
 import java.net.SocketAddress;
 import java.net.SocketTimeoutException;
+import java.nio.BufferOverflowException;
 import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -88,6 +89,7 @@ import org.apache.sshd.common.util.Pair;
 import org.apache.sshd.common.util.Readable;
 import org.apache.sshd.common.util.ValidateUtils;
 import org.apache.sshd.common.util.buffer.Buffer;
+import org.apache.sshd.common.util.buffer.BufferException;
 import org.apache.sshd.common.util.buffer.BufferUtils;
 import org.apache.sshd.common.util.buffer.ByteArrayBuffer;
 
@@ -740,7 +742,14 @@ public abstract class AbstractSession extends 
AbstractKexFactoryManager implemen
 protected void handleDisconnect(Buffer buffer) throws Exception  {
 int code = buffer.getInt();
 String message = buffer.getString();
-String languageTag = buffer.getString();
+String languageTag;
+// SSHD-738: avoid spamming the log with uninteresting
+// messages caused by buggy OpenSSH < 5.5
+if (buffer.available() > 0) {
+languageTag = buffer.getString();
+} else {
+languageTag = "";
+}
 handleDisconnect(code, message, languageTag, buffer);
 }
 



mina-sshd git commit: [SSHD-738] "BufferException: Underflow" warning is frequently reported [Forced Update!]

2017-10-25 Thread gnodet
Repository: mina-sshd
Updated Branches:
  refs/heads/master c703a1f6c -> 046527707 (forced update)


[SSHD-738] "BufferException: Underflow" warning is frequently reported


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/04652770
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/04652770
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/04652770

Branch: refs/heads/master
Commit: 04652770795ceaf19ba15cc7f4d236ec8f059950
Parents: 4ea5f2b
Author: Guillaume Nodet 
Authored: Wed Oct 25 18:26:09 2017 +0200
Committer: Guillaume Nodet 
Committed: Wed Oct 25 18:29:58 2017 +0200

--
 .../sshd/common/session/helpers/AbstractSession.java  | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/04652770/sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
 
b/sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
index e5f40ce..b2f9acd 100644
--- 
a/sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
+++ 
b/sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
@@ -88,6 +88,7 @@ import org.apache.sshd.common.util.Pair;
 import org.apache.sshd.common.util.Readable;
 import org.apache.sshd.common.util.ValidateUtils;
 import org.apache.sshd.common.util.buffer.Buffer;
+import org.apache.sshd.common.util.buffer.BufferException;
 import org.apache.sshd.common.util.buffer.BufferUtils;
 import org.apache.sshd.common.util.buffer.ByteArrayBuffer;
 
@@ -740,7 +741,14 @@ public abstract class AbstractSession extends 
AbstractKexFactoryManager implemen
 protected void handleDisconnect(Buffer buffer) throws Exception  {
 int code = buffer.getInt();
 String message = buffer.getString();
-String languageTag = buffer.getString();
+String languageTag;
+// SSHD-738: avoid spamming the log with uninteresting
+// messages caused by buggy OpenSSH < 5.5
+if (buffer.available() > 0) {
+languageTag = buffer.getString();
+} else {
+languageTag = "";
+}
 handleDisconnect(code, message, languageTag, buffer);
 }
 



mina-sshd git commit: [SSHD-825] Use the filesystem default dir as the sftp subsystem default dir

2018-05-25 Thread gnodet
Repository: mina-sshd
Updated Branches:
  refs/heads/master 51822113d -> b3d255464


[SSHD-825] Use the filesystem default dir as the sftp subsystem default dir


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/b3d25546
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/b3d25546
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/b3d25546

Branch: refs/heads/master
Commit: b3d255464d25adee580a6e0184d9d734dd3238cb
Parents: 5182211
Author: Guillaume Nodet 
Authored: Fri May 25 20:53:54 2018 +0200
Committer: Guillaume Nodet 
Committed: Fri May 25 20:53:54 2018 +0200

--
 .../apache/sshd/server/subsystem/sftp/SftpSubsystem.java| 9 ++---
 1 file changed, 2 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/b3d25546/sshd-sftp/src/main/java/org/apache/sshd/server/subsystem/sftp/SftpSubsystem.java
--
diff --git 
a/sshd-sftp/src/main/java/org/apache/sshd/server/subsystem/sftp/SftpSubsystem.java
 
b/sshd-sftp/src/main/java/org/apache/sshd/server/subsystem/sftp/SftpSubsystem.java
index 5b809a5..369d1b2 100644
--- 
a/sshd-sftp/src/main/java/org/apache/sshd/server/subsystem/sftp/SftpSubsystem.java
+++ 
b/sshd-sftp/src/main/java/org/apache/sshd/server/subsystem/sftp/SftpSubsystem.java
@@ -35,7 +35,6 @@ import java.nio.file.NotDirectoryException;
 import java.nio.file.Path;
 import java.util.Collection;
 import java.util.Comparator;
-import java.util.Iterator;
 import java.util.Map;
 import java.util.Objects;
 import java.util.TreeMap;
@@ -145,7 +144,7 @@ public class SftpSubsystem
 protected Future pendingFuture;
 protected byte[] workBuf = new byte[Math.max(DEFAULT_FILE_HANDLE_SIZE, 
Integer.BYTES)];
 protected FileSystem fileSystem = FileSystems.getDefault();
-protected Path defaultDir = 
fileSystem.getPath(System.getProperty("user.dir"));
+protected Path defaultDir = 
fileSystem.getPath("").toAbsolutePath().normalize();
 protected int version;
 
 protected ServerSession serverSession;
@@ -236,11 +235,7 @@ public class SftpSubsystem
 public void setFileSystem(FileSystem fileSystem) {
 if (fileSystem != this.fileSystem) {
 this.fileSystem = fileSystem;
-
-Iterable roots = 
Objects.requireNonNull(fileSystem.getRootDirectories(), "No root directories");
-Iterator available = 
Objects.requireNonNull(roots.iterator(), "No roots iterator");
-ValidateUtils.checkTrue(available.hasNext(), "No available root");
-this.defaultDir = available.next();
+this.defaultDir = 
fileSystem.getPath("").toAbsolutePath().normalize();
 }
 }
 



mina-sshd git commit: [SSHD-824] Do not use anonymous inner classes to initialize collections

2018-05-28 Thread gnodet
Repository: mina-sshd
Updated Branches:
  refs/heads/master a4f4e2811 -> 3c6bfab46


[SSHD-824] Do not use anonymous inner classes to initialize collections


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/3c6bfab4
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/3c6bfab4
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/3c6bfab4

Branch: refs/heads/master
Commit: 3c6bfab46d08e87b195d5d7f72cb940eeedda495
Parents: a4f4e28
Author: Guillaume Nodet 
Authored: Mon May 28 12:42:06 2018 +0200
Committer: Guillaume Nodet 
Committed: Mon May 28 12:42:06 2018 +0200

--
 .../config/keys/loader/putty/PuttyKeyUtils.java | 58 ++-
 .../sshd/agent/unix/UnixAgentFactory.java   | 37 --
 .../loader/PrivateKeyEncryptionContext.java | 21 ++
 .../apache/sshd/common/io/nio2/Nio2Service.java | 26 +++
 .../sshd/common/util/net/SshdSocketAddress.java | 32 ++--
 .../sshd/common/channel/WindowInitTest.java | 28 +++
 ...AuthorizedKeyEntryLoginOptionsParseTest.java | 78 +---
 .../pem/PKCS8PEMResourceKeyPairParserTest.java  | 25 ++-
 .../sshd/common/io/nio2/Nio2ServiceTest.java| 22 ++
 .../util/net/SshdSocketIpv6AddressTest.java | 21 ++
 ...SecurityProviderRegistrarCipherNameTest.java | 27 +++
 .../util/security/eddsa/Ed25519VectorsTest.java | 25 +++
 .../sshd/common/subsystem/sftp/SftpHelper.java  | 78 ++--
 13 files changed, 188 insertions(+), 290 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/3c6bfab4/sshd-contrib/src/main/java/org/apache/sshd/common/config/keys/loader/putty/PuttyKeyUtils.java
--
diff --git 
a/sshd-contrib/src/main/java/org/apache/sshd/common/config/keys/loader/putty/PuttyKeyUtils.java
 
b/sshd-contrib/src/main/java/org/apache/sshd/common/config/keys/loader/putty/PuttyKeyUtils.java
index ee2851b..e750ace 100644
--- 
a/sshd-contrib/src/main/java/org/apache/sshd/common/config/keys/loader/putty/PuttyKeyUtils.java
+++ 
b/sshd-contrib/src/main/java/org/apache/sshd/common/config/keys/loader/putty/PuttyKeyUtils.java
@@ -33,43 +33,33 @@ import org.apache.sshd.common.util.security.SecurityUtils;
  * @author mailto:d...@mina.apache.org;>Apache MINA SSHD Project
  */
 public final class PuttyKeyUtils {
-public static final List DEFAULT_PARSERS 
=
-Collections.unmodifiableList(new 
ArrayList() {
-// Not serializing it
-private static final long serialVersionUID = 1L;
+public static final List DEFAULT_PARSERS;
 
-{
-add(RSAPuttyKeyDecoder.INSTANCE);
-add(DSSPuttyKeyDecoder.INSTANCE);
+public static final NavigableMap 
BY_KEY_TYPE;
 
-if (SecurityUtils.isECCSupported()) {
-add(ECDSAPuttyKeyDecoder.INSTANCE);
-}
+public static final KeyPairResourceParser DEFAULT_INSTANCE;
 
-if (SecurityUtils.isEDDSACurveSupported()) {
-add(EdDSAPuttyKeyDecoder.INSTANCE);
-}
-}
-});
-
-public static final NavigableMap 
BY_KEY_TYPE =
-Collections.unmodifiableNavigableMap(
-new TreeMap(String.CASE_INSENSITIVE_ORDER) {
-// Not serializing it
-private static final long serialVersionUID = 1L;
-
-{
-for (PuttyKeyPairResourceParser p : 
DEFAULT_PARSERS) {
-Collection supported = 
p.getSupportedTypeNames();
-for (String k : supported) {
-put(k, p);
-}
-}
-}
-});
-
-public static final KeyPairResourceParser DEFAULT_INSTANCE =
-KeyPairResourceParser.aggregate(DEFAULT_PARSERS);
+static {
+List parsers = new ArrayList<>();
+parsers.add(RSAPuttyKeyDecoder.INSTANCE);
+parsers.add(DSSPuttyKeyDecoder.INSTANCE);
+if (SecurityUtils.isECCSupported()) {
+parsers.add(ECDSAPuttyKeyDecoder.INSTANCE);
+}
+if (SecurityUtils.isEDDSACurveSupported()) {
+parsers.add(EdDSAPuttyKeyDecoder.INSTANCE);
+}
+NavigableMap map = new 

mina-sshd git commit: [maven-release-plugin] prepare for next development iteration

2018-05-28 Thread gnodet
Repository: mina-sshd
Updated Branches:
  refs/heads/master 3d614500b -> d5a4e4c07


[maven-release-plugin] prepare for next development iteration


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/d5a4e4c0
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/d5a4e4c0
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/d5a4e4c0

Branch: refs/heads/master
Commit: d5a4e4c0735690da03626731f2ba47f996a0c998
Parents: 3d61450
Author: Guillaume Nodet 
Authored: Mon May 28 15:58:00 2018 +0200
Committer: Guillaume Nodet 
Committed: Mon May 28 15:58:00 2018 +0200

--
 assembly/pom.xml | 2 +-
 pom.xml  | 4 ++--
 sshd-cli/pom.xml | 2 +-
 sshd-contrib/pom.xml | 2 +-
 sshd-core/pom.xml| 2 +-
 sshd-git/pom.xml | 2 +-
 sshd-ldap/pom.xml| 2 +-
 sshd-mina/pom.xml| 2 +-
 sshd-netty/pom.xml   | 2 +-
 sshd-scp/pom.xml | 2 +-
 sshd-sftp/pom.xml| 2 +-
 sshd-spring-sftp/pom.xml | 2 +-
 12 files changed, 13 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/d5a4e4c0/assembly/pom.xml
--
diff --git a/assembly/pom.xml b/assembly/pom.xml
index 043f636..adce735 100644
--- a/assembly/pom.xml
+++ b/assembly/pom.xml
@@ -24,7 +24,7 @@
 
 org.apache.sshd
 sshd
-2.0.0
+2.0.1-SNAPSHOT
 
 
 apache-sshd

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/d5a4e4c0/pom.xml
--
diff --git a/pom.xml b/pom.xml
index 6b7ef54..8ece14f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
 
 org.apache.sshd
 sshd
-2.0.0
+2.0.1-SNAPSHOT
 Apache Mina SSHD
 pom
 2008
@@ -76,7 +76,7 @@
 
scm:git:http://git-wip-us.apache.org/repos/asf/mina-sshd.git
 
scm:git:http://git-wip-us.apache.org/repos/asf/mina-sshd.git
 https://git-wip-us.apache.org/repos/asf?p=mina-sshd.git
-sshd-2.0.0
+HEAD
 
 
 

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/d5a4e4c0/sshd-cli/pom.xml
--
diff --git a/sshd-cli/pom.xml b/sshd-cli/pom.xml
index bffeb9c..973b4a5 100644
--- a/sshd-cli/pom.xml
+++ b/sshd-cli/pom.xml
@@ -24,7 +24,7 @@
 
 org.apache.sshd
 sshd
-2.0.0
+2.0.1-SNAPSHOT
 
 
 sshd-cli

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/d5a4e4c0/sshd-contrib/pom.xml
--
diff --git a/sshd-contrib/pom.xml b/sshd-contrib/pom.xml
index f63d645..672069b 100644
--- a/sshd-contrib/pom.xml
+++ b/sshd-contrib/pom.xml
@@ -24,7 +24,7 @@
 
 org.apache.sshd
 sshd
-2.0.0
+2.0.1-SNAPSHOT
 
 
 

[4/4] mina-sshd git commit: [maven-release-plugin] prepare release sshd-2.0.0

2018-05-28 Thread gnodet
[maven-release-plugin] prepare release sshd-2.0.0


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/3d614500
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/3d614500
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/3d614500

Branch: refs/heads/master
Commit: 3d614500b27f2e587a38a59dff1aa56013672a99
Parents: e8b476c
Author: Guillaume Nodet 
Authored: Mon May 28 15:57:31 2018 +0200
Committer: Guillaume Nodet 
Committed: Mon May 28 15:57:31 2018 +0200

--
 assembly/pom.xml | 2 +-
 pom.xml  | 4 ++--
 sshd-cli/pom.xml | 2 +-
 sshd-contrib/pom.xml | 2 +-
 sshd-core/pom.xml| 2 +-
 sshd-git/pom.xml | 2 +-
 sshd-ldap/pom.xml| 2 +-
 sshd-mina/pom.xml| 2 +-
 sshd-netty/pom.xml   | 2 +-
 sshd-scp/pom.xml | 2 +-
 sshd-sftp/pom.xml| 2 +-
 sshd-spring-sftp/pom.xml | 2 +-
 12 files changed, 13 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/3d614500/assembly/pom.xml
--
diff --git a/assembly/pom.xml b/assembly/pom.xml
index 7b103e1..043f636 100644
--- a/assembly/pom.xml
+++ b/assembly/pom.xml
@@ -24,7 +24,7 @@
 
 org.apache.sshd
 sshd
-2.0.0-SNAPSHOT
+2.0.0
 
 
 apache-sshd

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/3d614500/pom.xml
--
diff --git a/pom.xml b/pom.xml
index f8d19cb..6b7ef54 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
 
 org.apache.sshd
 sshd
-2.0.0-SNAPSHOT
+2.0.0
 Apache Mina SSHD
 pom
 2008
@@ -76,7 +76,7 @@
 
scm:git:http://git-wip-us.apache.org/repos/asf/mina-sshd.git
 
scm:git:http://git-wip-us.apache.org/repos/asf/mina-sshd.git
 https://git-wip-us.apache.org/repos/asf?p=mina-sshd.git
-HEAD
+sshd-2.0.0
 
 
 

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/3d614500/sshd-cli/pom.xml
--
diff --git a/sshd-cli/pom.xml b/sshd-cli/pom.xml
index 6957d2d..bffeb9c 100644
--- a/sshd-cli/pom.xml
+++ b/sshd-cli/pom.xml
@@ -24,7 +24,7 @@
 
 org.apache.sshd
 sshd
-2.0.0-SNAPSHOT
+2.0.0
 
 
 sshd-cli

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/3d614500/sshd-contrib/pom.xml
--
diff --git a/sshd-contrib/pom.xml b/sshd-contrib/pom.xml
index f4e86f3..f63d645 100644
--- a/sshd-contrib/pom.xml
+++ b/sshd-contrib/pom.xml
@@ -24,7 +24,7 @@
 
 org.apache.sshd
 sshd
-2.0.0-SNAPSHOT
+2.0.0
 
 
 

[1/4] mina-sshd git commit: Fix some build warnings

2018-05-28 Thread gnodet
Repository: mina-sshd
Updated Branches:
  refs/heads/master 3c6bfab46 -> 3d614500b


Fix some build warnings


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/4da85a78
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/4da85a78
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/4da85a78

Branch: refs/heads/master
Commit: 4da85a7895e4a2a854388cfd1da8a5a7cac07822
Parents: 3c6bfab
Author: Guillaume Nodet 
Authored: Mon May 28 13:58:02 2018 +0200
Committer: Guillaume Nodet 
Committed: Mon May 28 13:58:02 2018 +0200

--
 pom.xml| 213 +++-
 sshd-core/pom.xml  |   1 +
 sshd-git/pom.xml   |   1 +
 sshd-mina/pom.xml  |   2 +
 sshd-netty/pom.xml |   2 +
 sshd-scp/pom.xml   |   1 +
 sshd-sftp/pom.xml  |   1 +
 7 files changed, 128 insertions(+), 93 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/4da85a78/pom.xml
--
diff --git a/pom.xml b/pom.xml
index 1198af7..0fef5e6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -94,6 +94,8 @@
 ${javac.source}
 1.10.3
 ${javac.source}
+2.21.0
+
3.0.0
 
 ${javac.source}
 ${javac.target}
@@ -133,6 +135,7 @@
 
 org.codehaus.mojo
 findbugs-maven-plugin
+3.0.5
 
 true
 false
@@ -182,6 +185,102 @@
  
 
 
+
+only-eclipse
+
+
+m2e.version
+
+
+
+
+
+
+
+org.eclipse.m2e
+lifecycle-mapping
+1.0.0
+
+
+
+
+
+
org.apache.maven.plugins
+
maven-dependency-plugin
+
[1.0,)
+
+copy
+
copy-dependencies
+
+
+
+
+
+
+
+
+
org.codehaus.gmaven
+
groovy-maven-plugin
+
[1.0,)
+
+compile
+execute
+testCompile
+
+
+
+
+
+
+
+
+
org.apache.rat
+
apache-rat-plugin
+
[0.1,)
+
+check
+
+
+
+
+
+
+
+
+
org.apache.maven.plugins
+
maven-checkstyle-plugin
+
[1.0,)
+
+check
+
+   

[mina-sshd] Git Push Summary

2018-05-28 Thread gnodet
Repository: mina-sshd
Updated Tags:  refs/tags/sshd-2.0.0 [created] 9522b0bd1


[2/4] mina-sshd git commit: Update copyright year

2018-05-28 Thread gnodet
Update copyright year


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/165b63f0
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/165b63f0
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/165b63f0

Branch: refs/heads/master
Commit: 165b63f046a6146975b3cb337e87b9a3bed8cddb
Parents: 4da85a7
Author: Guillaume Nodet 
Authored: Mon May 28 14:01:02 2018 +0200
Committer: Guillaume Nodet 
Committed: Mon May 28 14:01:02 2018 +0200

--
 NOTICE-bin.txt | 2 +-
 NOTICE.txt | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/165b63f0/NOTICE-bin.txt
--
diff --git a/NOTICE-bin.txt b/NOTICE-bin.txt
index df14b3f..ed34e30 100644
--- a/NOTICE-bin.txt
+++ b/NOTICE-bin.txt
@@ -1,5 +1,5 @@
 Apache MINA SSHD
-Copyright 2008-2017 The Apache Software Foundation
+Copyright 2008-2018 The Apache Software Foundation
 
 This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/165b63f0/NOTICE.txt
--
diff --git a/NOTICE.txt b/NOTICE.txt
index a3bc215..9b3ec4e 100644
--- a/NOTICE.txt
+++ b/NOTICE.txt
@@ -1,5 +1,5 @@
 Apache MINA SSHD
-Copyright 2008-2017 The Apache Software Foundation
+Copyright 2008-2018 The Apache Software Foundation
 
 This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).



[3/4] mina-sshd git commit: Fix javadoc generation

2018-05-28 Thread gnodet
Fix javadoc generation


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/e8b476c2
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/e8b476c2
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/e8b476c2

Branch: refs/heads/master
Commit: e8b476c25a6b7e19a3242772eb7e4dcd77986f8b
Parents: 165b63f
Author: Guillaume Nodet 
Authored: Mon May 28 15:39:35 2018 +0200
Committer: Guillaume Nodet 
Committed: Mon May 28 15:39:35 2018 +0200

--
 pom.xml  | 5 -
 sshd-cli/pom.xml | 3 ---
 sshd-contrib/pom.xml | 3 ---
 sshd-core/pom.xml| 7 ---
 4 files changed, 4 insertions(+), 14 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/e8b476c2/pom.xml
--
diff --git a/pom.xml b/pom.xml
index 0fef5e6..f8d19cb 100644
--- a/pom.xml
+++ b/pom.xml
@@ -548,6 +548,9 @@
 org.apache.maven.plugins
 maven-javadoc-plugin
 3.0.0
+
+-Xdoclint:none 
+
 
 
 org.codehaus.gmaven
@@ -993,7 +996,7 @@
 
 
 
-
+
 
 org.codehaus.mojo
 build-helper-maven-plugin

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/e8b476c2/sshd-cli/pom.xml
--
diff --git a/sshd-cli/pom.xml b/sshd-cli/pom.xml
index 0925da8..6957d2d 100644
--- a/sshd-cli/pom.xml
+++ b/sshd-cli/pom.xml
@@ -118,9 +118,6 @@
 
 org.apache.maven.plugins
 maven-javadoc-plugin
-
--Xdoclint:none
-
 
 
 

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/e8b476c2/sshd-contrib/pom.xml
--
diff --git a/sshd-contrib/pom.xml b/sshd-contrib/pom.xml
index f0ff459..f4e86f3 100644
--- a/sshd-contrib/pom.xml
+++ b/sshd-contrib/pom.xml
@@ -109,9 +109,6 @@
 
 org.apache.maven.plugins
 maven-javadoc-plugin
-
--Xdoclint:none
-
 
 
 

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/e8b476c2/sshd-core/pom.xml
--
diff --git a/sshd-core/pom.xml b/sshd-core/pom.xml
index 510c551..dacf490 100644
--- a/sshd-core/pom.xml
+++ b/sshd-core/pom.xml
@@ -165,13 +165,6 @@
 
 
 
-
-org.apache.maven.plugins
-maven-javadoc-plugin
-
--Xdoclint:none
-
-
 
 
 



[2/3] mina-sshd git commit: Small refactoring of the command implementations to extract common code

2018-05-28 Thread gnodet
Small refactoring of the command implementations to extract common code


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/a04f585d
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/a04f585d
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/a04f585d

Branch: refs/heads/master
Commit: a04f585d390a3b49c1a5ad86f74d132189065dea
Parents: d1c4f60
Author: Guillaume Nodet 
Authored: Mon May 28 09:30:59 2018 +0200
Committer: Guillaume Nodet 
Committed: Mon May 28 10:06:47 2018 +0200

--
 .../server/command/AbstractCommandSupport.java  |  78 --
 .../AbstractDelegatingCommandFactory.java   |  12 +-
 .../command/AbstractFileSystemCommand.java  |  69 +
 .../command/DelegatingCommandFactory.java   |  43 --
 .../sshd/client/session/ClientSessionTest.java  |  10 +-
 .../org/apache/sshd/git/AbstractGitCommand.java |  54 +--
 .../org/apache/sshd/server/scp/ScpCommand.java  | 146 ++-
 .../org/apache/sshd/client/scp/ScpTest.java |  23 +--
 8 files changed, 164 insertions(+), 271 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/a04f585d/sshd-core/src/main/java/org/apache/sshd/server/command/AbstractCommandSupport.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/server/command/AbstractCommandSupport.java
 
b/sshd-core/src/main/java/org/apache/sshd/server/command/AbstractCommandSupport.java
index 58cf034..e797456 100644
--- 
a/sshd-core/src/main/java/org/apache/sshd/server/command/AbstractCommandSupport.java
+++ 
b/sshd-core/src/main/java/org/apache/sshd/server/command/AbstractCommandSupport.java
@@ -26,12 +26,17 @@ import java.util.Collection;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Future;
 
+import org.apache.sshd.common.session.Session;
+import org.apache.sshd.common.session.SessionHolder;
 import org.apache.sshd.common.util.GenericUtils;
 import org.apache.sshd.common.util.logging.AbstractLoggingBean;
 import org.apache.sshd.common.util.threads.ExecutorServiceCarrier;
 import org.apache.sshd.common.util.threads.ThreadUtils;
 import org.apache.sshd.server.Environment;
 import org.apache.sshd.server.ExitCallback;
+import org.apache.sshd.server.SessionAware;
+import org.apache.sshd.server.session.ServerSession;
+import org.apache.sshd.server.session.ServerSessionHolder;
 
 /**
  * Provides a basic useful skeleton for {@link Command} executions
@@ -40,17 +45,20 @@ import org.apache.sshd.server.ExitCallback;
  */
 public abstract class AbstractCommandSupport
 extends AbstractLoggingBean
-implements Command, Runnable, ExitCallback, ExecutorServiceCarrier {
-private final String command;
-private InputStream in;
-private OutputStream out;
-private OutputStream err;
-private ExitCallback callback;
-private Environment environment;
-private Future cmdFuture;
-private ExecutorService executorService;
-private boolean shutdownOnExit;
-private boolean cbCalled;
+implements Command, Runnable, ExecutorServiceCarrier, SessionAware,
+SessionHolder, ServerSessionHolder {
+protected final String command;
+protected InputStream in;
+protected OutputStream out;
+protected OutputStream err;
+protected ExitCallback callback;
+protected Environment environment;
+protected Future cmdFuture;
+protected Thread cmdRunner;
+protected ExecutorService executorService;
+protected boolean shutdownOnExit;
+protected boolean cbCalled;
+protected ServerSession serverSession;
 
 protected AbstractCommandSupport(String command, ExecutorService 
executorService, boolean shutdownOnExit) {
 this.command = command;
@@ -70,6 +78,21 @@ public abstract class AbstractCommandSupport
 }
 
 @Override
+public Session getSession() {
+return getServerSession();
+}
+
+@Override
+public ServerSession getServerSession() {
+return serverSession;
+}
+
+@Override
+public void setSession(ServerSession session) {
+serverSession = session;
+}
+
+@Override
 public ExecutorService getExecutorService() {
 return executorService;
 }
@@ -126,24 +149,47 @@ public abstract class AbstractCommandSupport
 @Override
 public void start(Environment env) throws IOException {
 environment = env;
-ExecutorService executors = getExecutorService();
-cmdFuture = executors.submit(this);
+try {
+ExecutorService executors = getExecutorService();
+cmdFuture = executors.submit(() -> {
+cmdRunner = Thread.currentThread();
+

[3/3] mina-sshd git commit: [SSHD-449] SSH Exec channel with ClientChannel.Streaming.Async

2018-05-28 Thread gnodet
[SSHD-449] SSH Exec channel with ClientChannel.Streaming.Async


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/a4f4e281
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/a4f4e281
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/a4f4e281

Branch: refs/heads/master
Commit: a4f4e28112e83d2430f4431e9e07ebba07ddc484
Parents: a04f585
Author: Guillaume Nodet 
Authored: Mon May 28 10:38:10 2018 +0200
Committer: Guillaume Nodet 
Committed: Mon May 28 11:37:48 2018 +0200

--
 .../common/channel/ChannelAsyncInputStream.java | 13 +++-
 .../java/org/apache/sshd/client/ClientTest.java | 63 
 2 files changed, 75 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/a4f4e281/sshd-core/src/main/java/org/apache/sshd/common/channel/ChannelAsyncInputStream.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/common/channel/ChannelAsyncInputStream.java
 
b/sshd-core/src/main/java/org/apache/sshd/common/channel/ChannelAsyncInputStream.java
index e699540..e0c6c26 100644
--- 
a/sshd-core/src/main/java/org/apache/sshd/common/channel/ChannelAsyncInputStream.java
+++ 
b/sshd-core/src/main/java/org/apache/sshd/common/channel/ChannelAsyncInputStream.java
@@ -64,7 +64,18 @@ public class ChannelAsyncInputStream extends 
AbstractCloseable implements IoInpu
 public IoReadFuture read(Buffer buf) {
 IoReadFutureImpl future = new IoReadFutureImpl(readFutureId, buf);
 if (isClosing()) {
-future.setValue(new IOException("Closed"));
+synchronized (buffer) {
+if (pending != null) {
+throw new ReadPendingException("Previous pending read not 
handled");
+}
+if (buffer.available() > 0) {
+int nbRead = future.buffer.putBuffer(buffer, false);
+buffer.compact();
+future.setValue(nbRead);
+} else {
+future.setValue(new IOException("Closed"));
+}
+}
 } else {
 synchronized (buffer) {
 if (pending != null) {

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/a4f4e281/sshd-core/src/test/java/org/apache/sshd/client/ClientTest.java
--
diff --git a/sshd-core/src/test/java/org/apache/sshd/client/ClientTest.java 
b/sshd-core/src/test/java/org/apache/sshd/client/ClientTest.java
index 0026cc3..43d6d33 100644
--- a/sshd-core/src/test/java/org/apache/sshd/client/ClientTest.java
+++ b/sshd-core/src/test/java/org/apache/sshd/client/ClientTest.java
@@ -588,6 +588,69 @@ public class ClientTest extends BaseTestSupport {
 }
 
 @Test
+public void testExecAsyncClient() throws Exception {
+Logger log = LoggerFactory.getLogger(getClass());
+client.start();
+try (ClientSession session = createTestClientSession()) {
+final ByteArrayOutputStream baosOut = new ByteArrayOutputStream();
+final ByteArrayOutputStream baosErr = new ByteArrayOutputStream();
+
+final ChannelExec channel = session.createExecChannel("test");
+channel.setStreaming(ClientChannel.Streaming.Async);
+OpenFuture open = channel.open();
+
+Thread.sleep(100); // Removing this line will make the test succeed
+open.addListener(new SshFutureListener() {
+@Override
+public void operationComplete(OpenFuture future) {
+channel.getAsyncOut().read(new ByteArrayBuffer())
+.addListener(new SshFutureListener() 
{
+@Override
+public void operationComplete(IoReadFuture 
future) {
+try {
+future.verify();
+Buffer buffer = future.getBuffer();
+baosOut.write(buffer.array(), 
buffer.rpos(), buffer.available());
+buffer.rpos(buffer.rpos() + 
buffer.available());
+buffer.compact();
+
channel.getAsyncOut().read(buffer).addListener(this);
+} catch (IOException e) {
+if (!channel.isClosing()) {
+log.error("Error reading", e);
+channel.close(true);
+}
+

[1/3] mina-sshd git commit: [SSHD-819] Revert the fact that CommandFactory now extends NamedFactory

2018-05-28 Thread gnodet
Repository: mina-sshd
Updated Branches:
  refs/heads/master 1a0409ee8 -> a4f4e2811


[SSHD-819] Revert the fact that CommandFactory now extends NamedFactory


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/d1c4f608
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/d1c4f608
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/d1c4f608

Branch: refs/heads/master
Commit: d1c4f608c6dc5544eb76334eaa82e46808ec81b1
Parents: 1a0409e
Author: Guillaume Nodet 
Authored: Mon May 28 08:43:31 2018 +0200
Committer: Guillaume Nodet 
Committed: Mon May 28 08:52:27 2018 +0200

--
 .../apache/sshd/cli/server/SshFsMounter.java|   2 +-
 .../AbstractDelegatingCommandFactory.java   |   2 +-
 .../sshd/server/command/CommandFactory.java |   5 +-
 .../shell/ProcessShellCommandFactory.java   |   2 +-
 .../server/shell/UnknownCommandFactory.java |   2 +-
 .../sshd/client/channel/ChannelExecTest.java|  24 +---
 .../sshd/client/session/ClientSessionTest.java  |  98 +
 .../java/org/apache/sshd/server/ServerTest.java | 144 +++
 8 files changed, 96 insertions(+), 183 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/d1c4f608/sshd-cli/src/test/java/org/apache/sshd/cli/server/SshFsMounter.java
--
diff --git 
a/sshd-cli/src/test/java/org/apache/sshd/cli/server/SshFsMounter.java 
b/sshd-cli/src/test/java/org/apache/sshd/cli/server/SshFsMounter.java
index c270be7..4fe1d99 100644
--- a/sshd-cli/src/test/java/org/apache/sshd/cli/server/SshFsMounter.java
+++ b/sshd-cli/src/test/java/org/apache/sshd/cli/server/SshFsMounter.java
@@ -232,7 +232,7 @@ public final class SshFsMounter extends SshServerCliSupport 
{
 }
 
 @Override
-public String getName() {
+public String toString() {
 return "mounter";
 }
 

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/d1c4f608/sshd-core/src/main/java/org/apache/sshd/server/command/AbstractDelegatingCommandFactory.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/server/command/AbstractDelegatingCommandFactory.java
 
b/sshd-core/src/main/java/org/apache/sshd/server/command/AbstractDelegatingCommandFactory.java
index 3169958..e780c52 100644
--- 
a/sshd-core/src/main/java/org/apache/sshd/server/command/AbstractDelegatingCommandFactory.java
+++ 
b/sshd-core/src/main/java/org/apache/sshd/server/command/AbstractDelegatingCommandFactory.java
@@ -40,7 +40,7 @@ public abstract class AbstractDelegatingCommandFactory 
extends AbstractLoggingBe
 }
 
 @Override
-public String getName() {
+public String toString() {
 return name;
 }
 

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/d1c4f608/sshd-core/src/main/java/org/apache/sshd/server/command/CommandFactory.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/server/command/CommandFactory.java 
b/sshd-core/src/main/java/org/apache/sshd/server/command/CommandFactory.java
index aff407b..807add1 100644
--- a/sshd-core/src/main/java/org/apache/sshd/server/command/CommandFactory.java
+++ b/sshd-core/src/main/java/org/apache/sshd/server/command/CommandFactory.java
@@ -18,8 +18,6 @@
  */
 package org.apache.sshd.server.command;
 
-import org.apache.sshd.common.NamedResource;
-
 /**
  * A factory of commands.
  * Commands are executed on the server side when an "exec" channel is
@@ -27,7 +25,8 @@ import org.apache.sshd.common.NamedResource;
  *
  * @author mailto:d...@mina.apache.org;>Apache MINA SSHD Project
  */
-public interface CommandFactory extends NamedResource {
+@FunctionalInterface
+public interface CommandFactory {
 
 /**
  * Create a command with the given name.

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/d1c4f608/sshd-core/src/main/java/org/apache/sshd/server/shell/ProcessShellCommandFactory.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/server/shell/ProcessShellCommandFactory.java
 
b/sshd-core/src/main/java/org/apache/sshd/server/shell/ProcessShellCommandFactory.java
index af9af82..8c33b6f 100644
--- 
a/sshd-core/src/main/java/org/apache/sshd/server/shell/ProcessShellCommandFactory.java
+++ 
b/sshd-core/src/main/java/org/apache/sshd/server/shell/ProcessShellCommandFactory.java
@@ -38,7 +38,7 @@ public class ProcessShellCommandFactory implements 
CommandFactory {
 }
 
 @Override
-public String getName() {
+public String toString() {
 return FACTORY_NAME;
 }
 


mina-sshd git commit: [SSHD-781] Make sure the heart beat scheduled job is terminated and that exceptions are propagated to the client session

2017-10-27 Thread gnodet
Repository: mina-sshd
Updated Branches:
  refs/heads/master fb4e1fdf0 -> 093a979b6


[SSHD-781] Make sure the heart beat scheduled job is terminated and that 
exceptions are propagated to the client session


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/093a979b
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/093a979b
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/093a979b

Branch: refs/heads/master
Commit: 093a979b6b56b115045d567e7ae9529f99ce1e9f
Parents: fb4e1fd
Author: Guillaume Nodet 
Authored: Fri Oct 27 12:20:00 2017 +0200
Committer: Guillaume Nodet 
Committed: Fri Oct 27 12:20:00 2017 +0200

--
 .../client/session/ClientConnectionService.java | 35 +---
 1 file changed, 31 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/093a979b/sshd-core/src/main/java/org/apache/sshd/client/session/ClientConnectionService.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/client/session/ClientConnectionService.java
 
b/sshd-core/src/main/java/org/apache/sshd/client/session/ClientConnectionService.java
index 869f0d1..1743a8e 100644
--- 
a/sshd-core/src/main/java/org/apache/sshd/client/session/ClientConnectionService.java
+++ 
b/sshd-core/src/main/java/org/apache/sshd/client/session/ClientConnectionService.java
@@ -20,6 +20,7 @@ package org.apache.sshd.client.session;
 
 import java.io.IOException;
 import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledFuture;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.sshd.agent.common.AgentForwardSupport;
@@ -39,6 +40,9 @@ import org.apache.sshd.server.x11.X11ForwardSupport;
  * @author mailto:d...@mina.apache.org;>Apache MINA SSHD Project
  */
 public class ClientConnectionService extends 
AbstractConnectionService implements ClientSessionHolder 
{
+
+private ScheduledFuture heartBeat;
+
 public ClientConnectionService(AbstractClientSession s) throws 
SshException {
 super(s);
 }
@@ -57,19 +61,33 @@ public class ClientConnectionService extends 
AbstractConnectionService 0L) {
 FactoryManager manager = session.getFactoryManager();
 ScheduledExecutorService service = 
manager.getScheduledExecutorService();
-service.scheduleAtFixedRate(this::sendHeartBeat, interval, 
interval, TimeUnit.MILLISECONDS);
+heartBeat = service.scheduleAtFixedRate(this::sendHeartBeat, 
interval, interval, TimeUnit.MILLISECONDS);
 if (log.isDebugEnabled()) {
 log.debug("startHeartbeat - started at interval={}", interval);
 }
 }
 }
 
+protected synchronized void stopHeartBeat() {
+if (heartBeat != null) {
+heartBeat.cancel(true);
+heartBeat = null;
+}
+}
+
 /**
  * Sends a heartbeat message
  * @return The {@link IoWriteFuture} that can be used to wait for the
@@ -82,12 +100,14 @@ public class ClientConnectionService extends 
AbstractConnectionService

mina-sshd git commit: [maven-release-plugin] prepare release sshd-1.7.0

2018-01-11 Thread gnodet
Repository: mina-sshd
Updated Branches:
  refs/heads/master 8a43a5028 -> 98d2c3fb0


[maven-release-plugin] prepare release sshd-1.7.0


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/98d2c3fb
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/98d2c3fb
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/98d2c3fb

Branch: refs/heads/master
Commit: 98d2c3fb08199f0d62e209ad71ae69caa4401ce2
Parents: 8a43a50
Author: Guillaume Nodet 
Authored: Thu Jan 11 15:30:43 2018 +0100
Committer: Guillaume Nodet 
Committed: Thu Jan 11 15:30:43 2018 +0100

--
 assembly/pom.xml | 2 +-
 pom.xml  | 4 ++--
 sshd-contrib/pom.xml | 2 +-
 sshd-core/pom.xml| 2 +-
 sshd-git/pom.xml | 2 +-
 sshd-ldap/pom.xml| 2 +-
 sshd-spring-sftp/pom.xml | 2 +-
 7 files changed, 8 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/98d2c3fb/assembly/pom.xml
--
diff --git a/assembly/pom.xml b/assembly/pom.xml
index 3f2715b..75d3275 100644
--- a/assembly/pom.xml
+++ b/assembly/pom.xml
@@ -24,7 +24,7 @@
 
 org.apache.sshd
 sshd
-1.7.0-SNAPSHOT
+1.7.0
 
 
 apache-sshd

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/98d2c3fb/pom.xml
--
diff --git a/pom.xml b/pom.xml
index 863f965..31b7d72 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
 
 org.apache.sshd
 sshd
-1.7.0-SNAPSHOT
+1.7.0
 Apache Mina SSHD
 pom
 2008
@@ -76,7 +76,7 @@
 
scm:git:http://git-wip-us.apache.org/repos/asf/mina-sshd.git
 
scm:git:http://git-wip-us.apache.org/repos/asf/mina-sshd.git
 https://git-wip-us.apache.org/repos/asf?p=mina-sshd.git
-HEAD
+sshd-1.7.0
 
 
 

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/98d2c3fb/sshd-contrib/pom.xml
--
diff --git a/sshd-contrib/pom.xml b/sshd-contrib/pom.xml
index ac5660a..cae164e 100644
--- a/sshd-contrib/pom.xml
+++ b/sshd-contrib/pom.xml
@@ -24,7 +24,7 @@
 
 org.apache.sshd
 sshd
-1.7.0-SNAPSHOT
+1.7.0
 
 
 

mina-sshd git commit: [maven-release-plugin] prepare for next development iteration

2018-01-11 Thread gnodet
Repository: mina-sshd
Updated Branches:
  refs/heads/master 98d2c3fb0 -> 2237bfaae


[maven-release-plugin] prepare for next development iteration


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/2237bfaa
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/2237bfaa
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/2237bfaa

Branch: refs/heads/master
Commit: 2237bfaaeb37809bad1c3c1384de3302fab71104
Parents: 98d2c3f
Author: Guillaume Nodet 
Authored: Thu Jan 11 15:31:24 2018 +0100
Committer: Guillaume Nodet 
Committed: Thu Jan 11 15:31:24 2018 +0100

--
 assembly/pom.xml | 2 +-
 pom.xml  | 4 ++--
 sshd-contrib/pom.xml | 2 +-
 sshd-core/pom.xml| 2 +-
 sshd-git/pom.xml | 2 +-
 sshd-ldap/pom.xml| 2 +-
 sshd-spring-sftp/pom.xml | 2 +-
 7 files changed, 8 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/2237bfaa/assembly/pom.xml
--
diff --git a/assembly/pom.xml b/assembly/pom.xml
index 75d3275..6027f0e 100644
--- a/assembly/pom.xml
+++ b/assembly/pom.xml
@@ -24,7 +24,7 @@
 
 org.apache.sshd
 sshd
-1.7.0
+1.7.1-SNAPSHOT
 
 
 apache-sshd

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/2237bfaa/pom.xml
--
diff --git a/pom.xml b/pom.xml
index 31b7d72..b33a638 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
 
 org.apache.sshd
 sshd
-1.7.0
+1.7.1-SNAPSHOT
 Apache Mina SSHD
 pom
 2008
@@ -76,7 +76,7 @@
 
scm:git:http://git-wip-us.apache.org/repos/asf/mina-sshd.git
 
scm:git:http://git-wip-us.apache.org/repos/asf/mina-sshd.git
 https://git-wip-us.apache.org/repos/asf?p=mina-sshd.git
-sshd-1.7.0
+HEAD
 
 
 

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/2237bfaa/sshd-contrib/pom.xml
--
diff --git a/sshd-contrib/pom.xml b/sshd-contrib/pom.xml
index cae164e..0a557ed 100644
--- a/sshd-contrib/pom.xml
+++ b/sshd-contrib/pom.xml
@@ -24,7 +24,7 @@
 
 org.apache.sshd
 sshd
-1.7.0
+1.7.1-SNAPSHOT
 
 
 

[mina-sshd] Git Push Summary

2018-01-11 Thread gnodet
Repository: mina-sshd
Updated Tags:  refs/tags/sshd-1.7.0 [created] ca3612777


[mina-sshd] Git Push Summary

2018-01-11 Thread gnodet
Repository: mina-sshd
Updated Tags:  refs/tags/sshd-1.7.0 [deleted] ca3612777


mina-sshd git commit: [SSHD-793] Using more conservative session ID tracking mechanism [Forced Update!]

2018-01-11 Thread gnodet
Repository: mina-sshd
Updated Branches:
  refs/heads/master ea9f960cc -> 8aee2acf3 (forced update)


[SSHD-793] Using more conservative session ID tracking mechanism


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/8aee2acf
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/8aee2acf
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/8aee2acf

Branch: refs/heads/master
Commit: 8aee2acf315a64403b7dcf128a5fc8a5e8dfe39e
Parents: 8a43a50
Author: Lyor Goldstein 
Authored: Thu Jan 11 19:18:04 2018 +0200
Committer: Guillaume Nodet 
Committed: Thu Jan 11 18:24:10 2018 +0100

--
 .../apache/sshd/common/io/nio2/Nio2Acceptor.java| 16 ++--
 .../apache/sshd/common/io/nio2/Nio2Connector.java   | 16 +---
 .../org/apache/sshd/common/io/nio2/Nio2Service.java |  8 +++-
 3 files changed, 34 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/8aee2acf/sshd-core/src/main/java/org/apache/sshd/common/io/nio2/Nio2Acceptor.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/common/io/nio2/Nio2Acceptor.java 
b/sshd-core/src/main/java/org/apache/sshd/common/io/nio2/Nio2Acceptor.java
index c047f21..0427c80 100644
--- a/sshd-core/src/main/java/org/apache/sshd/common/io/nio2/Nio2Acceptor.java
+++ b/sshd-core/src/main/java/org/apache/sshd/common/io/nio2/Nio2Acceptor.java
@@ -183,14 +183,24 @@ public class Nio2Acceptor extends Nio2Service implements 
IoAcceptor {
 }
 
 Nio2Session session = null;
+Long sessionId = null;
 try {
 // Create a session
 IoHandler handler = getIoHandler();
 setSocketOptions(result);
 session = 
Objects.requireNonNull(createSession(Nio2Acceptor.this, address, result, 
handler), "No NIO2 session created");
+sessionId = session.getId();
 handler.sessionCreated(session);
-sessions.put(session.getId(), session);
-session.startReading();
+sessions.put(sessionId, session);
+if (session.isClosing()) {
+try {
+handler.sessionClosed(session);
+} finally {
+unmapSession(sessionId);
+}
+} else {
+session.startReading();
+}
 } catch (Throwable exc) {
 failed(exc, address);
 
@@ -205,6 +215,8 @@ public class Nio2Acceptor extends Nio2Service implements 
IoAcceptor {
  t);
 }
 }
+
+unmapSession(sessionId);
 }
 
 try {

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/8aee2acf/sshd-core/src/main/java/org/apache/sshd/common/io/nio2/Nio2Connector.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/common/io/nio2/Nio2Connector.java 
b/sshd-core/src/main/java/org/apache/sshd/common/io/nio2/Nio2Connector.java
index 68397b1..360f673 100644
--- a/sshd-core/src/main/java/org/apache/sshd/common/io/nio2/Nio2Connector.java
+++ b/sshd-core/src/main/java/org/apache/sshd/common/io/nio2/Nio2Connector.java
@@ -110,13 +110,22 @@ public class Nio2Connector extends Nio2Service implements 
IoConnector {
 @Override
 @SuppressWarnings("synthetic-access")
 protected void onCompleted(Void result, Object attachment) {
+Long sessionId = null;
 try {
 Nio2Session session = createSession(manager, handler, 
socket);
 handler.sessionCreated(session);
-long sessionId = session.getId();
+sessionId = session.getId();
 sessions.put(sessionId, session);
 future.setSession(session);
-session.startReading();
+if (session.isClosing()) {
+try {
+handler.sessionClosed(session);
+} finally {
+unmapSession(sessionId);
+}
+} else {
+session.startReading();
+}
 } catch (Throwable exc) {
 Throwable t = GenericUtils.peelException(exc);
 if (log.isDebugEnabled()) {
@@ -136,11 +145,12 @@ public class Nio2Connector extends Nio2Service implements 
IoConnector {
 }
 
 

mina-sshd git commit: [maven-release-plugin] prepare for next development iteration

2018-01-11 Thread gnodet
Repository: mina-sshd
Updated Branches:
  refs/heads/master 83925cb70 -> 100463f67


[maven-release-plugin] prepare for next development iteration


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/100463f6
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/100463f6
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/100463f6

Branch: refs/heads/master
Commit: 100463f67865408e97d68b467308acfe2f301f8a
Parents: 83925cb
Author: Guillaume Nodet 
Authored: Thu Jan 11 18:27:27 2018 +0100
Committer: Guillaume Nodet 
Committed: Thu Jan 11 18:27:27 2018 +0100

--
 assembly/pom.xml | 2 +-
 pom.xml  | 4 ++--
 sshd-contrib/pom.xml | 2 +-
 sshd-core/pom.xml| 2 +-
 sshd-git/pom.xml | 2 +-
 sshd-ldap/pom.xml| 2 +-
 sshd-spring-sftp/pom.xml | 2 +-
 7 files changed, 8 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/100463f6/assembly/pom.xml
--
diff --git a/assembly/pom.xml b/assembly/pom.xml
index 75d3275..6027f0e 100644
--- a/assembly/pom.xml
+++ b/assembly/pom.xml
@@ -24,7 +24,7 @@
 
 org.apache.sshd
 sshd
-1.7.0
+1.7.1-SNAPSHOT
 
 
 apache-sshd

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/100463f6/pom.xml
--
diff --git a/pom.xml b/pom.xml
index 31b7d72..b33a638 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
 
 org.apache.sshd
 sshd
-1.7.0
+1.7.1-SNAPSHOT
 Apache Mina SSHD
 pom
 2008
@@ -76,7 +76,7 @@
 
scm:git:http://git-wip-us.apache.org/repos/asf/mina-sshd.git
 
scm:git:http://git-wip-us.apache.org/repos/asf/mina-sshd.git
 https://git-wip-us.apache.org/repos/asf?p=mina-sshd.git
-sshd-1.7.0
+HEAD
 
 
 

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/100463f6/sshd-contrib/pom.xml
--
diff --git a/sshd-contrib/pom.xml b/sshd-contrib/pom.xml
index cae164e..0a557ed 100644
--- a/sshd-contrib/pom.xml
+++ b/sshd-contrib/pom.xml
@@ -24,7 +24,7 @@
 
 org.apache.sshd
 sshd
-1.7.0
+1.7.1-SNAPSHOT
 
 
 

mina-sshd git commit: [maven-release-plugin] prepare release sshd-1.7.0

2018-01-11 Thread gnodet
Repository: mina-sshd
Updated Branches:
  refs/heads/master 8aee2acf3 -> 83925cb70


[maven-release-plugin] prepare release sshd-1.7.0


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/83925cb7
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/83925cb7
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/83925cb7

Branch: refs/heads/master
Commit: 83925cb70551c2b5e49f5044efa0d2e74d3180e4
Parents: 8aee2ac
Author: Guillaume Nodet 
Authored: Thu Jan 11 18:26:35 2018 +0100
Committer: Guillaume Nodet 
Committed: Thu Jan 11 18:26:35 2018 +0100

--
 assembly/pom.xml | 2 +-
 pom.xml  | 4 ++--
 sshd-contrib/pom.xml | 2 +-
 sshd-core/pom.xml| 2 +-
 sshd-git/pom.xml | 2 +-
 sshd-ldap/pom.xml| 2 +-
 sshd-spring-sftp/pom.xml | 2 +-
 7 files changed, 8 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/83925cb7/assembly/pom.xml
--
diff --git a/assembly/pom.xml b/assembly/pom.xml
index 3f2715b..75d3275 100644
--- a/assembly/pom.xml
+++ b/assembly/pom.xml
@@ -24,7 +24,7 @@
 
 org.apache.sshd
 sshd
-1.7.0-SNAPSHOT
+1.7.0
 
 
 apache-sshd

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/83925cb7/pom.xml
--
diff --git a/pom.xml b/pom.xml
index 863f965..31b7d72 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
 
 org.apache.sshd
 sshd
-1.7.0-SNAPSHOT
+1.7.0
 Apache Mina SSHD
 pom
 2008
@@ -76,7 +76,7 @@
 
scm:git:http://git-wip-us.apache.org/repos/asf/mina-sshd.git
 
scm:git:http://git-wip-us.apache.org/repos/asf/mina-sshd.git
 https://git-wip-us.apache.org/repos/asf?p=mina-sshd.git
-HEAD
+sshd-1.7.0
 
 
 

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/83925cb7/sshd-contrib/pom.xml
--
diff --git a/sshd-contrib/pom.xml b/sshd-contrib/pom.xml
index ac5660a..cae164e 100644
--- a/sshd-contrib/pom.xml
+++ b/sshd-contrib/pom.xml
@@ -24,7 +24,7 @@
 
 org.apache.sshd
 sshd
-1.7.0-SNAPSHOT
+1.7.0
 
 
 

[mina-sshd] Git Push Summary

2018-01-11 Thread gnodet
Repository: mina-sshd
Updated Tags:  refs/tags/sshd-1.7.0 [created] 269dd59e9


mina-sshd git commit: [SSHD-802] Listing directories using a RootedFileSystem returns non rooted paths

2018-02-06 Thread gnodet
Repository: mina-sshd
Updated Branches:
  refs/heads/master 39392f594 -> 0cb36d988


[SSHD-802] Listing directories using a RootedFileSystem returns non rooted paths


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/0cb36d98
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/0cb36d98
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/0cb36d98

Branch: refs/heads/master
Commit: 0cb36d988e94c8fb916898d91a30ec5f548d6d68
Parents: 39392f5
Author: Guillaume Nodet 
Authored: Tue Feb 6 17:04:07 2018 +0100
Committer: Guillaume Nodet 
Committed: Tue Feb 6 17:04:14 2018 +0100

--
 .../file/root/RootedFileSystemProvider.java | 29 +++-
 .../file/root/RootedFileSystemProviderTest.java | 13 +
 2 files changed, 41 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/0cb36d98/sshd-core/src/main/java/org/apache/sshd/common/file/root/RootedFileSystemProvider.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/common/file/root/RootedFileSystemProvider.java
 
b/sshd-core/src/main/java/org/apache/sshd/common/file/root/RootedFileSystemProvider.java
index ee1fa2e..1866346 100644
--- 
a/sshd-core/src/main/java/org/apache/sshd/common/file/root/RootedFileSystemProvider.java
+++ 
b/sshd-core/src/main/java/org/apache/sshd/common/file/root/RootedFileSystemProvider.java
@@ -44,6 +44,7 @@ import java.nio.file.attribute.BasicFileAttributes;
 import java.nio.file.attribute.FileAttribute;
 import java.nio.file.attribute.FileAttributeView;
 import java.nio.file.spi.FileSystemProvider;
+import java.util.Iterator;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Objects;
@@ -192,7 +193,33 @@ public class RootedFileSystemProvider extends 
FileSystemProvider {
 public DirectoryStream newDirectoryStream(Path dir, 
DirectoryStream.Filter filter) throws IOException {
 Path r = unroot(dir);
 FileSystemProvider p = provider(r);
-return p.newDirectoryStream(r, filter);
+return root(((RootedPath) dir).getFileSystem(), 
p.newDirectoryStream(r, filter));
+}
+
+protected DirectoryStream root(RootedFileSystem rfs, 
DirectoryStream ds) {
+return new DirectoryStream() {
+@Override
+public Iterator iterator() {
+return root(rfs, ds.iterator());
+}
+@Override
+public void close() throws IOException {
+ds.close();
+}
+};
+}
+
+protected Iterator root(RootedFileSystem rfs, Iterator iter) {
+return new Iterator() {
+@Override
+public boolean hasNext() {
+return iter.hasNext();
+}
+@Override
+public Path next() {
+return root(rfs, iter.next());
+}
+};
 }
 
 @Override

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/0cb36d98/sshd-core/src/test/java/org/apache/sshd/common/file/root/RootedFileSystemProviderTest.java
--
diff --git 
a/sshd-core/src/test/java/org/apache/sshd/common/file/root/RootedFileSystemProviderTest.java
 
b/sshd-core/src/test/java/org/apache/sshd/common/file/root/RootedFileSystemProviderTest.java
index e63db36..4d750ff 100644
--- 
a/sshd-core/src/test/java/org/apache/sshd/common/file/root/RootedFileSystemProviderTest.java
+++ 
b/sshd-core/src/test/java/org/apache/sshd/common/file/root/RootedFileSystemProviderTest.java
@@ -226,6 +226,19 @@ public class RootedFileSystemProviderTest extends 
AssertableFile {
 }
 }
 
+@Test
+public void testResolveRoot() throws IOException {
+Path root = fileSystem.getRootDirectories().iterator().next();
+Path dir = root.resolve("tsd");
+FileHelper.createDirectory(dir);
+Path f1 = FileHelper.createFile(dir.resolve("test.txt"));
+Path f2 = Files.newDirectoryStream(dir).iterator().next();
+assertTrue("Unrooted path found", f2 instanceof RootedPath);
+assertEquals(f1, f2);
+FileHelper.deleteFile(f1);
+FileHelper.deleteDirectory(dir);
+}
+
 /* Private helper */
 
 /**



mina-sshd git commit: [SSHD-730] Fix normalization problem with links

2018-02-22 Thread gnodet
Repository: mina-sshd
Updated Branches:
  refs/heads/master f8a3e7299 -> 16fae05ab


[SSHD-730] Fix normalization problem with links


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/16fae05a
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/16fae05a
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/16fae05a

Branch: refs/heads/master
Commit: 16fae05ab9b474f601ec44652c589df345b54ff3
Parents: f8a3e72
Author: Guillaume Nodet 
Authored: Thu Feb 22 13:26:15 2018 +0100
Committer: Guillaume Nodet 
Committed: Thu Feb 22 13:26:28 2018 +0100

--
 .../apache/sshd/common/util/SelectorUtils.java  | 67 +---
 .../sftp/AbstractSftpSubsystemHelper.java   | 14 +---
 .../sshd/common/util/SelectorUtilsTest.java |  7 --
 3 files changed, 4 insertions(+), 84 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/16fae05a/sshd-core/src/main/java/org/apache/sshd/common/util/SelectorUtils.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/common/util/SelectorUtils.java 
b/sshd-core/src/main/java/org/apache/sshd/common/util/SelectorUtils.java
index 7fa1927..53bca90 100644
--- a/sshd-core/src/main/java/org/apache/sshd/common/util/SelectorUtils.java
+++ b/sshd-core/src/main/java/org/apache/sshd/common/util/SelectorUtils.java
@@ -533,72 +533,7 @@ public final class SelectorUtils {
 return ret;
 }
 
-/**
- * Normalizes the path by removing '.', '..' and double separators (e.g. 
'//')
- *
- * @param path  Original path - ignored if {@code null}/empty
- * @param separator The separator used for the path components
- * @return normalized path
- */
-public static String normalizePath(String path, String separator) {
-if (GenericUtils.isEmpty(path)) {
-return path;
-}
-
-boolean startsWithSeparator = path.startsWith(separator);
-List tokens = tokenizePath(path, separator);
-int removedDots = 0;
-// clean up
-for (int i = tokens.size() - 1; i >= 0; i--) {
-String t = tokens.get(i);
-if (GenericUtils.isEmpty(t)) {
-tokens.remove(i);
-} else if (t.equals(".")) {
-tokens.remove(i);
-removedDots++;
-} else if (t.equals("..")) {
-tokens.remove(i);
-removedDots++;
-if (i >= 1) {
-tokens.remove(--i);
-removedDots++;
-}
-}
-}
-
-if (GenericUtils.isEmpty(tokens)) {
-if (removedDots > 0) {
-return "";  // had some "." and ".." after which we remained 
with no path
-} else {
-return separator;   // it was all separators
-}
-}
-
-// serialize
-StringBuilder buffer = new StringBuilder(path.length());
-for (int index = 0; index < tokens.size(); index++) {
-String token = tokens.get(index);
-if (index == 0) {
-if (startsWithSeparator) {
-buffer.append(separator);
-} else if (OsUtils.isWin32() && 
isWindowsDriveSpecified(token)) {
-buffer.append(separator);
-}
-} else {
-buffer.append(separator);
-}
-buffer.append(token);
-
-// for root Windows drive we need to return "C:/" or we get errors 
from the local file system
-if ((tokens.size() == 1) && OsUtils.isWin32() && 
isWindowsDriveSpecified(token)) {
-buffer.append(separator);
-}
-}
-
-return buffer.toString();
-}
-
-/**
+/**   /**
  * Converts a path to one matching the target file system by applying the
  * slashification rules, converting it to a local path and
  * then translating its separator to the target file system one (if 
different

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/16fae05a/sshd-core/src/main/java/org/apache/sshd/server/subsystem/sftp/AbstractSftpSubsystemHelper.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/server/subsystem/sftp/AbstractSftpSubsystemHelper.java
 
b/sshd-core/src/main/java/org/apache/sshd/server/subsystem/sftp/AbstractSftpSubsystemHelper.java
index 2e043fb..262bd05 100644
--- 
a/sshd-core/src/main/java/org/apache/sshd/server/subsystem/sftp/AbstractSftpSubsystemHelper.java
+++ 
b/sshd-core/src/main/java/org/apache/sshd/server/subsystem/sftp/AbstractSftpSubsystemHelper.java
@@ -1786,13 +1786,11 @@ public 

[1/2] mina-sshd git commit: [SSHD-835] Rename to CloseableExecutorService

2018-07-25 Thread gnodet
Repository: mina-sshd
Updated Branches:
  refs/heads/master bba23bf70 -> 644649975


[SSHD-835] Rename to CloseableExecutorService


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/ce29eab3
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/ce29eab3
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/ce29eab3

Branch: refs/heads/master
Commit: ce29eab3368ff4fc1496e23c4b72b75ac70ca2cd
Parents: bba23bf
Author: Guillaume Nodet 
Authored: Thu Jul 26 05:06:54 2018 +0200
Committer: Guillaume Nodet 
Committed: Thu Jul 26 05:06:54 2018 +0200

--
 .../sshd/agent/common/AbstractAgentProxy.java   | 10 +++
 .../agent/local/ChannelAgentForwarding.java |  4 +--
 .../org/apache/sshd/agent/unix/AgentClient.java |  6 ++---
 .../org/apache/sshd/agent/unix/AgentServer.java | 14 +-
 .../sshd/agent/unix/AgentServerProxy.java   | 10 +++
 .../sshd/agent/unix/ChannelAgentForwarding.java |  8 +++---
 .../unix/ChannelAgentForwardingFactory.java |  8 +++---
 .../sshd/agent/unix/UnixAgentFactory.java   |  8 +++---
 .../sshd/client/channel/ChannelSession.java |  6 ++---
 .../sshd/common/channel/AbstractChannel.java| 10 +++
 .../common/io/AbstractIoServiceFactory.java | 10 +++
 .../io/AbstractIoServiceFactoryFactory.java | 14 +-
 .../io/DefaultIoServiceFactoryFactory.java  |  6 ++---
 .../sshd/common/io/IoServiceFactoryFactory.java |  4 +--
 .../sshd/common/io/nio2/Nio2ServiceFactory.java |  4 +--
 .../io/nio2/Nio2ServiceFactoryFactory.java  |  6 ++---
 .../util/threads/CloseableExecutorService.java  | 28 
 .../common/util/threads/ExecutorService.java| 26 --
 .../util/threads/ExecutorServiceCarrier.java|  4 +--
 .../sshd/common/util/threads/ThreadUtils.java   | 27 ++-
 .../server/channel/AbstractServerChannel.java   |  6 ++---
 .../server/command/AbstractCommandSupport.java  | 12 -
 .../command/AbstractFileSystemCommand.java  |  4 +--
 .../sshd/server/forward/TcpipServerChannel.java |  8 +++---
 .../io/DefaultIoServiceFactoryFactoryTest.java  |  6 ++---
 .../sshd/common/util/ThreadUtilsTest.java   |  6 ++---
 .../org/apache/sshd/git/AbstractGitCommand.java |  4 +--
 .../sshd/git/AbstractGitCommandFactory.java |  8 +++---
 .../apache/sshd/git/pack/GitPackCommand.java|  6 ++---
 .../sshd/git/pack/GitPackCommandFactory.java|  4 +--
 .../org/apache/sshd/git/pgm/GitPgmCommand.java  |  6 ++---
 .../sshd/git/pgm/GitPgmCommandFactory.java  |  4 +--
 .../sshd/common/io/mina/MinaServiceFactory.java |  4 +--
 .../io/mina/MinaServiceFactoryFactory.java  |  6 ++---
 .../org/apache/sshd/server/scp/ScpCommand.java  |  6 ++---
 .../sshd/server/scp/ScpCommandFactory.java  | 12 -
 .../org/apache/sshd/client/scp/ScpTest.java |  4 +--
 .../sshd/server/scp/ScpCommandFactoryTest.java  |  8 +++---
 .../server/subsystem/sftp/SftpSubsystem.java| 16 +--
 .../subsystem/sftp/SftpSubsystemFactory.java| 14 +-
 .../sftp/SftpSubsystemFactoryTest.java  |  8 +++---
 41 files changed, 184 insertions(+), 181 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/ce29eab3/sshd-core/src/main/java/org/apache/sshd/agent/common/AbstractAgentProxy.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/agent/common/AbstractAgentProxy.java 
b/sshd-core/src/main/java/org/apache/sshd/agent/common/AbstractAgentProxy.java
index 0432eec..97a858a 100644
--- 
a/sshd-core/src/main/java/org/apache/sshd/agent/common/AbstractAgentProxy.java
+++ 
b/sshd-core/src/main/java/org/apache/sshd/agent/common/AbstractAgentProxy.java
@@ -37,7 +37,7 @@ import org.apache.sshd.common.util.buffer.Buffer;
 import org.apache.sshd.common.util.buffer.BufferUtils;
 import org.apache.sshd.common.util.buffer.ByteArrayBuffer;
 import org.apache.sshd.common.util.logging.AbstractLoggingBean;
-import org.apache.sshd.common.util.threads.ExecutorService;
+import org.apache.sshd.common.util.threads.CloseableExecutorService;
 import org.apache.sshd.common.util.threads.ExecutorServiceCarrier;
 
 /**
@@ -45,10 +45,10 @@ import 
org.apache.sshd.common.util.threads.ExecutorServiceCarrier;
  */
 public abstract class AbstractAgentProxy extends AbstractLoggingBean 
implements SshAgent, ExecutorServiceCarrier {
 
-private ExecutorService executor;
+private CloseableExecutorService executor;
 private String channelType = FactoryManager.AGENT_FORWARDING_TYPE_OPENSSH;
 
-protected AbstractAgentProxy(ExecutorService executorService) {
+protected AbstractAgentProxy(CloseableExecutorService executorService) {
 super();
 executor = executorService;
 }
@@ -62,7 

[2/2] mina-sshd git commit: [SSHD-835] Improve readme

2018-07-25 Thread gnodet
[SSHD-835] Improve readme


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/64464997
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/64464997
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/64464997

Branch: refs/heads/master
Commit: 644649975c3ef28c544c34caba7fd77d3cd85e6b
Parents: ce29eab
Author: Guillaume Nodet 
Authored: Thu Jul 26 05:14:30 2018 +0200
Committer: Guillaume Nodet 
Committed: Thu Jul 26 05:14:30 2018 +0200

--
 README.md | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/64464997/README.md
--
diff --git a/README.md b/README.md
index cb04e3f..b718b16 100644
--- a/README.md
+++ b/README.md
@@ -410,9 +410,10 @@ be tailored to present different views for different 
clients
 
 The framework requires from time to time spawning some threads in order to 
function correctly - e.g., commands, SFTP subsystem,
 port forwarding (among others) require such support. By default, the framework 
will allocate an 
[ExecutorService](https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ExecutorService.html)
 for each specific purpose and then shut it down when the module has completed 
its work - e.g., session
-was closed. Users may provide their own `ExecutorService`(s) instead of the 
internally auto-allocated ones - e.g., in
-order to control the max. spawned threads, stack size, track threads, etc... 
If this is done, then one must also provide
-the `shutdownOnExit` value indicating to the overridden module whether to shut 
down the service once it is no longer necessary.
+was closed. Note that SSHD uses the `CloseableExecutorService` interface 
instead of the usual `ExecutorService` in order to provide graceful shutdown.
+Users may provide their own `CloseableExecutorService`(s) instead of the 
internally auto-allocated ones - e.g., in
+order to control the max. spawned threads, stack size, track threads, etc... 
but they can leverage the `ThreadUtils.ThreadPoolExecutor` implementation which 
should cover most use cases.
+If a single executor is shared between several services, it needs to be 
wrapped with the `ThreadUtils.noClose(executor)` method.
 
 ```java
 
@@ -423,8 +424,7 @@ the `shutdownOnExit` value indicating to the overridden 
module whether to shut d
  * it down when the command is destroyed
  */
 SftpSubsystemFactory factory = new SftpSubsystemFactory.Builder()
-.withExecutorService(mySuperDuperExecutorService)
-.withShutdownOnExit(false)  // I will take care of shutting it down
+.withExecutorService(ThreadUtils.noClose(mySuperDuperExecutorService))
 .build();
 SshServer sshd = SshServer.setupDefaultServer();
 
sshd.setSubsystemFactories(Collections.>singletonList(factory));



svn commit: r28340 - /release/mina/sshd/2.0.0/

2018-07-25 Thread gnodet
Author: gnodet
Date: Wed Jul 25 06:35:41 2018
New Revision: 28340

Log:
Add SSHD 2.0.0 release

Added:
release/mina/sshd/2.0.0/
release/mina/sshd/2.0.0/apache-sshd-2.0.0-src.tar.gz   (with props)
release/mina/sshd/2.0.0/apache-sshd-2.0.0-src.tar.gz.asc
release/mina/sshd/2.0.0/apache-sshd-2.0.0-src.tar.gz.md5
release/mina/sshd/2.0.0/apache-sshd-2.0.0-src.tar.gz.sha1
release/mina/sshd/2.0.0/apache-sshd-2.0.0-src.zip   (with props)
release/mina/sshd/2.0.0/apache-sshd-2.0.0-src.zip.asc
release/mina/sshd/2.0.0/apache-sshd-2.0.0-src.zip.md5
release/mina/sshd/2.0.0/apache-sshd-2.0.0-src.zip.sha1
release/mina/sshd/2.0.0/apache-sshd-2.0.0.pom
release/mina/sshd/2.0.0/apache-sshd-2.0.0.pom.asc
release/mina/sshd/2.0.0/apache-sshd-2.0.0.pom.md5
release/mina/sshd/2.0.0/apache-sshd-2.0.0.pom.sha1
release/mina/sshd/2.0.0/apache-sshd-2.0.0.tar.gz   (with props)
release/mina/sshd/2.0.0/apache-sshd-2.0.0.tar.gz.asc
release/mina/sshd/2.0.0/apache-sshd-2.0.0.tar.gz.md5
release/mina/sshd/2.0.0/apache-sshd-2.0.0.tar.gz.sha1
release/mina/sshd/2.0.0/apache-sshd-2.0.0.zip   (with props)
release/mina/sshd/2.0.0/apache-sshd-2.0.0.zip.asc
release/mina/sshd/2.0.0/apache-sshd-2.0.0.zip.md5
release/mina/sshd/2.0.0/apache-sshd-2.0.0.zip.sha1

Added: release/mina/sshd/2.0.0/apache-sshd-2.0.0-src.tar.gz
==
Binary file - no diff available.

Propchange: release/mina/sshd/2.0.0/apache-sshd-2.0.0-src.tar.gz
--
svn:mime-type = application/octet-stream

Added: release/mina/sshd/2.0.0/apache-sshd-2.0.0-src.tar.gz.asc
==
--- release/mina/sshd/2.0.0/apache-sshd-2.0.0-src.tar.gz.asc (added)
+++ release/mina/sshd/2.0.0/apache-sshd-2.0.0-src.tar.gz.asc Wed Jul 25 
06:35:41 2018
@@ -0,0 +1,6 @@
+-BEGIN PGP SIGNATURE-
+
+iF0EABECAB0WIQTqI9sTYNkClIHn8u/s3+o8tEk7lAUCWwwQJwAKCRDs3+o8tEk7
+lOQEAJ45zG7UHBqL4hIsgGd58eKWtZt4PACgn8ML0DEgIY6wcUulCZ5YnWyfCU0=
+=93RB
+-END PGP SIGNATURE-

Added: release/mina/sshd/2.0.0/apache-sshd-2.0.0-src.tar.gz.md5
==
--- release/mina/sshd/2.0.0/apache-sshd-2.0.0-src.tar.gz.md5 (added)
+++ release/mina/sshd/2.0.0/apache-sshd-2.0.0-src.tar.gz.md5 Wed Jul 25 
06:35:41 2018
@@ -0,0 +1 @@
+445cf4b8df30300b4ee4643f38b3
\ No newline at end of file

Added: release/mina/sshd/2.0.0/apache-sshd-2.0.0-src.tar.gz.sha1
==
--- release/mina/sshd/2.0.0/apache-sshd-2.0.0-src.tar.gz.sha1 (added)
+++ release/mina/sshd/2.0.0/apache-sshd-2.0.0-src.tar.gz.sha1 Wed Jul 25 
06:35:41 2018
@@ -0,0 +1 @@
+03ad596a53da5266361378b4e1c3721b61ce4d1f
\ No newline at end of file

Added: release/mina/sshd/2.0.0/apache-sshd-2.0.0-src.zip
==
Binary file - no diff available.

Propchange: release/mina/sshd/2.0.0/apache-sshd-2.0.0-src.zip
--
svn:mime-type = application/octet-stream

Added: release/mina/sshd/2.0.0/apache-sshd-2.0.0-src.zip.asc
==
--- release/mina/sshd/2.0.0/apache-sshd-2.0.0-src.zip.asc (added)
+++ release/mina/sshd/2.0.0/apache-sshd-2.0.0-src.zip.asc Wed Jul 25 06:35:41 
2018
@@ -0,0 +1,6 @@
+-BEGIN PGP SIGNATURE-
+
+iF0EABECAB0WIQTqI9sTYNkClIHn8u/s3+o8tEk7lAUCWwwQJwAKCRDs3+o8tEk7
+lI9IAKCOMcjsVScn+j1obZIwMwCsOKnCpgCfcB9tA4GPKGsKWVpLQVoYAVvmOYY=
+=denF
+-END PGP SIGNATURE-

Added: release/mina/sshd/2.0.0/apache-sshd-2.0.0-src.zip.md5
==
--- release/mina/sshd/2.0.0/apache-sshd-2.0.0-src.zip.md5 (added)
+++ release/mina/sshd/2.0.0/apache-sshd-2.0.0-src.zip.md5 Wed Jul 25 06:35:41 
2018
@@ -0,0 +1 @@
+87a06d7dcbd8dbf84e3b5983e5129e63
\ No newline at end of file

Added: release/mina/sshd/2.0.0/apache-sshd-2.0.0-src.zip.sha1
==
--- release/mina/sshd/2.0.0/apache-sshd-2.0.0-src.zip.sha1 (added)
+++ release/mina/sshd/2.0.0/apache-sshd-2.0.0-src.zip.sha1 Wed Jul 25 06:35:41 
2018
@@ -0,0 +1 @@
+e7c921f3e578e46431376dcb16096f4250f1840b
\ No newline at end of file

Added: release/mina/sshd/2.0.0/apache-sshd-2.0.0.pom
==
--- release/mina/sshd/2.0.0/apache-sshd-2.0.0.pom (added)
+++ release/mina/sshd/2.0.0/apache-sshd-2.0.0.pom Wed Jul 25 06:35:41 2018
@@ -0,0 +1,141 @@
+http://maven.apache.org/POM/4.0.0; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; 
xsi:schemaLocation="http://maven.apache.org

svn commit: r1836606 - in /mina/site/trunk: content/downloads-sshd.mdtext content/sshd-project/download_2.0.0.mdtext content/sshd-project/downloads.mdtext lib/path.pm

2018-07-25 Thread gnodet
Author: gnodet
Date: Wed Jul 25 07:15:15 2018
New Revision: 1836606

URL: http://svn.apache.org/viewvc?rev=1836606=rev
Log:
Add SSHD 2.0.0 release

Added:
mina/site/trunk/content/sshd-project/download_2.0.0.mdtext
Modified:
mina/site/trunk/content/downloads-sshd.mdtext
mina/site/trunk/content/sshd-project/downloads.mdtext
mina/site/trunk/lib/path.pm

Modified: mina/site/trunk/content/downloads-sshd.mdtext
URL: 
http://svn.apache.org/viewvc/mina/site/trunk/content/downloads-sshd.mdtext?rev=1836606=1836605=1836606=diff
==
--- mina/site/trunk/content/downloads-sshd.mdtext (original)
+++ mina/site/trunk/content/downloads-sshd.mdtext Wed Jul 25 07:15:15 2018
@@ -18,14 +18,14 @@ Notice:Licensed to the Apache Softwa
 
 # Latest SSHD Releases
 
-The latest release is the SSHD 1.7.0 release.
+The latest release is the SSHD 2.0.0 release.
  
 * Source distributions:
-* [Apache Mina SSHD 1.7.0 Sources 
(.tar.gz)](http://www.apache.org/dyn/closer.lua/mina/sshd/1.7.0/apache-sshd-1.7.0-src.tar.gz)
 
[PGP](http://www.apache.org/dist/mina/sshd/1.7.0/apache-sshd-1.7.0-src.tar.gz.asc)
 
[SHA](http://www.apache.org/dist/mina/sshd/1.7.0/apache-sshd-1.7.0-src.tar.gz.sha1)
 
[MD5](http://www.apache.org/dist/mina/sshd/1.7.0/apache-sshd-1.7.0-src.tar.gz.md5)
-* [Apache Mina SSHD 1.7.0 Sources 
(.zip)](http://www.apache.org/dyn/closer.lua/mina/sshd/1.7.0/apache-sshd-1.7.0-src.zip)
 
[PGP](http://www.apache.org/dist/mina/sshd/1.7.0/apache-sshd-1.7.0-src.zip.asc) 
[SHA](http://www.apache.org/dist/mina/sshd/1.7.0/apache-sshd-1.7.0-src.zip.sha1)
 [MD5](http://www.apache.org/dist/mina/sshd/1.7.0/apache-sshd-1.7.0-src.zip.md5)
+* [Apache Mina SSHD 2.0.0 Sources 
(.tar.gz)](http://www.apache.org/dyn/closer.lua/mina/sshd/2.0.0/apache-sshd-2.0.0-src.tar.gz)
 
[PGP](http://www.apache.org/dist/mina/sshd/2.0.0/apache-sshd-2.0.0-src.tar.gz.asc)
 
[SHA](http://www.apache.org/dist/mina/sshd/2.0.0/apache-sshd-2.0.0-src.tar.gz.sha1)
 
[MD5](http://www.apache.org/dist/mina/sshd/2.0.0/apache-sshd-2.0.0-src.tar.gz.md5)
+* [Apache Mina SSHD 2.0.0 Sources 
(.zip)](http://www.apache.org/dyn/closer.lua/mina/sshd/2.0.0/apache-sshd-2.0.0-src.zip)
 
[PGP](http://www.apache.org/dist/mina/sshd/2.0.0/apache-sshd-2.0.0-src.zip.asc) 
[SHA](http://www.apache.org/dist/mina/sshd/2.0.0/apache-sshd-2.0.0-src.zip.sha1)
 [MD5](http://www.apache.org/dist/mina/sshd/2.0.0/apache-sshd-2.0.0-src.zip.md5)
 * Binary distributions:
-* [Apache Mina SSHD 1.7.0 Binary 
(.tar.gz)](http://www.apache.org/dyn/closer.lua/mina/sshd/1.7.0/dist/apache-sshd-1.7.0.tar.gz)
 
[PGP](http://www.apache.org/dist/mina/sshd/1.7.0/dist/apache-sshd-1.7.0.tar.gz.asc)
 
[SHA](http://www.apache.org/dist/mina/sshd/1.7.0/dist/apache-sshd-1.7.0.tar.gz.sha1)
 
[MD5](http://www.apache.org/dist/mina/sshd/1.7.0/dist/apache-sshd-1.7.0.tar.gz.md5)
-* [Apache Mina SSHD 1.7.0 Binary 
(.zip)](http://www.apache.org/dyn/closer.lua/mina/sshd/1.7.0/dist/apache-sshd-1.7.0.zip)
 
[PGP](http://www.apache.org/dist/mina/sshd/1.7.0/dist/apache-sshd-1.7.0.zip.asc)
 
[SHA](http://www.apache.org/dist/mina/sshd/1.7.0/dist/apache-sshd-1.7.0.zip.sha1)
 
[MD5](http://www.apache.org/dist/mina/sshd/1.7.0/dist/apache-sshd-1.7.0.zip.md5)
+* [Apache Mina SSHD 2.0.0 Binary 
(.tar.gz)](http://www.apache.org/dyn/closer.lua/mina/sshd/2.0.0/dist/apache-sshd-2.0.0.tar.gz)
 
[PGP](http://www.apache.org/dist/mina/sshd/2.0.0/dist/apache-sshd-2.0.0.tar.gz.asc)
 
[SHA](http://www.apache.org/dist/mina/sshd/2.0.0/dist/apache-sshd-2.0.0.tar.gz.sha1)
 
[MD5](http://www.apache.org/dist/mina/sshd/2.0.0/dist/apache-sshd-2.0.0.tar.gz.md5)
+* [Apache Mina SSHD 2.0.0 Binary 
(.zip)](http://www.apache.org/dyn/closer.lua/mina/sshd/2.0.0/dist/apache-sshd-2.0.0.zip)
 
[PGP](http://www.apache.org/dist/mina/sshd/2.0.0/dist/apache-sshd-2.0.0.zip.asc)
 
[SHA](http://www.apache.org/dist/mina/sshd/2.0.0/dist/apache-sshd-2.0.0.zip.sha1)
 
[MD5](http://www.apache.org/dist/mina/sshd/2.0.0/dist/apache-sshd-2.0.0.zip.md5)
 
 # Development snapshots
 
@@ -55,3 +55,4 @@ You can [build](sshd-project/building.ht
 * [SSHD 1.3.0](sshd-project/download_1.3.0.html)
 * [SSHD 1.4.0](sshd-project/download_1.4.0.html)
 * [SSHD 1.6.0](sshd-project/download_1.6.0.html)
+* [SSHD 1.6.0](sshd-project/download_1.7.0.html)

Added: mina/site/trunk/content/sshd-project/download_2.0.0.mdtext
URL: 
http://svn.apache.org/viewvc/mina/site/trunk/content/sshd-project/download_2.0.0.mdtext?rev=1836606=auto
==
--- mina/site/trunk/content/sshd-project/download_2.0.0.mdtext (added)
+++ mina/site/trunk/content/sshd-project/download_2.0.0.mdtext Wed Jul 25 
07:15:15 2018
@@ -0,0 +1,43 @@
+Title: Apache SSHD 2.0.0 Release
+Notice:Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work

svn commit: r1836607 - /mina/site/trunk/content/downloads-sshd.mdtext

2018-07-25 Thread gnodet
Author: gnodet
Date: Wed Jul 25 07:27:17 2018
New Revision: 1836607

URL: http://svn.apache.org/viewvc?rev=1836607=rev
Log:
Fix sshd 1.7.0 download link

Modified:
mina/site/trunk/content/downloads-sshd.mdtext

Modified: mina/site/trunk/content/downloads-sshd.mdtext
URL: 
http://svn.apache.org/viewvc/mina/site/trunk/content/downloads-sshd.mdtext?rev=1836607=1836606=1836607=diff
==
--- mina/site/trunk/content/downloads-sshd.mdtext (original)
+++ mina/site/trunk/content/downloads-sshd.mdtext Wed Jul 25 07:27:17 2018
@@ -55,4 +55,4 @@ You can [build](sshd-project/building.ht
 * [SSHD 1.3.0](sshd-project/download_1.3.0.html)
 * [SSHD 1.4.0](sshd-project/download_1.4.0.html)
 * [SSHD 1.6.0](sshd-project/download_1.6.0.html)
-* [SSHD 1.6.0](sshd-project/download_1.7.0.html)
+* [SSHD 1.7.0](sshd-project/download_1.7.0.html)




svn commit: r1033021 - in /websites/production/mina/content: ./ mina-project/apidocs/ mina-project/testapidocs/ mina-project/xref-test/ mina-project/xref/ sshd-project/apidocs/

2018-07-25 Thread gnodet
Author: gnodet
Date: Wed Jul 25 07:28:32 2018
New Revision: 1033021

Log:
Update for sshd 2.0.0 release

Added:
websites/production/mina/content/
  - copied from r1033020, websites/staging/mina/trunk/content/
websites/production/mina/content/mina-project/apidocs/
  - copied from r1033020, 
websites/production/mina/content/mina-project/apidocs/
websites/production/mina/content/mina-project/testapidocs/
  - copied from r1033020, 
websites/production/mina/content/mina-project/testapidocs/
websites/production/mina/content/mina-project/xref/
  - copied from r1033020, 
websites/production/mina/content/mina-project/xref/
websites/production/mina/content/mina-project/xref-test/
  - copied from r1033020, 
websites/production/mina/content/mina-project/xref-test/
websites/production/mina/content/sshd-project/apidocs/
  - copied from r1033020, 
websites/production/mina/content/sshd-project/apidocs/



[2/2] mina-sshd git commit: [SSHD-340] Forbid starting the server/client again

2018-07-25 Thread gnodet
[SSHD-340] Forbid starting the server/client again


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/101a5095
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/101a5095
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/101a5095

Branch: refs/heads/master
Commit: 101a50951f9321ff31ce319660e690522901d3d1
Parents: 078c0c4
Author: Guillaume Nodet 
Authored: Wed Jul 25 10:39:47 2018 +0200
Committer: Guillaume Nodet 
Committed: Wed Jul 25 10:39:47 2018 +0200

--
 sshd-core/src/main/java/org/apache/sshd/client/SshClient.java | 3 +++
 sshd-core/src/main/java/org/apache/sshd/server/SshServer.java | 3 +++
 2 files changed, 6 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/101a5095/sshd-core/src/main/java/org/apache/sshd/client/SshClient.java
--
diff --git a/sshd-core/src/main/java/org/apache/sshd/client/SshClient.java 
b/sshd-core/src/main/java/org/apache/sshd/client/SshClient.java
index 143e4d7..533cae5 100644
--- a/sshd-core/src/main/java/org/apache/sshd/client/SshClient.java
+++ b/sshd-core/src/main/java/org/apache/sshd/client/SshClient.java
@@ -370,6 +370,9 @@ public class SshClient extends AbstractFactoryManager 
implements ClientFactoryMa
  * Ignored if already {@link #isStarted() started}.
  */
 public void start() {
+if (isClosed()) {
+throw new IllegalStateException("Can not start the client again");
+}
 if (isStarted()) {
 return;
 }

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/101a5095/sshd-core/src/main/java/org/apache/sshd/server/SshServer.java
--
diff --git a/sshd-core/src/main/java/org/apache/sshd/server/SshServer.java 
b/sshd-core/src/main/java/org/apache/sshd/server/SshServer.java
index 35b72cc..e2c0c2f 100644
--- a/sshd-core/src/main/java/org/apache/sshd/server/SshServer.java
+++ b/sshd-core/src/main/java/org/apache/sshd/server/SshServer.java
@@ -278,6 +278,9 @@ public class SshServer extends AbstractFactoryManager 
implements ServerFactoryMa
  * @throws IOException If failed to start
  */
 public void start() throws IOException {
+if (isClosed()) {
+throw new IllegalStateException("Can not start the server again");
+}
 if (isStarted()) {
 return;
 }



[1/2] mina-sshd git commit: Revert "[SSHD-340] Mark SSH client/server as having 'Opened' state if re-started after being stopped"

2018-07-25 Thread gnodet
Repository: mina-sshd
Updated Branches:
  refs/heads/master 0cf8186ad -> 101a50951


Revert "[SSHD-340] Mark SSH client/server as having 'Opened' state if 
re-started after being stopped"

This reverts commit 738264f423540c095bfb919d4e066721762e00ca.


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/078c0c44
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/078c0c44
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/078c0c44

Branch: refs/heads/master
Commit: 078c0c44f544785f7f072ff9499dcd4809cdee26
Parents: 0cf8186
Author: Guillaume Nodet 
Authored: Wed Jul 25 10:37:40 2018 +0200
Committer: Guillaume Nodet 
Committed: Wed Jul 25 10:37:40 2018 +0200

--
 .../java/org/apache/sshd/client/SshClient.java  |  8 +
 .../org/apache/sshd/common/io/IoAcceptor.java   | 32 
 .../util/closeable/AbstractCloseable.java   | 17 ---
 .../java/org/apache/sshd/server/SshServer.java  | 20 
 .../java/org/apache/sshd/client/ClientTest.java | 26 
 .../org/apache/sshd/server/SshServerTest.java   | 27 +
 6 files changed, 8 insertions(+), 122 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/078c0c44/sshd-core/src/main/java/org/apache/sshd/client/SshClient.java
--
diff --git a/sshd-core/src/main/java/org/apache/sshd/client/SshClient.java 
b/sshd-core/src/main/java/org/apache/sshd/client/SshClient.java
index dc4cfdf..143e4d7 100644
--- a/sshd-core/src/main/java/org/apache/sshd/client/SshClient.java
+++ b/sshd-core/src/main/java/org/apache/sshd/client/SshClient.java
@@ -72,7 +72,6 @@ import org.apache.sshd.common.future.SshFutureListener;
 import org.apache.sshd.common.helpers.AbstractFactoryManager;
 import org.apache.sshd.common.io.IoConnectFuture;
 import org.apache.sshd.common.io.IoConnector;
-import org.apache.sshd.common.io.IoServiceFactory;
 import org.apache.sshd.common.io.IoSession;
 import org.apache.sshd.common.keyprovider.KeyPairProvider;
 import org.apache.sshd.common.session.helpers.AbstractSession;
@@ -372,9 +371,6 @@ public class SshClient extends AbstractFactoryManager 
implements ClientFactoryMa
  */
 public void start() {
 if (isStarted()) {
-if (log.isDebugEnabled()) {
-log.debug("start({}) already started", this);
-}
 return;
 }
 
@@ -384,7 +380,6 @@ public class SshClient extends AbstractFactoryManager 
implements ClientFactoryMa
 }
 
 setupSessionTimeout(sessionFactory);
-reopenIfNotOpen();
 
 connector = createConnector();
 started.set(true);
@@ -692,8 +687,7 @@ public class SshClient extends AbstractFactoryManager 
implements ClientFactoryMa
 }
 
 protected IoConnector createConnector() {
-IoServiceFactory factory = getIoServiceFactory();
-return factory.createConnector(getSessionFactory());
+return getIoServiceFactory().createConnector(getSessionFactory());
 }
 
 protected SessionFactory createSessionFactory() {

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/078c0c44/sshd-core/src/main/java/org/apache/sshd/common/io/IoAcceptor.java
--
diff --git a/sshd-core/src/main/java/org/apache/sshd/common/io/IoAcceptor.java 
b/sshd-core/src/main/java/org/apache/sshd/common/io/IoAcceptor.java
index 8ea353d..a86b73e 100644
--- a/sshd-core/src/main/java/org/apache/sshd/common/io/IoAcceptor.java
+++ b/sshd-core/src/main/java/org/apache/sshd/common/io/IoAcceptor.java
@@ -19,15 +19,10 @@
 package org.apache.sshd.common.io;
 
 import java.io.IOException;
-import java.net.InetSocketAddress;
 import java.net.SocketAddress;
 import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
 import java.util.Set;
 
-import org.apache.sshd.common.util.GenericUtils;
-
 /**
  * @author mailto:d...@mina.apache.org;>Apache MINA SSHD Project
  */
@@ -46,31 +41,4 @@ public interface IoAcceptor extends IoService {
 
 Set getBoundAddresses();
 
-/**
- * @param acceptor The {@link IoAcceptor} - ignored if {@code null}
- * @return The port associated with the first bound address - 
{@code -1} if none available
- * @see #resolveBoundAddress(IoAcceptor)
- */
-static int resolveBoundPort(IoAcceptor acceptor) {
-SocketAddress boundEndpoint = resolveBoundAddress(acceptor);
-if (boundEndpoint instanceof InetSocketAddress) {
-return ((InetSocketAddress) boundEndpoint).getPort();
-}
-
-return -1;
-}
-
-/**
- * @param acceptor The {@link IoAcceptor} - ignored if {@code null}
- * @return The first bound address - {@code 

[1/3] mina-sshd git commit: [SSHD-835] Introduce a Closeable ExecutorService

2018-07-25 Thread gnodet
Repository: mina-sshd
Updated Branches:
  refs/heads/master 101a50951 -> bba23bf70


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/7b35bb36/sshd-core/src/main/java/org/apache/sshd/server/command/AbstractCommandSupport.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/server/command/AbstractCommandSupport.java
 
b/sshd-core/src/main/java/org/apache/sshd/server/command/AbstractCommandSupport.java
index e797456..8704a4a 100644
--- 
a/sshd-core/src/main/java/org/apache/sshd/server/command/AbstractCommandSupport.java
+++ 
b/sshd-core/src/main/java/org/apache/sshd/server/command/AbstractCommandSupport.java
@@ -23,13 +23,13 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.util.Collection;
-import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Future;
 
 import org.apache.sshd.common.session.Session;
 import org.apache.sshd.common.session.SessionHolder;
 import org.apache.sshd.common.util.GenericUtils;
 import org.apache.sshd.common.util.logging.AbstractLoggingBean;
+import org.apache.sshd.common.util.threads.ExecutorService;
 import org.apache.sshd.common.util.threads.ExecutorServiceCarrier;
 import org.apache.sshd.common.util.threads.ThreadUtils;
 import org.apache.sshd.server.Environment;
@@ -56,20 +56,17 @@ public abstract class AbstractCommandSupport
 protected Future cmdFuture;
 protected Thread cmdRunner;
 protected ExecutorService executorService;
-protected boolean shutdownOnExit;
 protected boolean cbCalled;
 protected ServerSession serverSession;
 
-protected AbstractCommandSupport(String command, ExecutorService 
executorService, boolean shutdownOnExit) {
+protected AbstractCommandSupport(String command, ExecutorService 
executorService) {
 this.command = command;
 
 if (executorService == null) {
 String poolName = GenericUtils.isEmpty(command) ? 
getClass().getSimpleName() : command.replace(' ', '_').replace('/', ':');
 this.executorService = 
ThreadUtils.newSingleThreadExecutor(poolName);
-this.shutdownOnExit = true;// we always close the ad-hoc 
executor service
 } else {
 this.executorService = executorService;
-this.shutdownOnExit = shutdownOnExit;
 }
 }
 
@@ -97,11 +94,6 @@ public abstract class AbstractCommandSupport
 return executorService;
 }
 
-@Override
-public boolean isShutdownOnExit() {
-return shutdownOnExit;
-}
-
 public InputStream getInputStream() {
 return in;
 }
@@ -176,7 +168,7 @@ public abstract class AbstractCommandSupport
 cmdFuture = null;
 
 ExecutorService executors = getExecutorService();
-if ((executors != null) && (!executors.isShutdown()) && 
isShutdownOnExit()) {
+if ((executors != null) && (!executors.isShutdown())) {
 Collection runners = executors.shutdownNow();
 if (debugEnabled) {
 log.debug("destroy() - shutdown executor service - runners 
count=" + runners.size());

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/7b35bb36/sshd-core/src/main/java/org/apache/sshd/server/command/AbstractFileSystemCommand.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/server/command/AbstractFileSystemCommand.java
 
b/sshd-core/src/main/java/org/apache/sshd/server/command/AbstractFileSystemCommand.java
index e4d0f58..6722976 100644
--- 
a/sshd-core/src/main/java/org/apache/sshd/server/command/AbstractFileSystemCommand.java
+++ 
b/sshd-core/src/main/java/org/apache/sshd/server/command/AbstractFileSystemCommand.java
@@ -21,9 +21,9 @@ package org.apache.sshd.server.command;
 
 import java.io.IOException;
 import java.nio.file.FileSystem;
-import java.util.concurrent.ExecutorService;
 
 import org.apache.sshd.common.file.FileSystemAware;
+import org.apache.sshd.common.util.threads.ExecutorService;
 
 /**
  * Provides a basic useful skeleton for {@link Command} executions that 
require file system access
@@ -34,8 +34,8 @@ public abstract class AbstractFileSystemCommand extends 
AbstractCommandSupport i
 
 protected FileSystem fileSystem;
 
-public AbstractFileSystemCommand(String command, ExecutorService 
executorService, boolean shutdownOnExit) {
-super(command, executorService, shutdownOnExit);
+public AbstractFileSystemCommand(String command, ExecutorService 
executorService) {
+super(command, executorService);
 }
 
 public FileSystem getFileSystem() {

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/7b35bb36/sshd-core/src/main/java/org/apache/sshd/server/forward/DirectTcpipFactory.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/server/forward/DirectTcpipFactory.java
 

[2/3] mina-sshd git commit: [SSHD-835] Introduce a Closeable ExecutorService

2018-07-25 Thread gnodet
[SSHD-835] Introduce a Closeable ExecutorService


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/7b35bb36
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/7b35bb36
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/7b35bb36

Branch: refs/heads/master
Commit: 7b35bb360410f21be06ad16a7d0a0a0d7cc012af
Parents: 101a509
Author: Guillaume Nodet 
Authored: Thu May 31 09:51:49 2018 +0200
Committer: Guillaume Nodet 
Committed: Wed Jul 25 14:37:52 2018 +0200

--
 .../sshd/agent/common/AbstractAgentProxy.java   |  27 +-
 .../sshd/agent/local/AgentForwardedChannel.java |   2 +-
 .../agent/local/ChannelAgentForwarding.java |   6 +-
 .../local/ChannelAgentForwardingFactory.java|   2 +-
 .../org/apache/sshd/agent/unix/AgentClient.java |  12 +-
 .../org/apache/sshd/agent/unix/AgentServer.java |  22 +-
 .../sshd/agent/unix/AgentServerProxy.java   |  23 +-
 .../sshd/agent/unix/ChannelAgentForwarding.java |  16 +-
 .../unix/ChannelAgentForwardingFactory.java |  29 +-
 .../sshd/agent/unix/UnixAgentFactory.java   |  59 ++--
 .../client/channel/AbstractClientChannel.java   |   6 +
 .../sshd/client/channel/ChannelSession.java |  10 +-
 .../client/session/AbstractClientSession.java   |   4 +-
 .../client/session/ClientConnectionService.java |   9 +-
 .../sshd/common/channel/AbstractChannel.java|  31 +--
 .../common/io/AbstractIoServiceFactory.java |  18 +-
 .../io/AbstractIoServiceFactoryFactory.java |  45 +--
 .../io/DefaultIoServiceFactoryFactory.java  |  17 +-
 .../sshd/common/io/IoServiceFactoryFactory.java |   5 +-
 .../sshd/common/io/nio2/Nio2ServiceFactory.java |  19 +-
 .../io/nio2/Nio2ServiceFactoryFactory.java  |  14 +-
 .../helpers/AbstractConnectionService.java  |  38 ++-
 .../common/util/threads/ExecutorService.java|  26 ++
 .../util/threads/ExecutorServiceCarrier.java|   8 -
 .../util/threads/ExecutorServiceConfigurer.java |  31 ---
 .../sshd/common/util/threads/ThreadUtils.java   | 276 ---
 .../server/channel/AbstractServerChannel.java   |  17 +-
 .../sshd/server/channel/ChannelSession.java |   9 +-
 .../server/command/AbstractCommandSupport.java  |  14 +-
 .../command/AbstractFileSystemCommand.java  |   6 +-
 .../sshd/server/forward/DirectTcpipFactory.java |   1 +
 .../server/forward/ForwardedTcpipFactory.java   |   1 +
 .../sshd/server/forward/TcpipServerChannel.java |  43 +--
 .../server/session/ServerConnectionService.java |   8 +-
 .../forward/AbstractServerCloseTestSupport.java |  15 +-
 .../io/DefaultIoServiceFactoryFactoryTest.java  |  22 +-
 .../sshd/common/util/ThreadUtilsTest.java   |   5 +-
 .../java/org/apache/sshd/server/ServerTest.java |   2 +-
 .../sshd/util/test/CommandExecutionHelper.java  |   2 +-
 .../org/apache/sshd/git/AbstractGitCommand.java |   6 +-
 .../sshd/git/AbstractGitCommandFactory.java |  14 +-
 .../apache/sshd/git/pack/GitPackCommand.java|   8 +-
 .../sshd/git/pack/GitPackCommandFactory.java|  10 +-
 .../org/apache/sshd/git/pgm/GitPgmCommand.java  |   8 +-
 .../sshd/git/pgm/GitPgmCommandFactory.java  |  10 +-
 .../sshd/common/io/mina/MinaServiceFactory.java |   9 +-
 .../io/mina/MinaServiceFactoryFactory.java  |  21 +-
 .../netty/NettyIoServiceFactoryFactory.java |   5 +-
 .../sshd/client/scp/AbstractScpClient.java  |   4 +
 .../org/apache/sshd/server/scp/ScpCommand.java  |   9 +-
 .../sshd/server/scp/ScpCommandFactory.java  |  26 +-
 .../org/apache/sshd/client/scp/ScpTest.java |   8 +-
 .../sshd/server/scp/ScpCommandFactoryTest.java  |   6 +-
 .../server/subsystem/sftp/SftpSubsystem.java|  17 +-
 .../subsystem/sftp/SftpSubsystemFactory.java|  33 +--
 .../client/subsystem/sftp/SftpVersionsTest.java |   4 +-
 .../SpaceAvailableExtensionImplTest.java|   2 +-
 .../openssh/helpers/OpenSSHExtensionsTest.java  |   2 +-
 .../sftp/SftpSubsystemFactoryTest.java  |   6 +-
 59 files changed, 556 insertions(+), 552 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/7b35bb36/sshd-core/src/main/java/org/apache/sshd/agent/common/AbstractAgentProxy.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/agent/common/AbstractAgentProxy.java 
b/sshd-core/src/main/java/org/apache/sshd/agent/common/AbstractAgentProxy.java
index 028b48e..0432eec 100644
--- 
a/sshd-core/src/main/java/org/apache/sshd/agent/common/AbstractAgentProxy.java
+++ 
b/sshd-core/src/main/java/org/apache/sshd/agent/common/AbstractAgentProxy.java
@@ -26,7 +26,6 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 import java.util.Map;
-import java.util.concurrent.ExecutorService;
 
 import org.apache.sshd.agent.SshAgent;
 import 

[3/3] mina-sshd git commit: [SSHD-836] Make final some methods from base Closeable implementations

2018-07-25 Thread gnodet
[SSHD-836] Make final some methods from base Closeable implementations


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/bba23bf7
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/bba23bf7
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/bba23bf7

Branch: refs/heads/master
Commit: bba23bf70bcd7e4d5a972806a9df62669e7cda81
Parents: 7b35bb3
Author: Guillaume Nodet 
Authored: Wed Jul 25 14:38:05 2018 +0200
Committer: Guillaume Nodet 
Committed: Wed Jul 25 14:38:05 2018 +0200

--
 .../agent/local/ChannelAgentForwarding.java |  9 ++-
 .../sshd/agent/unix/AgentForwardedChannel.java  |  9 ++-
 .../sshd/agent/unix/ChannelAgentForwarding.java |  9 ++-
 .../client/channel/AbstractClientChannel.java   |  2 +-
 .../sshd/client/channel/ChannelSession.java | 12 ++-
 .../sshd/common/channel/AbstractChannel.java| 43 --
 .../sshd/common/io/nio2/Nio2Acceptor.java   | 16 ++--
 .../util/closeable/AbstractCloseable.java   |  6 +-
 .../util/closeable/AbstractInnerCloseable.java  |  4 +-
 .../sshd/server/channel/ChannelSession.java |  8 +-
 .../sshd/server/forward/TcpipServerChannel.java | 84 ++--
 11 files changed, 104 insertions(+), 98 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/bba23bf7/sshd-core/src/main/java/org/apache/sshd/agent/local/ChannelAgentForwarding.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/agent/local/ChannelAgentForwarding.java
 
b/sshd-core/src/main/java/org/apache/sshd/agent/local/ChannelAgentForwarding.java
index e051f1e..0ca735b 100644
--- 
a/sshd-core/src/main/java/org/apache/sshd/agent/local/ChannelAgentForwarding.java
+++ 
b/sshd-core/src/main/java/org/apache/sshd/agent/local/ChannelAgentForwarding.java
@@ -28,10 +28,10 @@ import org.apache.sshd.agent.SshAgentFactory;
 import org.apache.sshd.agent.common.AbstractAgentClient;
 import org.apache.sshd.client.future.DefaultOpenFuture;
 import org.apache.sshd.client.future.OpenFuture;
+import org.apache.sshd.common.Closeable;
 import org.apache.sshd.common.FactoryManager;
 import org.apache.sshd.common.SshConstants;
 import org.apache.sshd.common.channel.ChannelOutputStream;
-import org.apache.sshd.common.future.CloseFuture;
 import org.apache.sshd.common.session.Session;
 import org.apache.sshd.common.util.GenericUtils;
 import org.apache.sshd.common.util.ValidateUtils;
@@ -110,8 +110,11 @@ public class ChannelAgentForwarding extends 
AbstractServerChannel {
 }
 
 @Override
-public CloseFuture close(boolean immediately) {
-return super.close(immediately).addListener(sshFuture -> 
closeImmediately0());
+protected Closeable getInnerCloseable() {
+return builder()
+.close(super.getInnerCloseable())
+.run(toString(), this::closeImmediately0)
+.build();
 }
 
 @Override

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/bba23bf7/sshd-core/src/main/java/org/apache/sshd/agent/unix/AgentForwardedChannel.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/agent/unix/AgentForwardedChannel.java 
b/sshd-core/src/main/java/org/apache/sshd/agent/unix/AgentForwardedChannel.java
index 1b02333..1c7b95b 100644
--- 
a/sshd-core/src/main/java/org/apache/sshd/agent/unix/AgentForwardedChannel.java
+++ 
b/sshd-core/src/main/java/org/apache/sshd/agent/unix/AgentForwardedChannel.java
@@ -22,6 +22,7 @@ import java.io.IOException;
 import java.io.OutputStream;
 
 import org.apache.sshd.client.channel.AbstractClientChannel;
+import org.apache.sshd.common.Closeable;
 import org.apache.sshd.common.SshConstants;
 import org.apache.sshd.common.channel.ChannelOutputStream;
 import org.apache.sshd.common.channel.Window;
@@ -68,9 +69,11 @@ public class AgentForwardedChannel extends 
AbstractClientChannel implements Runn
 }
 
 @Override
-protected synchronized void doCloseImmediately() {
-Socket.close(socket);
-super.doCloseImmediately();
+protected Closeable getInnerCloseable() {
+return builder()
+.close(super.getInnerCloseable())
+.run(toString(), () -> Socket.close(socket))
+.build();
 }
 
 @Override

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/bba23bf7/sshd-core/src/main/java/org/apache/sshd/agent/unix/ChannelAgentForwarding.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/agent/unix/ChannelAgentForwarding.java
 
b/sshd-core/src/main/java/org/apache/sshd/agent/unix/ChannelAgentForwarding.java
index 586faae..4a6a5ce 100644
--- 

svn commit: r24382 - in /release/mina/sshd: 1.0.0/ 1.1.0/ 1.1.1/ 1.2.0/ 1.6.0/ 1.7.0/

2018-01-23 Thread gnodet
Author: gnodet
Date: Tue Jan 23 13:41:28 2018
New Revision: 24382

Log:
Release sshd 1.7.0

Added:
release/mina/sshd/1.7.0/
release/mina/sshd/1.7.0/apache-sshd-1.7.0-src.tar.gz   (with props)
release/mina/sshd/1.7.0/apache-sshd-1.7.0-src.tar.gz.asc
release/mina/sshd/1.7.0/apache-sshd-1.7.0-src.tar.gz.md5
release/mina/sshd/1.7.0/apache-sshd-1.7.0-src.tar.gz.sha1
release/mina/sshd/1.7.0/apache-sshd-1.7.0-src.zip   (with props)
release/mina/sshd/1.7.0/apache-sshd-1.7.0-src.zip.asc
release/mina/sshd/1.7.0/apache-sshd-1.7.0-src.zip.md5
release/mina/sshd/1.7.0/apache-sshd-1.7.0-src.zip.sha1
release/mina/sshd/1.7.0/apache-sshd-1.7.0.pom
release/mina/sshd/1.7.0/apache-sshd-1.7.0.pom.asc
release/mina/sshd/1.7.0/apache-sshd-1.7.0.pom.md5
release/mina/sshd/1.7.0/apache-sshd-1.7.0.pom.sha1
release/mina/sshd/1.7.0/apache-sshd-1.7.0.tar.gz   (with props)
release/mina/sshd/1.7.0/apache-sshd-1.7.0.tar.gz.asc
release/mina/sshd/1.7.0/apache-sshd-1.7.0.tar.gz.md5
release/mina/sshd/1.7.0/apache-sshd-1.7.0.tar.gz.sha1
release/mina/sshd/1.7.0/apache-sshd-1.7.0.zip   (with props)
release/mina/sshd/1.7.0/apache-sshd-1.7.0.zip.asc
release/mina/sshd/1.7.0/apache-sshd-1.7.0.zip.md5
release/mina/sshd/1.7.0/apache-sshd-1.7.0.zip.sha1
Removed:
release/mina/sshd/1.0.0/
release/mina/sshd/1.1.0/
release/mina/sshd/1.1.1/
release/mina/sshd/1.2.0/
release/mina/sshd/1.6.0/

Added: release/mina/sshd/1.7.0/apache-sshd-1.7.0-src.tar.gz
==
Binary file - no diff available.

Propchange: release/mina/sshd/1.7.0/apache-sshd-1.7.0-src.tar.gz
--
svn:mime-type = application/octet-stream

Added: release/mina/sshd/1.7.0/apache-sshd-1.7.0-src.tar.gz.asc
==
--- release/mina/sshd/1.7.0/apache-sshd-1.7.0-src.tar.gz.asc (added)
+++ release/mina/sshd/1.7.0/apache-sshd-1.7.0-src.tar.gz.asc Tue Jan 23 
13:41:28 2018
@@ -0,0 +1,6 @@
+-BEGIN PGP SIGNATURE-
+
+iF0EABECAB0WIQTqI9sTYNkClIHn8u/s3+o8tEk7lAUCWlefbgAKCRDs3+o8tEk7
+lBZvAKCb7SkvjJefgQmvVA6GoM29PwYzxwCfS/ztXneRAPiA3MEsgdgEUoF8TLI=
+=Nuy0
+-END PGP SIGNATURE-

Added: release/mina/sshd/1.7.0/apache-sshd-1.7.0-src.tar.gz.md5
==
--- release/mina/sshd/1.7.0/apache-sshd-1.7.0-src.tar.gz.md5 (added)
+++ release/mina/sshd/1.7.0/apache-sshd-1.7.0-src.tar.gz.md5 Tue Jan 23 
13:41:28 2018
@@ -0,0 +1 @@
+94c26918fea745a38c5bbe5a97821f4d
\ No newline at end of file

Added: release/mina/sshd/1.7.0/apache-sshd-1.7.0-src.tar.gz.sha1
==
--- release/mina/sshd/1.7.0/apache-sshd-1.7.0-src.tar.gz.sha1 (added)
+++ release/mina/sshd/1.7.0/apache-sshd-1.7.0-src.tar.gz.sha1 Tue Jan 23 
13:41:28 2018
@@ -0,0 +1 @@
+2a45e6f65a7a1412b06217ee8f3d414cf7775932
\ No newline at end of file

Added: release/mina/sshd/1.7.0/apache-sshd-1.7.0-src.zip
==
Binary file - no diff available.

Propchange: release/mina/sshd/1.7.0/apache-sshd-1.7.0-src.zip
--
svn:mime-type = application/octet-stream

Added: release/mina/sshd/1.7.0/apache-sshd-1.7.0-src.zip.asc
==
--- release/mina/sshd/1.7.0/apache-sshd-1.7.0-src.zip.asc (added)
+++ release/mina/sshd/1.7.0/apache-sshd-1.7.0-src.zip.asc Tue Jan 23 13:41:28 
2018
@@ -0,0 +1,6 @@
+-BEGIN PGP SIGNATURE-
+
+iF0EABECAB0WIQTqI9sTYNkClIHn8u/s3+o8tEk7lAUCWlefbgAKCRDs3+o8tEk7
+lL2SAJ0bhnzOO9PPUY9s+8g42Oziri9JwwCfeC/IZR4E5UtcaqE44Hkl2K0Oo90=
+=7Dmd
+-END PGP SIGNATURE-

Added: release/mina/sshd/1.7.0/apache-sshd-1.7.0-src.zip.md5
==
--- release/mina/sshd/1.7.0/apache-sshd-1.7.0-src.zip.md5 (added)
+++ release/mina/sshd/1.7.0/apache-sshd-1.7.0-src.zip.md5 Tue Jan 23 13:41:28 
2018
@@ -0,0 +1 @@
+851eb391e20910a63073b58584054fd3
\ No newline at end of file

Added: release/mina/sshd/1.7.0/apache-sshd-1.7.0-src.zip.sha1
==
--- release/mina/sshd/1.7.0/apache-sshd-1.7.0-src.zip.sha1 (added)
+++ release/mina/sshd/1.7.0/apache-sshd-1.7.0-src.zip.sha1 Tue Jan 23 13:41:28 
2018
@@ -0,0 +1 @@
+b14af20d61c8733c851fbd46f617bbb13e836e08
\ No newline at end of file

Added: release/mina/sshd/1.7.0/apache-sshd-1.7.0.pom
==
--- release/mina/sshd/1.7.0/apache-sshd-1.7.0.pom (added)
+++ release/mina/sshd/1.7.0/apache-sshd-1.7.0.pom Tue Jan 23 13:41:28 2018
@@ -0,0 +1,126

svn commit: r1024187 - in /websites/production/mina/content: ./ mina-project/apidocs/ mina-project/testapidocs/ mina-project/xref-test/ mina-project/xref/ sshd-project/apidocs/

2018-01-23 Thread gnodet
Author: gnodet
Date: Tue Jan 23 13:54:47 2018
New Revision: 1024187

Log:
Publish for SSHD 1.7.0 release

Added:
websites/production/mina/content/
  - copied from r1024186, websites/staging/mina/trunk/content/
websites/production/mina/content/mina-project/apidocs/
  - copied from r1024186, 
websites/production/mina/content/mina-project/apidocs/
websites/production/mina/content/mina-project/testapidocs/
  - copied from r1024186, 
websites/production/mina/content/mina-project/testapidocs/
websites/production/mina/content/mina-project/xref/
  - copied from r1024186, 
websites/production/mina/content/mina-project/xref/
websites/production/mina/content/mina-project/xref-test/
  - copied from r1024186, 
websites/production/mina/content/mina-project/xref-test/
websites/production/mina/content/sshd-project/apidocs/
  - copied from r1024186, 
websites/production/mina/content/sshd-project/apidocs/



svn commit: r1822005 - in /mina/site/trunk: content/ content/sshd-project/ lib/

2018-01-23 Thread gnodet
Author: gnodet
Date: Tue Jan 23 13:48:13 2018
New Revision: 1822005

URL: http://svn.apache.org/viewvc?rev=1822005=rev
Log:
Release SSHD 1.7.0 and fix previous releases

Added:
mina/site/trunk/content/sshd-project/download_1.3.0.mdtext
mina/site/trunk/content/sshd-project/download_1.4.0.mdtext
mina/site/trunk/content/sshd-project/download_1.7.0.mdtext
Modified:
mina/site/trunk/content/downloads-sshd.mdtext
mina/site/trunk/content/sshd-project/download_0.14.0.mdtext
mina/site/trunk/content/sshd-project/download_1.0.0.mdtext
mina/site/trunk/content/sshd-project/download_1.1.0.mdtext
mina/site/trunk/content/sshd-project/download_1.1.1.mdtext
mina/site/trunk/content/sshd-project/download_1.2.0.mdtext
mina/site/trunk/content/sshd-project/download_1.6.0.mdtext
mina/site/trunk/content/sshd-project/downloads.mdtext
mina/site/trunk/lib/path.pm

Modified: mina/site/trunk/content/downloads-sshd.mdtext
URL: 
http://svn.apache.org/viewvc/mina/site/trunk/content/downloads-sshd.mdtext?rev=1822005=1822004=1822005=diff
==
--- mina/site/trunk/content/downloads-sshd.mdtext (original)
+++ mina/site/trunk/content/downloads-sshd.mdtext Tue Jan 23 13:48:13 2018
@@ -18,14 +18,14 @@ Notice:Licensed to the Apache Softwa
 
 # Latest SSHD Releases
 
-The latest release is the SSHD 1.6.0 release.
+The latest release is the SSHD 1.7.0 release.
  
 * Source distributions:
-* [Apache Mina SSHD 1.6.0 Sources 
(.tar.gz)](http://www.apache.org/dyn/closer.lua/mina/sshd/1.6.0/apache-sshd-1.6.0-src.tar.gz)
 
[PGP](http://www.apache.org/dist/mina/sshd/1.6.0/apache-sshd-1.6.0-src.tar.gz.asc)
 
[SHA](http://www.apache.org/dist/mina/sshd/1.6.0/apache-sshd-1.6.0-src.tar.gz.sha1)
 
[MD5](http://www.apache.org/dist/mina/sshd/1.6.0/apache-sshd-1.6.0-src.tar.gz.md5)
-* [Apache Mina SSHD 1.6.0 Sources 
(.zip)](http://www.apache.org/dyn/closer.lua/mina/sshd/1.6.0/apache-sshd-1.6.0-src.zip)
 
[PGP](http://www.apache.org/dist/mina/sshd/1.6.0/apache-sshd-1.6.0-src.zip.asc) 
[SHA](http://www.apache.org/dist/mina/sshd/1.6.0/apache-sshd-1.6.0-src.zip.sha1)
 [MD5](http://www.apache.org/dist/mina/sshd/1.6.0/apache-sshd-1.6.0-src.zip.md5)
+* [Apache Mina SSHD 1.7.0 Sources 
(.tar.gz)](http://www.apache.org/dyn/closer.lua/mina/sshd/1.7.0/apache-sshd-1.7.0-src.tar.gz)
 
[PGP](http://www.apache.org/dist/mina/sshd/1.7.0/apache-sshd-1.7.0-src.tar.gz.asc)
 
[SHA](http://www.apache.org/dist/mina/sshd/1.7.0/apache-sshd-1.7.0-src.tar.gz.sha1)
 
[MD5](http://www.apache.org/dist/mina/sshd/1.7.0/apache-sshd-1.7.0-src.tar.gz.md5)
+* [Apache Mina SSHD 1.7.0 Sources 
(.zip)](http://www.apache.org/dyn/closer.lua/mina/sshd/1.7.0/apache-sshd-1.7.0-src.zip)
 
[PGP](http://www.apache.org/dist/mina/sshd/1.7.0/apache-sshd-1.7.0-src.zip.asc) 
[SHA](http://www.apache.org/dist/mina/sshd/1.7.0/apache-sshd-1.7.0-src.zip.sha1)
 [MD5](http://www.apache.org/dist/mina/sshd/1.7.0/apache-sshd-1.7.0-src.zip.md5)
 * Binary distributions:
-* [Apache Mina SSHD 1.6.0 Binary 
(.tar.gz)](http://www.apache.org/dyn/closer.lua/mina/sshd/1.6.0/dist/apache-sshd-1.6.0.tar.gz)
 
[PGP](http://www.apache.org/dist/mina/sshd/1.6.0/dist/apache-sshd-1.6.0.tar.gz.asc)
 
[SHA](http://www.apache.org/dist/mina/sshd/1.6.0/dist/apache-sshd-1.6.0.tar.gz.sha1)
 
[MD5](http://www.apache.org/dist/mina/sshd/1.6.0/dist/apache-sshd-1.6.0.tar.gz.md5)
-* [Apache Mina SSHD 1.6.0 Binary 
(.zip)](http://www.apache.org/dyn/closer.lua/mina/sshd/1.6.0/dist/apache-sshd-1.6.0.zip)
 
[PGP](http://www.apache.org/dist/mina/sshd/1.6.0/dist/apache-sshd-1.6.0.zip.asc)
 
[SHA](http://www.apache.org/dist/mina/sshd/1.6.0/dist/apache-sshd-1.6.0.zip.sha1)
 
[MD5](http://www.apache.org/dist/mina/sshd/1.6.0/dist/apache-sshd-1.6.0.zip.md5)
+* [Apache Mina SSHD 1.7.0 Binary 
(.tar.gz)](http://www.apache.org/dyn/closer.lua/mina/sshd/1.7.0/dist/apache-sshd-1.7.0.tar.gz)
 
[PGP](http://www.apache.org/dist/mina/sshd/1.7.0/dist/apache-sshd-1.7.0.tar.gz.asc)
 
[SHA](http://www.apache.org/dist/mina/sshd/1.7.0/dist/apache-sshd-1.7.0.tar.gz.sha1)
 
[MD5](http://www.apache.org/dist/mina/sshd/1.7.0/dist/apache-sshd-1.7.0.tar.gz.md5)
+* [Apache Mina SSHD 1.7.0 Binary 
(.zip)](http://www.apache.org/dyn/closer.lua/mina/sshd/1.7.0/dist/apache-sshd-1.7.0.zip)
 
[PGP](http://www.apache.org/dist/mina/sshd/1.7.0/dist/apache-sshd-1.7.0.zip.asc)
 
[SHA](http://www.apache.org/dist/mina/sshd/1.7.0/dist/apache-sshd-1.7.0.zip.sha1)
 
[MD5](http://www.apache.org/dist/mina/sshd/1.7.0/dist/apache-sshd-1.7.0.zip.md5)
 
 # Development snapshots
 
@@ -52,3 +52,6 @@ You can [build](sshd-project/building.ht
 * [SSHD 1.1.0](sshd-project/download_1.1.0.html)
 * [SSHD 1.1.1](sshd-project/download_1.1.1.html)
 * [SSHD 1.2.0](sshd-project/download_1.2.0.html)
+* [SSHD 1.3.0](sshd-project/download_1.3.0.html)
+* [SSHD 1.4.0](sshd-project/download_1.4.0.html)
+* [SSHD 1.6.0](sshd-project/download_1.6.0.html)

Modified: mina/site

mina-sshd git commit: [SSHD-812] Improve Window performance

2018-04-10 Thread gnodet
Repository: mina-sshd
Updated Branches:
  refs/heads/master 4651d235b -> 3c9efa8a5


[SSHD-812] Improve Window performance

Do not use an AtomicLong since all accesses are synchronized anyway


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/3c9efa8a
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/3c9efa8a
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/3c9efa8a

Branch: refs/heads/master
Commit: 3c9efa8a53ded17622b0b193e9439eeda7a21218
Parents: 4651d23
Author: Guillaume Nodet 
Authored: Tue Apr 10 14:46:04 2018 +0200
Committer: Guillaume Nodet 
Committed: Tue Apr 10 15:38:54 2018 +0200

--
 .../org/apache/sshd/common/channel/Window.java  | 21 ++--
 1 file changed, 10 insertions(+), 11 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/3c9efa8a/sshd-core/src/main/java/org/apache/sshd/common/channel/Window.java
--
diff --git a/sshd-core/src/main/java/org/apache/sshd/common/channel/Window.java 
b/sshd-core/src/main/java/org/apache/sshd/common/channel/Window.java
index a07c045..5eebb4b 100644
--- a/sshd-core/src/main/java/org/apache/sshd/common/channel/Window.java
+++ b/sshd-core/src/main/java/org/apache/sshd/common/channel/Window.java
@@ -24,7 +24,6 @@ import java.net.SocketTimeoutException;
 import java.util.Objects;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicLong;
 import java.util.function.Predicate;
 
 import org.apache.sshd.common.FactoryManager;
@@ -48,16 +47,16 @@ public class Window extends AbstractLoggingBean implements 
java.nio.channels.Cha
  */
 public static final Predicate SPACE_AVAILABLE_PREDICATE = input -> 
{
 // NOTE: we do not call "getSize()" on purpose in order to avoid the 
lock
-return input.sizeHolder.get() > 0;
+return input.size > 0;
 };
 
 private final AtomicBoolean closed = new AtomicBoolean(false);
 private final AtomicBoolean initialized = new AtomicBoolean(false);
-private final AtomicLong sizeHolder = new AtomicLong(0L);
 private final AbstractChannel channelInstance;
 private final Object lock;
 private final String suffix;
 
+private long size; // the window size
 private long maxSize;   // actually uint32
 private long packetSize;   // actually uint32
 
@@ -74,7 +73,7 @@ public class Window extends AbstractLoggingBean implements 
java.nio.channels.Cha
 
 public long getSize() {
 synchronized (lock) {
-return sizeHolder.get();
+return size;
 }
 }
 
@@ -132,7 +131,7 @@ public class Window extends AbstractLoggingBean implements 
java.nio.channels.Cha
  *  of up to 2^32 - 1 bytes.  The window MUST NOT be increased 
above
  *  2^32 - 1 bytes.
  */
-expandedSize = sizeHolder.get() + window;
+expandedSize = size + window;
 if (expandedSize > BufferUtils.MAX_UINT32_VALUE) {
 updateSize(BufferUtils.MAX_UINT32_VALUE);
 } else {
@@ -153,7 +152,7 @@ public class Window extends AbstractLoggingBean implements 
java.nio.channels.Cha
 
 long remainLen;
 synchronized (lock) {
-remainLen = sizeHolder.get() - len;
+remainLen = size - len;
 if (remainLen >= 0L) {
 updateSize(remainLen);
 }
@@ -190,7 +189,7 @@ public class Window extends AbstractLoggingBean implements 
java.nio.channels.Cha
 AbstractChannel channel = getChannel();
 synchronized (lock) {
 // TODO make the adjust factor configurable via FactoryManager 
property
-long size = sizeHolder.get();
+long size = this.size;
 if (size < (maxFree / 2)) {
 adjustSize = maxFree - size;
 channel.sendWindowAdjust(adjustSize);
@@ -224,11 +223,11 @@ public class Window extends AbstractLoggingBean 
implements java.nio.channels.Cha
 synchronized (lock) {
 waitForCondition(input -> {
 // NOTE: we do not call "getSize()" on purpose in order to 
avoid the lock
-return input.sizeHolder.get() >= len;
+return input.size >= len;
 }, maxWaitTime);
 
 if (debugEnabled) {
-log.debug("waitAndConsume({}) - requested={}, available={}", 
this, len, sizeHolder);
+log.debug("waitAndConsume({}) - requested={}, available={}", 
this, len, size);
 }
 
 consume(len);
@@ -251,7 +250,7 @@ public class Window extends AbstractLoggingBean implements 

[mina-sshd] Git Push Summary

2018-04-09 Thread gnodet
Repository: mina-sshd
Updated Branches:
  refs/heads/SSHD-812-async [deleted] e05aa13c7


mina-sshd git commit: [SSHD-812] Make SftpSubsystem a bit more asynchronous

2018-04-09 Thread gnodet
Repository: mina-sshd
Updated Branches:
  refs/heads/SSHD-812-async [created] e05aa13c7


[SSHD-812] Make SftpSubsystem a bit more asynchronous


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/e05aa13c
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/e05aa13c
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/e05aa13c

Branch: refs/heads/SSHD-812-async
Commit: e05aa13c781d135105700f5aba314c4788c1c613
Parents: 4651d23
Author: Guillaume Nodet 
Authored: Mon Apr 9 10:05:32 2018 +0200
Committer: Guillaume Nodet 
Committed: Mon Apr 9 10:05:32 2018 +0200

--
 .../sshd/server/channel/ChannelSession.java |   4 +-
 .../sftp/AbstractSftpSubsystemHelper.java   | 124 +++--
 .../server/subsystem/sftp/SftpSubsystem.java| 186 +--
 3 files changed, 167 insertions(+), 147 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/e05aa13c/sshd-core/src/main/java/org/apache/sshd/server/channel/ChannelSession.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/server/channel/ChannelSession.java 
b/sshd-core/src/main/java/org/apache/sshd/server/channel/ChannelSession.java
index 806d6c7..bcc1e33 100644
--- a/sshd-core/src/main/java/org/apache/sshd/server/channel/ChannelSession.java
+++ b/sshd-core/src/main/java/org/apache/sshd/server/channel/ChannelSession.java
@@ -667,7 +667,9 @@ public class ChannelSession extends AbstractServerChannel {
 if (this.receiver == null) {
 // if the command hasn't installed any ChannelDataReceiver, 
install the default
 // and give the command an InputStream
-if (command instanceof AsyncCommand) {
+if (command instanceof ChannelDataReceiver) {
+setDataReceiver((ChannelDataReceiver) command);
+} else if (command instanceof AsyncCommand) {
 AsyncDataReceiver recv = new AsyncDataReceiver(this);
 setDataReceiver(recv);
 ((AsyncCommand) command).setIoInputStream(recv.getIn());

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/e05aa13c/sshd-core/src/main/java/org/apache/sshd/server/subsystem/sftp/AbstractSftpSubsystemHelper.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/server/subsystem/sftp/AbstractSftpSubsystemHelper.java
 
b/sshd-core/src/main/java/org/apache/sshd/server/subsystem/sftp/AbstractSftpSubsystemHelper.java
index 08213ee..027b8c2 100644
--- 
a/sshd-core/src/main/java/org/apache/sshd/server/subsystem/sftp/AbstractSftpSubsystemHelper.java
+++ 
b/sshd-core/src/main/java/org/apache/sshd/server/subsystem/sftp/AbstractSftpSubsystemHelper.java
@@ -312,7 +312,7 @@ public abstract class AbstractSftpSubsystemHelper
 }
 
 if ((proposed < low) || (proposed > hig)) {
-sendStatus(BufferUtils.clear(buffer), id, failureOpcode, "Proposed 
version (" + proposed + ") not in supported range: " + available);
+sendStatus(buffer, id, failureOpcode, "Proposed version (" + 
proposed + ") not in supported range: " + available);
 return null;
 }
 
@@ -379,11 +379,11 @@ public abstract class AbstractSftpSubsystemHelper
 try {
 handle = doOpen(id, path, pflags, access, attrs);
 } catch (IOException | RuntimeException e) {
-sendStatus(BufferUtils.clear(buffer), id, e, 
SftpConstants.SSH_FXP_OPEN, path);
+sendStatus(buffer, id, e, SftpConstants.SSH_FXP_OPEN, path);
 return;
 }
 
-sendHandle(BufferUtils.clear(buffer), id, handle);
+sendHandle(buffer, id, handle);
 }
 
 /**
@@ -402,11 +402,11 @@ public abstract class AbstractSftpSubsystemHelper
 try {
 doClose(id, handle);
 } catch (IOException | RuntimeException e) {
-sendStatus(BufferUtils.clear(buffer), id, e, 
SftpConstants.SSH_FXP_CLOSE, handle);
+sendStatus(buffer, id, e, SftpConstants.SSH_FXP_CLOSE, handle);
 return;
 }
 
-sendStatus(BufferUtils.clear(buffer), id, SftpConstants.SSH_FX_OK, "", 
"");
+sendStatus(buffer, id, SftpConstants.SSH_FX_OK, "", "");
 }
 
 protected abstract void doClose(int id, String handle) throws IOException;
@@ -428,6 +428,7 @@ public abstract class AbstractSftpSubsystemHelper
 
 buffer.clear();
 buffer.ensureCapacity(readLen + Long.SIZE /* the header */, 
IntUnaryOperator.identity());
+buffer.putInt(0);
 
 buffer.putByte((byte) SftpConstants.SSH_FXP_DATA);
 buffer.putInt(id);
@@ -442,7 +443,7 @@ public abstract class 

mina-sshd git commit: [SSHD-815] Add log4j test file for sftp

2018-04-17 Thread gnodet
Repository: mina-sshd
Updated Branches:
  refs/heads/master 5bb17b5f4 -> 76fe82188


[SSHD-815] Add log4j test file for sftp


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/76fe8218
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/76fe8218
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/76fe8218

Branch: refs/heads/master
Commit: 76fe821888d28fd3f73c6a757f3990680082b3ed
Parents: 5bb17b5
Author: Guillaume Nodet 
Authored: Tue Apr 17 09:38:56 2018 +0200
Committer: Guillaume Nodet 
Committed: Tue Apr 17 10:06:22 2018 +0200

--
 sshd-sftp/src/test/resources/log4j.properties | 38 ++
 1 file changed, 38 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/76fe8218/sshd-sftp/src/test/resources/log4j.properties
--
diff --git a/sshd-sftp/src/test/resources/log4j.properties 
b/sshd-sftp/src/test/resources/log4j.properties
new file mode 100644
index 000..4e4dd65
--- /dev/null
+++ b/sshd-sftp/src/test/resources/log4j.properties
@@ -0,0 +1,38 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed  under the  License is distributed on an "AS IS" BASIS,
+# WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+# implied.
+#
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+#
+
+#
+# The logging properties used during tests..
+#
+log4j.rootLogger=INFO, stdout, logfile
+#log4j.logger.org.apache.sshd=TRACE
+#log4j.logger.org.apache.sshd.common.channel.Window=DEBUG
+
+# CONSOLE appender
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d | %-5.5p | %-16.16t | 
%-32.32c{1} | %-64.64C %4L | %m%n
+
+# File appender
+log4j.appender.logfile=org.apache.log4j.FileAppender
+log4j.appender.logfile.layout=org.apache.log4j.PatternLayout
+log4j.appender.logfile.layout.ConversionPattern=%d | %-5.5p | %-16.16t | 
%-32.32c{1} | %-64.64C %4L | %m%n
+log4j.appender.logfile.file=target/sshd-core-tests.log
+log4j.appender.logfile.append=true



mina-sshd git commit: Fix tests using the wrong IO provider

2018-04-18 Thread gnodet
Repository: mina-sshd
Updated Branches:
  refs/heads/master 04c579408 -> fbbefe1e6


Fix tests using the wrong IO provider


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/fbbefe1e
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/fbbefe1e
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/fbbefe1e

Branch: refs/heads/master
Commit: fbbefe1e6aa1dd92f3953ef3d0f33cee3d482ca6
Parents: 04c5794
Author: Guillaume Nodet 
Authored: Wed Apr 18 10:19:11 2018 +0200
Committer: Guillaume Nodet 
Committed: Wed Apr 18 10:19:11 2018 +0200

--
 .../apache/sshd/util/test/BaseTestSupport.java  | 10 +-
 sshd-git/pom.xml|  4 ++--
 sshd-mina/pom.xml   |  3 ++-
 ...pache.sshd.common.io.IoServiceFactoryFactory | 20 
 ...pache.sshd.common.io.IoServiceFactoryFactory | 20 
 sshd-sftp/pom.xml   |  4 ++--
 6 files changed, 35 insertions(+), 26 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/fbbefe1e/sshd-core/src/test/java/org/apache/sshd/util/test/BaseTestSupport.java
--
diff --git 
a/sshd-core/src/test/java/org/apache/sshd/util/test/BaseTestSupport.java 
b/sshd-core/src/test/java/org/apache/sshd/util/test/BaseTestSupport.java
index 2263217..87dd4e6 100644
--- a/sshd-core/src/test/java/org/apache/sshd/util/test/BaseTestSupport.java
+++ b/sshd-core/src/test/java/org/apache/sshd/util/test/BaseTestSupport.java
@@ -52,6 +52,8 @@ import java.util.Objects;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.sshd.client.SshClient;
+import org.apache.sshd.common.io.DefaultIoServiceFactoryFactory;
+import org.apache.sshd.common.io.IoServiceFactoryFactory;
 import org.apache.sshd.common.keyprovider.KeyPairProvider;
 import org.apache.sshd.common.util.GenericUtils;
 import org.apache.sshd.common.util.io.IoUtils;
@@ -95,7 +97,13 @@ public abstract class BaseTestSupport extends Assert {
 
 @Override
 protected void starting(Description description) {
-System.out.println("\nStarting " + description.getClassName() + 
":" + description.getMethodName() + "...\n");
+System.out.println("\nStarting " + description.getClassName() + 
":" + description.getMethodName() + "...");
+try {
+System.out.println("Using provider: " + 
DefaultIoServiceFactoryFactory.newInstance(IoServiceFactoryFactory.class).getClass().getName());
+} catch (Throwable t) {
+// Ignore
+}
+System.out.println();
 startTime = System.currentTimeMillis();
 }
 

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/fbbefe1e/sshd-git/pom.xml
--
diff --git a/sshd-git/pom.xml b/sshd-git/pom.xml
index abae18f..529744f 100644
--- a/sshd-git/pom.xml
+++ b/sshd-git/pom.xml
@@ -113,7 +113,7 @@
 true
 
${project.build.directory}/surefire-reports-nio2
 
-
org.apache.sshd.common.io.nio2.Nio2ServiceFactory
+
org.apache.sshd.common.io.nio2.Nio2ServiceFactoryFactory
 
 
 
@@ -158,7 +158,7 @@
 
true
 
${project.build.directory}/surefire-reports-mina
 
-
org.apache.sshd.common.io.mina.MinaServiceFactory
+
org.apache.sshd.common.io.mina.MinaServiceFactoryFactory
 
 
 

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/fbbefe1e/sshd-mina/pom.xml
--
diff --git a/sshd-mina/pom.xml b/sshd-mina/pom.xml
index 71ada5a..5f0588f 100644
--- a/sshd-mina/pom.xml
+++ b/sshd-mina/pom.xml
@@ -164,7 +164,7 @@
 true
 
${project.build.directory}/surefire-reports-mina
 
-
org.apache.sshd.common.io.mina.MinaServiceFactory
+
org.apache.sshd.common.io.mina.MinaServiceFactoryFactory
 
 
 
@@ -179,6 +179,7 @@
 **/PortForwardingTest.java
 **/MacTest.java
 **/SpringConfigTest.java
+**/ConcurrentConnectionTest.java
 
 

[1/2] mina-sshd git commit: [SSHD-821] Support for async keyboard authentication

2018-04-19 Thread gnodet
Repository: mina-sshd
Updated Branches:
  refs/heads/master 5fc90bd04 -> 598c991fe


[SSHD-821] Support for async keyboard authentication


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/5c1c8a98
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/5c1c8a98
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/5c1c8a98

Branch: refs/heads/master
Commit: 5c1c8a9830ad5b622b15055bfc7205aa2fd53e98
Parents: 5fc90bd
Author: Guillaume Nodet 
Authored: Wed Apr 18 14:17:28 2018 +0200
Committer: Guillaume Nodet 
Committed: Thu Apr 19 08:42:02 2018 +0200

--
 .../sshd/server/auth/AsyncAuthException.java|  94 
 .../org/apache/sshd/server/auth/UserAuth.java   |   6 +-
 .../auth/password/PasswordAuthenticator.java|   5 +-
 .../auth/pubkey/PublickeyAuthenticator.java |   4 +-
 .../server/session/ServerUserAuthService.java   |  21 ++-
 .../server/auth/AsyncAuthInteractiveTest.java   | 106 +
 .../apache/sshd/server/auth/AsyncAuthTest.java  | 103 +
 .../sshd/server/auth/AsyncAuthTestBase.java | 147 +++
 sshd-mina/pom.xml   |   2 +
 9 files changed, 483 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/5c1c8a98/sshd-core/src/main/java/org/apache/sshd/server/auth/AsyncAuthException.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/server/auth/AsyncAuthException.java 
b/sshd-core/src/main/java/org/apache/sshd/server/auth/AsyncAuthException.java
new file mode 100644
index 000..0a95986
--- /dev/null
+++ 
b/sshd-core/src/main/java/org/apache/sshd/server/auth/AsyncAuthException.java
@@ -0,0 +1,94 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.sshd.server.auth;
+
+import java.lang.reflect.Array;
+import java.util.function.Consumer;
+
+import org.apache.sshd.common.RuntimeSshException;
+
+/**
+ *
+ *
+ * @author mailto:d...@mina.apache.org;>Apache MINA SSHD Project
+ */
+public class AsyncAuthException extends RuntimeSshException {
+
+private static final long serialVersionUID = 6741236101797649869L;
+
+protected Object listener;
+protected Boolean authed;
+
+public AsyncAuthException() {
+super();
+}
+
+public void setAuthed(boolean authed) {
+Object listener;
+synchronized (this) {
+if (this.authed != null) {
+return;
+}
+this.authed = authed;
+listener = this.listener;
+}
+if (listener != null) {
+if (listener instanceof Consumer) {
+asListener(listener).accept(authed);
+} else {
+int l = Array.getLength(listener);
+for (int i = 0; i < l; i++) {
+Consumer lst = asListener(Array.get(listener, i));
+if (lst != null) {
+lst.accept(authed);
+}
+}
+}
+}
+}
+
+@SuppressWarnings("unchecked")
+protected static Consumer asListener(Object listener) {
+return (Consumer) listener;
+}
+
+public void addListener(Consumer listener) {
+Boolean result;
+synchronized (this) {
+if (this.listener == null) {
+this.listener = listener;
+} else if (this.listener instanceof Consumer) {
+this.listener = new Object[] {this.listener, listener };
+} else {
+Object[] ol = (Object[]) this.listener;
+int l = ol.length;
+Object[] nl = new Object[l + 1];
+System.arraycopy(ol, 0, nl, 0, l);
+nl[l] = listener;
+this.listener = nl;
+}
+result = this.authed;
+}
+if (result != null) {
+listener.accept(result);
+}
+}
+
+}


[2/2] mina-sshd git commit: [SSHD-817] Netty nio provider

2018-04-19 Thread gnodet
[SSHD-817] Netty nio provider


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/598c991f
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/598c991f
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/598c991f

Branch: refs/heads/master
Commit: 598c991fe4cc609c43f972fe025775fcf734933b
Parents: 5c1c8a9
Author: Guillaume Nodet 
Authored: Tue Apr 17 22:16:55 2018 +0200
Committer: Guillaume Nodet 
Committed: Thu Apr 19 08:43:30 2018 +0200

--
 pom.xml |   1 +
 sshd-netty/pom.xml  | 214 +++
 .../org/apache/sshd/netty/NettyIoAcceptor.java  | 174 +++
 .../org/apache/sshd/netty/NettyIoConnector.java | 125 +++
 .../org/apache/sshd/netty/NettyIoService.java   |  55 +
 .../sshd/netty/NettyIoServiceFactory.java   |  75 +++
 .../netty/NettyIoServiceFactoryFactory.java |  49 +
 .../org/apache/sshd/netty/NettyIoSession.java   | 211 ++
 .../org/apache/sshd/netty/NettySupport.java |  45 
 ...pache.sshd.common.io.IoServiceFactoryFactory |  20 ++
 10 files changed, 969 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/598c991f/pom.xml
--
diff --git a/pom.xml b/pom.xml
index e3f9353..1d75f92 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1007,6 +1007,7 @@
 sshd-core
 sshd-sftp
 sshd-mina
+sshd-netty
 sshd-ldap
 sshd-git
 sshd-contrib

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/598c991f/sshd-netty/pom.xml
--
diff --git a/sshd-netty/pom.xml b/sshd-netty/pom.xml
new file mode 100644
index 000..fdb0f3e
--- /dev/null
+++ b/sshd-netty/pom.xml
@@ -0,0 +1,214 @@
+http://maven.apache.org/POM/4.0.0; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd;>
+
+
+
+
+4.0.0
+
+
+org.apache.sshd
+sshd
+1.7.1-SNAPSHOT
+..
+
+
+sshd-netty
+Apache Mina SSHD :: Netty
+jar
+2008
+
+
+${project.basedir}/..
+4.1.1.Final
+
+
+
+
+org.apache.sshd
+sshd-core
+${project.version}
+
+
+io.netty
+netty-transport
+${netty.version}
+
+
+io.netty
+netty-handler
+${netty.version}
+
+
+
+
+org.apache.sshd
+sshd-core
+${project.version}
+test-jar
+test
+
+
+org.apache.sshd
+sshd-sftp
+${project.version}
+test
+
+
+net.i2p.crypto
+eddsa
+test
+
+
+org.slf4j
+jcl-over-slf4j
+test
+
+
+org.slf4j
+slf4j-log4j12
+test
+
+
+com.jcraft
+jsch
+test
+
+
+com.jcraft
+jzlib
+test
+
+
+org.springframework
+spring-context
+test
+
+
+junit
+junit
+test
+
+
+org.mockito
+mockito-core
+test
+
+
+commons-httpclient
+commons-httpclient
+test
+
+
+ch.ethz.ganymed
+ganymed-ssh2
+test
+
+
+org.apache.servicemix.bundles
+
org.apache.servicemix.bundles.not-yet-commons-ssl
+test
+
+
+
+
+
${build.directory}/test-sources
+
+
+${build.directory}/test-resources
+
+
+
+
+org.apache.maven.plugins
+maven-resources-plugin
+
+
+copy-test-resources
+generate-test-resources
+
+copy-resources
+
+
+
${build.directory}/test-resources
+
+
+
${projectRoot}/sshd-core/src/test/resources
+
+
+
+
+   

mina-sshd git commit: [SSHD-817] Add netty tests to sshd-git [Forced Update!]

2018-04-19 Thread gnodet
Repository: mina-sshd
Updated Branches:
  refs/heads/master 0fdfc6ddf -> 91592c0f1 (forced update)


[SSHD-817] Add netty tests to sshd-git


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/91592c0f
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/91592c0f
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/91592c0f

Branch: refs/heads/master
Commit: 91592c0f1f7dfc3b025f2082918782fac570175f
Parents: ec9c0d8
Author: Guillaume Nodet 
Authored: Thu Apr 19 10:41:46 2018 +0200
Committer: Guillaume Nodet 
Committed: Thu Apr 19 11:05:37 2018 +0200

--
 sshd-git/pom.xml | 40 
 1 file changed, 40 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/91592c0f/sshd-git/pom.xml
--
diff --git a/sshd-git/pom.xml b/sshd-git/pom.xml
index 4cf0873..37c19d5 100644
--- a/sshd-git/pom.xml
+++ b/sshd-git/pom.xml
@@ -207,5 +207,45 @@
 
 
 
+
+
+test-netty
+
+true
+
+
+
+
+org.apache.sshd
+sshd-netty
+${project.version}
+test
+
+
+
+
+
+
+org.apache.maven.plugins
+maven-surefire-plugin
+
+
+netty
+
+test
+
+
+
true
+
${project.build.directory}/surefire-reports-netty
+
+
org.apache.sshd.netty.NettyIoServiceFactoryFactory
+
+
+
+
+
+
+
+
 
 



[05/30] mina-sshd git commit: [SSHD-815] Extract SFTP in its own module

2018-04-16 Thread gnodet
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/251db9b9/sshd-sftp/src/test/java/org/apache/sshd/client/simple/SimpleSftpClientTest.java
--
diff --git 
a/sshd-sftp/src/test/java/org/apache/sshd/client/simple/SimpleSftpClientTest.java
 
b/sshd-sftp/src/test/java/org/apache/sshd/client/simple/SimpleSftpClientTest.java
new file mode 100644
index 000..d48a19d
--- /dev/null
+++ 
b/sshd-sftp/src/test/java/org/apache/sshd/client/simple/SimpleSftpClientTest.java
@@ -0,0 +1,129 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.sshd.client.simple;
+
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.Collections;
+import java.util.EnumSet;
+
+import org.apache.sshd.client.subsystem.sftp.SftpClient;
+import org.apache.sshd.common.file.FileSystemFactory;
+import org.apache.sshd.common.file.virtualfs.VirtualFileSystemFactory;
+import org.apache.sshd.common.session.Session;
+import org.apache.sshd.common.subsystem.sftp.SftpConstants;
+import org.apache.sshd.common.util.io.IoUtils;
+import org.apache.sshd.server.scp.ScpCommandFactory;
+import org.apache.sshd.server.subsystem.sftp.SftpSubsystemFactory;
+import org.apache.sshd.util.test.Utils;
+import org.junit.FixMethodOrder;
+import org.junit.Test;
+import org.junit.runners.MethodSorters;
+
+/**
+ * @author mailto:d...@mina.apache.org;>Apache MINA SSHD Project
+ */
+@FixMethodOrder(MethodSorters.NAME_ASCENDING)
+public class SimpleSftpClientTest extends BaseSimpleClientTestSupport {
+private final Path targetPath;
+private final Path parentPath;
+private final FileSystemFactory fileSystemFactory;
+private SimpleSftpClient sftpClient;
+
+public SimpleSftpClientTest() throws Exception {
+targetPath = detectTargetFolder();
+parentPath = targetPath.getParent();
+fileSystemFactory = new VirtualFileSystemFactory(parentPath);
+}
+
+@Override
+public void setUp() throws Exception {
+super.setUp();
+sshd.setSubsystemFactories(Collections.singletonList(new 
SftpSubsystemFactory()));
+sshd.setCommandFactory(new ScpCommandFactory());
+sshd.setFileSystemFactory(fileSystemFactory);
+client.start();
+sftpClient = new SimpleSftpClientImpl(simple);
+}
+
+@Test
+public void testSessionClosedWhenClientClosed() throws Exception {
+try (SftpClient sftp = login()) {
+assertTrue("SFTP not open", sftp.isOpen());
+
+Session session = sftp.getClientSession();
+assertTrue("Session not open", session.isOpen());
+
+sftp.close();
+assertFalse("Session not closed", session.isOpen());
+assertFalse("SFTP not closed", sftp.isOpen());
+}
+}
+
+@Test
+public void testSftpProxyCalls() throws Exception {
+Path lclSftp = Utils.resolve(targetPath, 
SftpConstants.SFTP_SUBSYSTEM_NAME, getClass().getSimpleName(), 
getCurrentTestName());
+Utils.deleteRecursive(lclSftp);
+Path clientFolder = 
assertHierarchyTargetFolderExists(lclSftp).resolve("client");
+Path clientFile = clientFolder.resolve("file.txt");
+String remoteFileDir = Utils.resolveRelativeRemotePath(parentPath, 
clientFolder);
+String clientFileName = clientFile.getFileName().toString();
+String remoteFilePath = remoteFileDir + "/" + clientFileName;
+
+try (SftpClient sftp = login()) {
+sftp.mkdir(remoteFileDir);
+
+byte[] written = (getClass().getSimpleName() + "#" + 
getCurrentTestName() + IoUtils.EOL).getBytes(StandardCharsets.UTF_8);
+try (SftpClient.CloseableHandle h = sftp.open(remoteFilePath, 
EnumSet.of(SftpClient.OpenMode.Write, SftpClient.OpenMode.Create))) {
+sftp.write(h, 0L, written);
+
+SftpClient.Attributes attrs = sftp.stat(h);
+assertNotNull("No handle attributes", attrs);
+assertEquals("Mismatched remote file size", written.length, 
attrs.getSize());
+}
+
+assertTrue("Remote file not 

[25/30] mina-sshd git commit: [SSHD-815] Extract SFTP in its own module

2018-04-16 Thread gnodet
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/251db9b9/sshd-core/src/main/java/org/apache/sshd/client/subsystem/sftp/impl/AbstractSftpClient.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/client/subsystem/sftp/impl/AbstractSftpClient.java
 
b/sshd-core/src/main/java/org/apache/sshd/client/subsystem/sftp/impl/AbstractSftpClient.java
deleted file mode 100644
index 70d0279..000
--- 
a/sshd-core/src/main/java/org/apache/sshd/client/subsystem/sftp/impl/AbstractSftpClient.java
+++ /dev/null
@@ -1,1188 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.sshd.client.subsystem.sftp.impl;
-
-import java.io.IOException;
-import java.nio.charset.Charset;
-import java.nio.file.attribute.FileTime;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.EnumSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.concurrent.atomic.AtomicReference;
-
-import org.apache.sshd.client.channel.ClientChannel;
-import org.apache.sshd.client.subsystem.AbstractSubsystemClient;
-import org.apache.sshd.client.subsystem.sftp.RawSftpClient;
-import org.apache.sshd.client.subsystem.sftp.SftpClient;
-import 
org.apache.sshd.client.subsystem.sftp.extensions.BuiltinSftpClientExtensions;
-import org.apache.sshd.client.subsystem.sftp.extensions.SftpClientExtension;
-import 
org.apache.sshd.client.subsystem.sftp.extensions.SftpClientExtensionFactory;
-import org.apache.sshd.common.SshException;
-import org.apache.sshd.common.channel.Channel;
-import org.apache.sshd.common.subsystem.sftp.SftpConstants;
-import org.apache.sshd.common.subsystem.sftp.SftpException;
-import org.apache.sshd.common.subsystem.sftp.SftpHelper;
-import org.apache.sshd.common.subsystem.sftp.extensions.ParserUtils;
-import org.apache.sshd.common.util.GenericUtils;
-import org.apache.sshd.common.util.ValidateUtils;
-import org.apache.sshd.common.util.buffer.Buffer;
-import org.apache.sshd.common.util.buffer.ByteArrayBuffer;
-
-
-/**
- * @author mailto:d...@mina.apache.org;>Apache MINA SSHD Project
- */
-public abstract class AbstractSftpClient extends AbstractSubsystemClient 
implements SftpClient, RawSftpClient {
-private final Attributes fileOpenAttributes = new Attributes();
-private final AtomicReference> parsedExtensionsHolder 
= new AtomicReference<>(null);
-
-protected AbstractSftpClient() {
-fileOpenAttributes.setType(SftpConstants.SSH_FILEXFER_TYPE_REGULAR);
-}
-
-@Override
-public Channel getChannel() {
-return getClientChannel();
-}
-
-@Override
-public  E getExtension(Class 
extensionType) {
-Object instance = 
getExtension(BuiltinSftpClientExtensions.fromType(extensionType));
-if (instance == null) {
-return null;
-} else {
-return extensionType.cast(instance);
-}
-}
-
-@Override
-public SftpClientExtension getExtension(String extensionName) {
-return 
getExtension(BuiltinSftpClientExtensions.fromName(extensionName));
-}
-
-protected SftpClientExtension getExtension(SftpClientExtensionFactory 
factory) {
-if (factory == null) {
-return null;
-}
-
-Map extensions = getServerExtensions();
-Map parsed = getParsedServerExtensions(extensions);
-return factory.create(this, this, extensions, parsed);
-}
-
-protected Map getParsedServerExtensions() {
-return getParsedServerExtensions(getServerExtensions());
-}
-
-protected Map getParsedServerExtensions(Map extensions) {
-Map parsed = parsedExtensionsHolder.get();
-if (parsed == null) {
-parsed = ParserUtils.parse(extensions);
-if (parsed == null) {
-parsed = Collections.emptyMap();
-}
-parsedExtensionsHolder.set(parsed);
-}
-
-return parsed;
-}
-
-/**
- * @param cmd The 

[20/30] mina-sshd git commit: [SSHD-815] Extract SFTP in its own module

2018-04-16 Thread gnodet
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/251db9b9/sshd-core/src/main/java/org/apache/sshd/server/subsystem/sftp/SftpSubsystem.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/server/subsystem/sftp/SftpSubsystem.java
 
b/sshd-core/src/main/java/org/apache/sshd/server/subsystem/sftp/SftpSubsystem.java
deleted file mode 100644
index 5cfbf01..000
--- 
a/sshd-core/src/main/java/org/apache/sshd/server/subsystem/sftp/SftpSubsystem.java
+++ /dev/null
@@ -1,1069 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.sshd.server.subsystem.sftp;
-
-import java.io.EOFException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.UnknownServiceException;
-import java.nio.file.AccessDeniedException;
-import java.nio.file.FileSystem;
-import java.nio.file.FileSystemLoopException;
-import java.nio.file.FileSystems;
-import java.nio.file.Files;
-import java.nio.file.LinkOption;
-import java.nio.file.NoSuchFileException;
-import java.nio.file.NotDirectoryException;
-import java.nio.file.Path;
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Objects;
-import java.util.TreeMap;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Future;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import org.apache.sshd.common.Factory;
-import org.apache.sshd.common.FactoryManager;
-import org.apache.sshd.common.digest.BuiltinDigests;
-import org.apache.sshd.common.digest.DigestFactory;
-import org.apache.sshd.common.file.FileSystemAware;
-import org.apache.sshd.common.random.Random;
-import org.apache.sshd.common.subsystem.sftp.SftpConstants;
-import org.apache.sshd.common.subsystem.sftp.SftpHelper;
-import 
org.apache.sshd.common.subsystem.sftp.extensions.openssh.FsyncExtensionParser;
-import 
org.apache.sshd.common.subsystem.sftp.extensions.openssh.HardLinkExtensionParser;
-import org.apache.sshd.common.util.GenericUtils;
-import org.apache.sshd.common.util.ValidateUtils;
-import org.apache.sshd.common.util.buffer.Buffer;
-import org.apache.sshd.common.util.buffer.BufferUtils;
-import org.apache.sshd.common.util.buffer.ByteArrayBuffer;
-import org.apache.sshd.common.util.io.IoUtils;
-import org.apache.sshd.common.util.threads.ExecutorServiceCarrier;
-import org.apache.sshd.common.util.threads.ThreadUtils;
-import org.apache.sshd.server.Command;
-import org.apache.sshd.server.Environment;
-import org.apache.sshd.server.ExitCallback;
-import org.apache.sshd.server.SessionAware;
-import org.apache.sshd.server.session.ServerSession;
-
-/**
- * SFTP subsystem
- *
- * @author mailto:d...@mina.apache.org;>Apache MINA SSHD Project
- */
-public class SftpSubsystem
-extends AbstractSftpSubsystemHelper
-implements Command, Runnable, SessionAware, FileSystemAware, 
ExecutorServiceCarrier {
-
-/**
- * Properties key for the maximum of available open handles per session.
- */
-public static final String MAX_OPEN_HANDLES_PER_SESSION = 
"max-open-handles-per-session";
-public static final int DEFAULT_MAX_OPEN_HANDLES = Integer.MAX_VALUE;
-
-/**
- * Size in bytes of the opaque handle value
- *
- * @see #DEFAULT_FILE_HANDLE_SIZE
- */
-public static final String FILE_HANDLE_SIZE = "sftp-handle-size";
-public static final int MIN_FILE_HANDLE_SIZE = 4;  // ~uint32
-public static final int DEFAULT_FILE_HANDLE_SIZE = 16;
-public static final int MAX_FILE_HANDLE_SIZE = 64;  // ~sha512
-
-/**
- * Max. rounds to attempt to create a unique file handle - if all handles
- * already in use after these many rounds, then an exception is thrown
- *
- * @see #generateFileHandle(Path)
- * @see #DEFAULT_FILE_HANDLE_ROUNDS
- */
-public static final String MAX_FILE_HANDLE_RAND_ROUNDS = 
"sftp-handle-rand-max-rounds";
-public static final int MIN_FILE_HANDLE_ROUNDS = 1;
-public static final int DEFAULT_FILE_HANDLE_ROUNDS = MIN_FILE_HANDLE_SIZE;
-public static final int MAX_FILE_HANDLE_ROUNDS = 

[03/30] mina-sshd git commit: [SSHD-815] Extract SFTP in its own module

2018-04-16 Thread gnodet
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/251db9b9/sshd-sftp/src/test/java/org/apache/sshd/client/subsystem/sftp/SftpVersionsTest.java
--
diff --git 
a/sshd-sftp/src/test/java/org/apache/sshd/client/subsystem/sftp/SftpVersionsTest.java
 
b/sshd-sftp/src/test/java/org/apache/sshd/client/subsystem/sftp/SftpVersionsTest.java
new file mode 100644
index 000..e29b732
--- /dev/null
+++ 
b/sshd-sftp/src/test/java/org/apache/sshd/client/subsystem/sftp/SftpVersionsTest.java
@@ -0,0 +1,510 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.sshd.client.subsystem.sftp;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.LinkOption;
+import java.nio.file.Path;
+import java.nio.file.attribute.AclEntry;
+import java.nio.file.attribute.AclEntryFlag;
+import java.nio.file.attribute.AclEntryPermission;
+import java.nio.file.attribute.AclEntryType;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Date;
+import java.util.EnumSet;
+import java.util.List;
+import java.util.Map;
+import java.util.NavigableMap;
+import java.util.TreeMap;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.stream.Collectors;
+import java.util.stream.IntStream;
+
+import org.apache.sshd.client.session.ClientSession;
+import org.apache.sshd.client.subsystem.sftp.SftpClient.Attributes;
+import org.apache.sshd.client.subsystem.sftp.SftpClient.CloseableHandle;
+import org.apache.sshd.client.subsystem.sftp.SftpClient.DirEntry;
+import org.apache.sshd.client.subsystem.sftp.SftpClient.OpenMode;
+import org.apache.sshd.common.NamedFactory;
+import org.apache.sshd.common.subsystem.sftp.SftpConstants;
+import org.apache.sshd.common.subsystem.sftp.SftpHelper;
+import org.apache.sshd.common.util.GenericUtils;
+import org.apache.sshd.server.Command;
+import org.apache.sshd.server.session.ServerSession;
+import org.apache.sshd.server.subsystem.sftp.AbstractSftpEventListenerAdapter;
+import org.apache.sshd.server.subsystem.sftp.DefaultGroupPrincipal;
+import org.apache.sshd.server.subsystem.sftp.SftpEventListener;
+import org.apache.sshd.server.subsystem.sftp.SftpSubsystem;
+import org.apache.sshd.server.subsystem.sftp.SftpSubsystemEnvironment;
+import org.apache.sshd.server.subsystem.sftp.SftpSubsystemFactory;
+import org.apache.sshd.util.test.JUnit4ClassRunnerWithParametersFactory;
+import org.apache.sshd.util.test.Utils;
+import org.junit.Before;
+import org.junit.FixMethodOrder;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.MethodSorters;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+import org.junit.runners.Parameterized.UseParametersRunnerFactory;
+
+/**
+ * @author mailto:d...@mina.apache.org;>Apache MINA SSHD Project
+ */
+@FixMethodOrder(MethodSorters.NAME_ASCENDING)
+@RunWith(Parameterized.class)   // see 
https://github.com/junit-team/junit/wiki/Parameterized-tests
+@UseParametersRunnerFactory(JUnit4ClassRunnerWithParametersFactory.class)
+public class SftpVersionsTest extends AbstractSftpClientTestSupport {
+private static final List VERSIONS =
+Collections.unmodifiableList(
+IntStream.rangeClosed(SftpSubsystemEnvironment.LOWER_SFTP_IMPL, 
SftpSubsystemEnvironment.HIGHER_SFTP_IMPL)
+.boxed()
+.collect(Collectors.toList()));
+
+private final int testVersion;
+
+public SftpVersionsTest(int version) throws IOException {
+testVersion = version;
+}
+
+@Parameters(name = "version={0}")
+public static Collection parameters() {
+return parameterize(VERSIONS);
+}
+
+@Before
+public void setUp() throws Exception {
+setupServer();
+}
+
+public final int getTestedVersion() {
+return testVersion;
+}
+
+@Test   // See SSHD-749
+public void testSftpOpenFlags() throws Exception {
+Path targetPath = 

[10/30] mina-sshd git commit: [SSHD-815] Extract SFTP in its own module

2018-04-16 Thread gnodet
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/251db9b9/sshd-sftp/src/main/java/org/apache/sshd/common/subsystem/sftp/SftpConstants.java
--
diff --git 
a/sshd-sftp/src/main/java/org/apache/sshd/common/subsystem/sftp/SftpConstants.java
 
b/sshd-sftp/src/main/java/org/apache/sshd/common/subsystem/sftp/SftpConstants.java
new file mode 100644
index 000..ad6234c
--- /dev/null
+++ 
b/sshd-sftp/src/main/java/org/apache/sshd/common/subsystem/sftp/SftpConstants.java
@@ -0,0 +1,330 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sshd.common.subsystem.sftp;
+
+import java.util.Collections;
+import java.util.Map;
+
+import org.apache.sshd.common.util.GenericUtils;
+import org.apache.sshd.common.util.logging.LoggingUtils;
+
+/**
+ * @author mailto:d...@mina.apache.org;>Apache MINA SSHD Project
+ */
+@SuppressWarnings("PMD.AvoidUsingOctalValues")
+public final class SftpConstants {
+public static final String SFTP_SUBSYSTEM_NAME = "sftp";
+
+public static final int SSH_FXP_INIT = 1;
+public static final int SSH_FXP_VERSION = 2;
+public static final int SSH_FXP_OPEN = 3;
+public static final int SSH_FXP_CLOSE = 4;
+public static final int SSH_FXP_READ = 5;
+public static final int SSH_FXP_WRITE = 6;
+public static final int SSH_FXP_LSTAT = 7;
+public static final int SSH_FXP_FSTAT = 8;
+public static final int SSH_FXP_SETSTAT = 9;
+public static final int SSH_FXP_FSETSTAT = 10;
+public static final int SSH_FXP_OPENDIR = 11;
+public static final int SSH_FXP_READDIR = 12;
+public static final int SSH_FXP_REMOVE = 13;
+public static final int SSH_FXP_MKDIR = 14;
+public static final int SSH_FXP_RMDIR = 15;
+public static final int SSH_FXP_REALPATH = 16;
+public static final int SSH_FXP_STAT = 17;
+public static final int SSH_FXP_RENAME = 18;
+public static final int SSH_FXP_READLINK = 19;
+public static final int SSH_FXP_SYMLINK = 20; // v3 -> v5
+public static final int SSH_FXP_LINK = 21; // v6
+public static final int SSH_FXP_BLOCK = 22; // v6
+public static final int SSH_FXP_UNBLOCK = 23; // v6
+public static final int SSH_FXP_STATUS = 101;
+public static final int SSH_FXP_HANDLE = 102;
+public static final int SSH_FXP_DATA = 103;
+public static final int SSH_FXP_NAME = 104;
+public static final int SSH_FXP_ATTRS = 105;
+public static final int SSH_FXP_EXTENDED = 200;
+public static final int SSH_FXP_EXTENDED_REPLY = 201;
+
+public static final int SSH_FX_OK = 0;
+public static final int SSH_FX_EOF = 1;
+public static final int SSH_FX_NO_SUCH_FILE = 2;
+public static final int SSH_FX_PERMISSION_DENIED = 3;
+public static final int SSH_FX_FAILURE = 4;
+public static final int SSH_FX_BAD_MESSAGE = 5;
+public static final int SSH_FX_NO_CONNECTION = 6;
+public static final int SSH_FX_CONNECTION_LOST = 7;
+public static final int SSH_FX_OP_UNSUPPORTED = 8;
+public static final int SSH_FX_INVALID_HANDLE = 9;
+public static final int SSH_FX_NO_SUCH_PATH = 10;
+public static final int SSH_FX_FILE_ALREADY_EXISTS = 11;
+public static final int SSH_FX_WRITE_PROTECT = 12;
+public static final int SSH_FX_NO_MEDIA = 13;
+public static final int SSH_FX_NO_SPACE_ON_FILESYSTEM = 14;
+public static final int SSH_FX_QUOTA_EXCEEDED = 15;
+public static final int SSH_FX_UNKNOWN_PRINCIPAL = 16;
+public static final int SSH_FX_LOCK_CONFLICT = 17;
+public static final int SSH_FX_DIR_NOT_EMPTY = 18;
+public static final int SSH_FX_NOT_A_DIRECTORY = 19;
+public static final int SSH_FX_INVALID_FILENAME = 20;
+public static final int SSH_FX_LINK_LOOP = 21;
+public static final int SSH_FX_CANNOT_DELETE = 22;
+public static final int SSH_FX_INVALID_PARAMETER = 23;
+public static final int SSH_FX_FILE_IS_A_DIRECTORY = 24;
+public static final int SSH_FX_BYTE_RANGE_LOCK_CONFLICT = 25;
+public static final int SSH_FX_BYTE_RANGE_LOCK_REFUSED = 26;
+public static final int SSH_FX_DELETE_PENDING = 27;
+public static final int SSH_FX_FILE_CORRUPT = 28;
+public 

[24/30] mina-sshd git commit: [SSHD-815] Extract SFTP in its own module

2018-04-16 Thread gnodet
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/251db9b9/sshd-core/src/main/java/org/apache/sshd/common/subsystem/sftp/SftpConstants.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/common/subsystem/sftp/SftpConstants.java
 
b/sshd-core/src/main/java/org/apache/sshd/common/subsystem/sftp/SftpConstants.java
deleted file mode 100644
index ad6234c..000
--- 
a/sshd-core/src/main/java/org/apache/sshd/common/subsystem/sftp/SftpConstants.java
+++ /dev/null
@@ -1,330 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.sshd.common.subsystem.sftp;
-
-import java.util.Collections;
-import java.util.Map;
-
-import org.apache.sshd.common.util.GenericUtils;
-import org.apache.sshd.common.util.logging.LoggingUtils;
-
-/**
- * @author mailto:d...@mina.apache.org;>Apache MINA SSHD Project
- */
-@SuppressWarnings("PMD.AvoidUsingOctalValues")
-public final class SftpConstants {
-public static final String SFTP_SUBSYSTEM_NAME = "sftp";
-
-public static final int SSH_FXP_INIT = 1;
-public static final int SSH_FXP_VERSION = 2;
-public static final int SSH_FXP_OPEN = 3;
-public static final int SSH_FXP_CLOSE = 4;
-public static final int SSH_FXP_READ = 5;
-public static final int SSH_FXP_WRITE = 6;
-public static final int SSH_FXP_LSTAT = 7;
-public static final int SSH_FXP_FSTAT = 8;
-public static final int SSH_FXP_SETSTAT = 9;
-public static final int SSH_FXP_FSETSTAT = 10;
-public static final int SSH_FXP_OPENDIR = 11;
-public static final int SSH_FXP_READDIR = 12;
-public static final int SSH_FXP_REMOVE = 13;
-public static final int SSH_FXP_MKDIR = 14;
-public static final int SSH_FXP_RMDIR = 15;
-public static final int SSH_FXP_REALPATH = 16;
-public static final int SSH_FXP_STAT = 17;
-public static final int SSH_FXP_RENAME = 18;
-public static final int SSH_FXP_READLINK = 19;
-public static final int SSH_FXP_SYMLINK = 20; // v3 -> v5
-public static final int SSH_FXP_LINK = 21; // v6
-public static final int SSH_FXP_BLOCK = 22; // v6
-public static final int SSH_FXP_UNBLOCK = 23; // v6
-public static final int SSH_FXP_STATUS = 101;
-public static final int SSH_FXP_HANDLE = 102;
-public static final int SSH_FXP_DATA = 103;
-public static final int SSH_FXP_NAME = 104;
-public static final int SSH_FXP_ATTRS = 105;
-public static final int SSH_FXP_EXTENDED = 200;
-public static final int SSH_FXP_EXTENDED_REPLY = 201;
-
-public static final int SSH_FX_OK = 0;
-public static final int SSH_FX_EOF = 1;
-public static final int SSH_FX_NO_SUCH_FILE = 2;
-public static final int SSH_FX_PERMISSION_DENIED = 3;
-public static final int SSH_FX_FAILURE = 4;
-public static final int SSH_FX_BAD_MESSAGE = 5;
-public static final int SSH_FX_NO_CONNECTION = 6;
-public static final int SSH_FX_CONNECTION_LOST = 7;
-public static final int SSH_FX_OP_UNSUPPORTED = 8;
-public static final int SSH_FX_INVALID_HANDLE = 9;
-public static final int SSH_FX_NO_SUCH_PATH = 10;
-public static final int SSH_FX_FILE_ALREADY_EXISTS = 11;
-public static final int SSH_FX_WRITE_PROTECT = 12;
-public static final int SSH_FX_NO_MEDIA = 13;
-public static final int SSH_FX_NO_SPACE_ON_FILESYSTEM = 14;
-public static final int SSH_FX_QUOTA_EXCEEDED = 15;
-public static final int SSH_FX_UNKNOWN_PRINCIPAL = 16;
-public static final int SSH_FX_LOCK_CONFLICT = 17;
-public static final int SSH_FX_DIR_NOT_EMPTY = 18;
-public static final int SSH_FX_NOT_A_DIRECTORY = 19;
-public static final int SSH_FX_INVALID_FILENAME = 20;
-public static final int SSH_FX_LINK_LOOP = 21;
-public static final int SSH_FX_CANNOT_DELETE = 22;
-public static final int SSH_FX_INVALID_PARAMETER = 23;
-public static final int SSH_FX_FILE_IS_A_DIRECTORY = 24;
-public static final int SSH_FX_BYTE_RANGE_LOCK_CONFLICT = 25;
-public static final int SSH_FX_BYTE_RANGE_LOCK_REFUSED = 26;
-public static final int SSH_FX_DELETE_PENDING = 27;
-public static final int SSH_FX_FILE_CORRUPT = 28;
-

[30/30] mina-sshd git commit: [SSHD-815] Extract SFTP in its own module

2018-04-16 Thread gnodet
[SSHD-815] Extract SFTP in its own module


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/251db9b9
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/251db9b9
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/251db9b9

Branch: refs/heads/master
Commit: 251db9b9dccfc4b9091e69982928d308fd09c04a
Parents: 19be905
Author: Guillaume Nodet 
Authored: Fri Apr 13 11:13:07 2018 +0200
Committer: Guillaume Nodet 
Committed: Mon Apr 16 13:46:34 2018 +0200

--
 README.md   |  149 +-
 assembly/pom.xml|5 +
 pom.xml |1 +
 sshd-contrib/pom.xml|5 +
 ...impleAccessControlSftpEventListenerTest.java |5 +-
 .../sshd/client/ClientFactoryManager.java   |2 -
 .../java/org/apache/sshd/client/SshClient.java  |   13 -
 .../client/session/AbstractClientSession.java   |   27 -
 .../sshd/client/session/ClientSession.java  |4 +-
 .../client/simple/AbstractSimpleClient.java |  100 -
 .../apache/sshd/client/simple/SimpleClient.java |1 -
 .../sshd/client/simple/SimpleSftpClient.java|  179 --
 .../client/subsystem/sftp/RawSftpClient.java|   44 -
 .../sftp/SftpAclFileAttributeView.java  |   67 -
 .../sshd/client/subsystem/sftp/SftpClient.java  | 1038 ---
 .../subsystem/sftp/SftpClientCreator.java   |   85 -
 .../subsystem/sftp/SftpClientFactory.java   |   51 -
 .../sftp/SftpClientFactoryManager.java  |   37 -
 .../sshd/client/subsystem/sftp/SftpCommand.java |  920 ---
 .../subsystem/sftp/SftpDirEntryIterator.java|  194 --
 .../subsystem/sftp/SftpDirectoryStream.java |   65 -
 .../client/subsystem/sftp/SftpFileStore.java|  105 -
 .../client/subsystem/sftp/SftpFileSystem.java   |  596 
 .../subsystem/sftp/SftpFileSystemChannel.java   |   37 -
 .../subsystem/sftp/SftpFileSystemProvider.java  | 1249 -
 .../sftp/SftpInputStreamWithChannel.java|  179 --
 .../subsystem/sftp/SftpIterableDirEntry.java|   72 -
 .../sftp/SftpOutputStreamWithChannel.java   |  124 -
 .../sshd/client/subsystem/sftp/SftpPath.java|   43 -
 .../client/subsystem/sftp/SftpPathIterator.java |   82 -
 .../sftp/SftpPosixFileAttributeView.java|   94 -
 .../subsystem/sftp/SftpPosixFileAttributes.java |  113 -
 .../subsystem/sftp/SftpRemotePathChannel.java   |  412 ---
 .../subsystem/sftp/SftpVersionSelector.java |  127 -
 .../subsystem/sftp/StfpIterableDirHandle.java   |   59 -
 .../extensions/BuiltinSftpClientExtensions.java |  162 --
 .../extensions/CheckFileHandleExtension.java|   45 -
 .../sftp/extensions/CheckFileNameExtension.java |   43 -
 .../sftp/extensions/CopyDataExtension.java  |   34 -
 .../sftp/extensions/CopyFileExtension.java  |   36 -
 .../sftp/extensions/MD5FileExtension.java   |   40 -
 .../sftp/extensions/MD5HandleExtension.java |   43 -
 .../sftp/extensions/SftpClientExtension.java|   34 -
 .../extensions/SftpClientExtensionFactory.java  |   39 -
 .../extensions/SpaceAvailableExtension.java |   34 -
 .../helpers/AbstractCheckFileExtension.java |   76 -
 .../helpers/AbstractMD5HashExtension.java   |   75 -
 .../helpers/AbstractSftpClientExtension.java|  206 --
 .../helpers/CheckFileHandleExtensionImpl.java   |   49 -
 .../helpers/CheckFileNameExtensionImpl.java |   48 -
 .../helpers/CopyDataExtensionImpl.java  |   58 -
 .../helpers/CopyFileExtensionImpl.java  |   53 -
 .../helpers/MD5FileExtensionImpl.java   |   45 -
 .../helpers/MD5HandleExtensionImpl.java |   46 -
 .../helpers/SpaceAvailableExtensionImpl.java|   56 -
 .../openssh/OpenSSHFsyncExtension.java  |   35 -
 .../openssh/OpenSSHStatExtensionInfo.java   |  150 -
 .../openssh/OpenSSHStatHandleExtension.java |   34 -
 .../openssh/OpenSSHStatPathExtension.java   |   34 -
 .../AbstractOpenSSHStatCommandExtension.java|   57 -
 .../helpers/OpenSSHFsyncExtensionImpl.java  |   49 -
 .../helpers/OpenSSHStatHandleExtensionImpl.java |   44 -
 .../helpers/OpenSSHStatPathExtensionImpl.java   |   43 -
 .../subsystem/sftp/impl/AbstractSftpClient.java | 1188 
 .../impl/AbstractSftpFileAttributeView.java |   92 -
 .../sftp/impl/DefaultCloseableHandle.java   |   66 -
 .../subsystem/sftp/impl/DefaultSftpClient.java  |  464 
 .../sftp/impl/DefaultSftpClientFactory.java |   81 -
 .../common/subsystem/sftp/SftpConstants.java|  330 ---
 .../common/subsystem/sftp/SftpException.java|   43 -
 .../sshd/common/subsystem/sftp/SftpHelper.java  | 1114 
 .../sftp/SftpUniversalOwnerAndGroup.java|   67 -
 .../sftp/extensions/AbstractParser.java |   39 -
 .../sftp/extensions/AclSupportedParser.java |  208 

[09/30] mina-sshd git commit: [SSHD-815] Extract SFTP in its own module

2018-04-16 Thread gnodet
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/251db9b9/sshd-sftp/src/main/java/org/apache/sshd/common/subsystem/sftp/extensions/NewlineParser.java
--
diff --git 
a/sshd-sftp/src/main/java/org/apache/sshd/common/subsystem/sftp/extensions/NewlineParser.java
 
b/sshd-sftp/src/main/java/org/apache/sshd/common/subsystem/sftp/extensions/NewlineParser.java
new file mode 100644
index 000..2ad7ddb
--- /dev/null
+++ 
b/sshd-sftp/src/main/java/org/apache/sshd/common/subsystem/sftp/extensions/NewlineParser.java
@@ -0,0 +1,115 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.sshd.common.subsystem.sftp.extensions;
+
+import java.io.Serializable;
+import java.nio.charset.StandardCharsets;
+import java.util.Objects;
+
+import org.apache.sshd.common.subsystem.sftp.SftpConstants;
+import org.apache.sshd.common.subsystem.sftp.extensions.NewlineParser.Newline;
+import org.apache.sshd.common.util.GenericUtils;
+import org.apache.sshd.common.util.buffer.BufferUtils;
+
+/**
+ * @author mailto:d...@mina.apache.org;>Apache MINA SSHD Project
+ */
+public class NewlineParser extends AbstractParser {
+/**
+ * The newline extension information as per
+ * http://tools.ietf.org/wg/secsh/draft-ietf-secsh-filexfer/draft-ietf-secsh-filexfer-09.txt;>DRAFT
 09 Section 4.3
+ *
+ * @author mailto:d...@mina.apache.org;>Apache MINA SSHD 
Project
+ */
+public static class Newline implements Cloneable, Serializable {
+private static final long serialVersionUID = 2010656704254497899L;
+private String newline;
+
+public Newline() {
+this(null);
+}
+
+public Newline(String newline) {
+this.newline = newline;
+}
+
+public String getNewline() {
+return newline;
+}
+
+public void setNewline(String newline) {
+this.newline = newline;
+}
+
+@Override
+public int hashCode() {
+return Objects.hashCode(getNewline());
+}
+
+@Override
+public boolean equals(Object obj) {
+if (obj == null) {
+return false;
+}
+if (obj == this) {
+return true;
+}
+if (obj.getClass() != getClass()) {
+return false;
+}
+
+return Objects.equals(((Newline) obj).getNewline(), getNewline());
+}
+
+@Override
+public Newline clone() {
+try {
+return getClass().cast(super.clone());
+} catch (CloneNotSupportedException e) {
+throw new RuntimeException("Failed to clone " + toString() + 
": " + e.getMessage(), e);
+}
+}
+
+@Override
+public String toString() {
+String nl = getNewline();
+if (GenericUtils.isEmpty(nl)) {
+return nl;
+} else {
+return BufferUtils.toHex(':', 
nl.getBytes(StandardCharsets.UTF_8));
+}
+}
+}
+
+public static final NewlineParser INSTANCE = new NewlineParser();
+
+public NewlineParser() {
+super(SftpConstants.EXT_NEWLINE);
+}
+
+@Override
+public Newline parse(byte[] input, int offset, int len) {
+return parse(new String(input, offset, len, StandardCharsets.UTF_8));
+}
+
+public Newline parse(String value) {
+return new Newline(value);
+}
+}

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/251db9b9/sshd-sftp/src/main/java/org/apache/sshd/common/subsystem/sftp/extensions/ParserUtils.java
--
diff --git 
a/sshd-sftp/src/main/java/org/apache/sshd/common/subsystem/sftp/extensions/ParserUtils.java
 
b/sshd-sftp/src/main/java/org/apache/sshd/common/subsystem/sftp/extensions/ParserUtils.java
new file mode 100644
index 000..e565ab4
--- /dev/null
+++ 
b/sshd-sftp/src/main/java/org/apache/sshd/common/subsystem/sftp/extensions/ParserUtils.java
@@ -0,0 +1,195 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more 

[23/30] mina-sshd git commit: [SSHD-815] Extract SFTP in its own module

2018-04-16 Thread gnodet
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/251db9b9/sshd-core/src/main/java/org/apache/sshd/common/subsystem/sftp/extensions/NewlineParser.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/common/subsystem/sftp/extensions/NewlineParser.java
 
b/sshd-core/src/main/java/org/apache/sshd/common/subsystem/sftp/extensions/NewlineParser.java
deleted file mode 100644
index 2ad7ddb..000
--- 
a/sshd-core/src/main/java/org/apache/sshd/common/subsystem/sftp/extensions/NewlineParser.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.sshd.common.subsystem.sftp.extensions;
-
-import java.io.Serializable;
-import java.nio.charset.StandardCharsets;
-import java.util.Objects;
-
-import org.apache.sshd.common.subsystem.sftp.SftpConstants;
-import org.apache.sshd.common.subsystem.sftp.extensions.NewlineParser.Newline;
-import org.apache.sshd.common.util.GenericUtils;
-import org.apache.sshd.common.util.buffer.BufferUtils;
-
-/**
- * @author mailto:d...@mina.apache.org;>Apache MINA SSHD Project
- */
-public class NewlineParser extends AbstractParser {
-/**
- * The newline extension information as per
- * http://tools.ietf.org/wg/secsh/draft-ietf-secsh-filexfer/draft-ietf-secsh-filexfer-09.txt;>DRAFT
 09 Section 4.3
- *
- * @author mailto:d...@mina.apache.org;>Apache MINA SSHD 
Project
- */
-public static class Newline implements Cloneable, Serializable {
-private static final long serialVersionUID = 2010656704254497899L;
-private String newline;
-
-public Newline() {
-this(null);
-}
-
-public Newline(String newline) {
-this.newline = newline;
-}
-
-public String getNewline() {
-return newline;
-}
-
-public void setNewline(String newline) {
-this.newline = newline;
-}
-
-@Override
-public int hashCode() {
-return Objects.hashCode(getNewline());
-}
-
-@Override
-public boolean equals(Object obj) {
-if (obj == null) {
-return false;
-}
-if (obj == this) {
-return true;
-}
-if (obj.getClass() != getClass()) {
-return false;
-}
-
-return Objects.equals(((Newline) obj).getNewline(), getNewline());
-}
-
-@Override
-public Newline clone() {
-try {
-return getClass().cast(super.clone());
-} catch (CloneNotSupportedException e) {
-throw new RuntimeException("Failed to clone " + toString() + 
": " + e.getMessage(), e);
-}
-}
-
-@Override
-public String toString() {
-String nl = getNewline();
-if (GenericUtils.isEmpty(nl)) {
-return nl;
-} else {
-return BufferUtils.toHex(':', 
nl.getBytes(StandardCharsets.UTF_8));
-}
-}
-}
-
-public static final NewlineParser INSTANCE = new NewlineParser();
-
-public NewlineParser() {
-super(SftpConstants.EXT_NEWLINE);
-}
-
-@Override
-public Newline parse(byte[] input, int offset, int len) {
-return parse(new String(input, offset, len, StandardCharsets.UTF_8));
-}
-
-public Newline parse(String value) {
-return new Newline(value);
-}
-}

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/251db9b9/sshd-core/src/main/java/org/apache/sshd/common/subsystem/sftp/extensions/ParserUtils.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/common/subsystem/sftp/extensions/ParserUtils.java
 
b/sshd-core/src/main/java/org/apache/sshd/common/subsystem/sftp/extensions/ParserUtils.java
deleted file mode 100644
index e565ab4..000
--- 
a/sshd-core/src/main/java/org/apache/sshd/common/subsystem/sftp/extensions/ParserUtils.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more 

[12/30] mina-sshd git commit: [SSHD-815] Extract SFTP in its own module

2018-04-16 Thread gnodet
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/251db9b9/sshd-sftp/src/main/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/AbstractSftpClientExtension.java
--
diff --git 
a/sshd-sftp/src/main/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/AbstractSftpClientExtension.java
 
b/sshd-sftp/src/main/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/AbstractSftpClientExtension.java
new file mode 100644
index 000..6b179c9
--- /dev/null
+++ 
b/sshd-sftp/src/main/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/AbstractSftpClientExtension.java
@@ -0,0 +1,206 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.sshd.client.subsystem.sftp.extensions.helpers;
+
+import java.io.IOException;
+import java.io.StreamCorruptedException;
+import java.util.Collection;
+import java.util.Map;
+import java.util.Objects;
+
+import org.apache.sshd.client.subsystem.sftp.RawSftpClient;
+import org.apache.sshd.client.subsystem.sftp.SftpClient;
+import org.apache.sshd.client.subsystem.sftp.SftpClient.Handle;
+import org.apache.sshd.client.subsystem.sftp.extensions.SftpClientExtension;
+import org.apache.sshd.common.SshException;
+import org.apache.sshd.common.subsystem.sftp.SftpConstants;
+import org.apache.sshd.common.subsystem.sftp.SftpException;
+import org.apache.sshd.common.util.GenericUtils;
+import org.apache.sshd.common.util.ValidateUtils;
+import org.apache.sshd.common.util.buffer.Buffer;
+import org.apache.sshd.common.util.buffer.ByteArrayBuffer;
+import org.apache.sshd.common.util.logging.AbstractLoggingBean;
+
+/**
+ * @author mailto:d...@mina.apache.org;>Apache MINA SSHD Project
+ */
+public abstract class AbstractSftpClientExtension extends AbstractLoggingBean 
implements SftpClientExtension, RawSftpClient {
+private final String name;
+private final SftpClient client;
+private final RawSftpClient raw;
+private final boolean supported;
+
+protected AbstractSftpClientExtension(String name, SftpClient client, 
RawSftpClient raw, Collection extras) {
+this(name, client, raw, GenericUtils.isNotEmpty(extras) && 
extras.contains(name));
+}
+
+protected AbstractSftpClientExtension(String name, SftpClient client, 
RawSftpClient raw, Map extensions) {
+this(name, client, raw, GenericUtils.isNotEmpty(extensions) && 
extensions.containsKey(name));
+}
+
+protected AbstractSftpClientExtension(String name, SftpClient client, 
RawSftpClient raw, boolean supported) {
+this.name = ValidateUtils.checkNotNullAndNotEmpty(name, "No extension 
name");
+this.client = Objects.requireNonNull(client, "No client instance");
+this.raw = Objects.requireNonNull(raw, "No raw access");
+this.supported = supported;
+}
+
+@Override
+public final String getName() {
+return name;
+}
+
+@Override
+public final SftpClient getClient() {
+return client;
+}
+
+protected void sendAndCheckExtendedCommandStatus(Buffer buffer) throws 
IOException {
+int reqId = sendExtendedCommand(buffer);
+if (log.isDebugEnabled()) {
+log.debug("sendAndCheckExtendedCommandStatus(" + getName() + ") 
id=" + reqId);
+}
+checkStatus(receive(reqId));
+}
+
+protected int sendExtendedCommand(Buffer buffer) throws IOException {
+return send(SftpConstants.SSH_FXP_EXTENDED, buffer);
+}
+
+@Override
+public int send(int cmd, Buffer buffer) throws IOException {
+return raw.send(cmd, buffer);
+}
+
+@Override
+public Buffer receive(int id) throws IOException {
+return raw.receive(id);
+}
+
+@Override
+public final boolean isSupported() {
+return supported;
+}
+
+protected void checkStatus(Buffer buffer) throws IOException {
+if (checkExtendedReplyBuffer(buffer) != null) {
+throw new StreamCorruptedException("Unexpected extended reply 
received");
+}
+}
+
+/**
+ * @param buffer The {@link Buffer}
+ * @param target A target path {@link String} or {@link Handle} or {@code 

[26/30] mina-sshd git commit: [SSHD-815] Extract SFTP in its own module

2018-04-16 Thread gnodet
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/251db9b9/sshd-core/src/main/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/AbstractMD5HashExtension.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/AbstractMD5HashExtension.java
 
b/sshd-core/src/main/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/AbstractMD5HashExtension.java
deleted file mode 100644
index ab00f9e..000
--- 
a/sshd-core/src/main/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/AbstractMD5HashExtension.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.sshd.client.subsystem.sftp.extensions.helpers;
-
-import java.io.IOException;
-import java.io.StreamCorruptedException;
-import java.util.Collection;
-
-import org.apache.sshd.client.subsystem.sftp.RawSftpClient;
-import org.apache.sshd.client.subsystem.sftp.SftpClient;
-import org.apache.sshd.common.util.GenericUtils;
-import org.apache.sshd.common.util.NumberUtils;
-import org.apache.sshd.common.util.buffer.Buffer;
-import org.apache.sshd.common.util.buffer.BufferUtils;
-
-/**
- * @author mailto:d...@mina.apache.org;>Apache MINA SSHD Project
- */
-public abstract class AbstractMD5HashExtension extends 
AbstractSftpClientExtension {
-protected AbstractMD5HashExtension(String name, SftpClient client, 
RawSftpClient raw, Collection extras) {
-super(name, client, raw, extras);
-}
-
-protected byte[] doGetHash(Object target, long offset, long length, byte[] 
quickHash) throws IOException {
-Buffer buffer = getCommandBuffer(target, Long.SIZE + 2 * Long.BYTES + 
Integer.BYTES + NumberUtils.length(quickHash));
-String opcode = getName();
-putTarget(buffer, target);
-buffer.putLong(offset);
-buffer.putLong(length);
-buffer.putBytes((quickHash == null) ? GenericUtils.EMPTY_BYTE_ARRAY : 
quickHash);
-
-boolean debugEnabled = log.isDebugEnabled();
-if (debugEnabled) {
-log.debug("doGetHash({})[{}] - offset={}, length={}, 
quick-hash={}",
-  opcode, (target instanceof CharSequence) ? target : 
BufferUtils.toHex(BufferUtils.EMPTY_HEX_SEPARATOR, (byte[]) target),
-  offset, length, BufferUtils.toHex(':', quickHash));
-}
-
-buffer = 
checkExtendedReplyBuffer(receive(sendExtendedCommand(buffer)));
-if (buffer == null) {
-throw new StreamCorruptedException("Missing extended reply data");
-}
-
-String targetType = buffer.getString();
-if (String.CASE_INSENSITIVE_ORDER.compare(targetType, opcode) != 0) {
-throw new StreamCorruptedException("Mismatched reply target type: 
expected=" + opcode + ", actual=" + targetType);
-}
-
-byte[] hashValue = buffer.getBytes();
-if (debugEnabled) {
-log.debug("doGetHash({})[{}] - offset={}, length={}, quick-hash={} 
- result={}",
-  opcode, target, offset, length,
-  BufferUtils.toHex(':', quickHash), 
BufferUtils.toHex(':', hashValue));
-}
-
-return hashValue;
-}
-}

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/251db9b9/sshd-core/src/main/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/AbstractSftpClientExtension.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/AbstractSftpClientExtension.java
 
b/sshd-core/src/main/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/AbstractSftpClientExtension.java
deleted file mode 100644
index 6b179c9..000
--- 
a/sshd-core/src/main/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/AbstractSftpClientExtension.java
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file

[21/30] mina-sshd git commit: [SSHD-815] Extract SFTP in its own module

2018-04-16 Thread gnodet
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/251db9b9/sshd-core/src/main/java/org/apache/sshd/server/subsystem/sftp/DefaultGroupPrincipal.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/server/subsystem/sftp/DefaultGroupPrincipal.java
 
b/sshd-core/src/main/java/org/apache/sshd/server/subsystem/sftp/DefaultGroupPrincipal.java
deleted file mode 100644
index acf3118..000
--- 
a/sshd-core/src/main/java/org/apache/sshd/server/subsystem/sftp/DefaultGroupPrincipal.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.sshd.server.subsystem.sftp;
-
-import java.nio.file.attribute.GroupPrincipal;
-
-/**
- * @author mailto:d...@mina.apache.org;>Apache MINA SSHD Project
- */
-public class DefaultGroupPrincipal extends PrincipalBase implements 
GroupPrincipal {
-
-public DefaultGroupPrincipal(String name) {
-super(name);
-}
-
-}

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/251db9b9/sshd-core/src/main/java/org/apache/sshd/server/subsystem/sftp/DefaultUserPrincipal.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/server/subsystem/sftp/DefaultUserPrincipal.java
 
b/sshd-core/src/main/java/org/apache/sshd/server/subsystem/sftp/DefaultUserPrincipal.java
deleted file mode 100644
index d71d772..000
--- 
a/sshd-core/src/main/java/org/apache/sshd/server/subsystem/sftp/DefaultUserPrincipal.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.sshd.server.subsystem.sftp;
-
-import java.nio.file.attribute.UserPrincipal;
-
-/**
- * @author mailto:d...@mina.apache.org;>Apache MINA SSHD Project
- */
-public class DefaultUserPrincipal extends PrincipalBase implements 
UserPrincipal {
-
-public DefaultUserPrincipal(String name) {
-super(name);
-}
-
-}

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/251db9b9/sshd-core/src/main/java/org/apache/sshd/server/subsystem/sftp/DirectoryHandle.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/server/subsystem/sftp/DirectoryHandle.java
 
b/sshd-core/src/main/java/org/apache/sshd/server/subsystem/sftp/DirectoryHandle.java
deleted file mode 100644
index 0ae60cf..000
--- 
a/sshd-core/src/main/java/org/apache/sshd/server/subsystem/sftp/DirectoryHandle.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.sshd.server.subsystem.sftp;
-
-import java.io.IOException;
-import 

[18/30] mina-sshd git commit: [SSHD-815] Extract SFTP in its own module

2018-04-16 Thread gnodet
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/251db9b9/sshd-core/src/test/java/org/apache/sshd/client/subsystem/sftp/SftpTest.java
--
diff --git 
a/sshd-core/src/test/java/org/apache/sshd/client/subsystem/sftp/SftpTest.java 
b/sshd-core/src/test/java/org/apache/sshd/client/subsystem/sftp/SftpTest.java
deleted file mode 100644
index a6f162f..000
--- 
a/sshd-core/src/test/java/org/apache/sshd/client/subsystem/sftp/SftpTest.java
+++ /dev/null
@@ -1,1500 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.sshd.client.subsystem.sftp;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.EOFException;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.SocketTimeoutException;
-import java.nio.ByteBuffer;
-import java.nio.channels.FileChannel;
-import java.nio.channels.SeekableByteChannel;
-import java.nio.charset.StandardCharsets;
-import java.nio.file.CopyOption;
-import java.nio.file.DirectoryStream;
-import java.nio.file.FileSystem;
-import java.nio.file.Files;
-import java.nio.file.LinkOption;
-import java.nio.file.OpenOption;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.nio.file.StandardOpenOption;
-import java.nio.file.attribute.FileAttribute;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Date;
-import java.util.EnumSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Set;
-import java.util.TreeSet;
-import java.util.Vector;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.concurrent.atomic.AtomicLong;
-import java.util.concurrent.atomic.AtomicReference;
-
-import com.jcraft.jsch.ChannelSftp;
-import com.jcraft.jsch.JSch;
-
-import org.apache.sshd.client.session.ClientSession;
-import org.apache.sshd.client.subsystem.sftp.SftpClient.Attributes;
-import org.apache.sshd.client.subsystem.sftp.SftpClient.CloseableHandle;
-import org.apache.sshd.client.subsystem.sftp.SftpClient.DirEntry;
-import org.apache.sshd.client.subsystem.sftp.SftpClient.OpenMode;
-import 
org.apache.sshd.client.subsystem.sftp.extensions.BuiltinSftpClientExtensions;
-import org.apache.sshd.client.subsystem.sftp.extensions.SftpClientExtension;
-import org.apache.sshd.common.Factory;
-import org.apache.sshd.common.FactoryManager;
-import org.apache.sshd.common.NamedFactory;
-import org.apache.sshd.common.OptionalFeature;
-import org.apache.sshd.common.PropertyResolverUtils;
-import org.apache.sshd.common.channel.WindowClosedException;
-import org.apache.sshd.common.file.virtualfs.VirtualFileSystemFactory;
-import org.apache.sshd.common.random.Random;
-import org.apache.sshd.common.subsystem.sftp.SftpConstants;
-import org.apache.sshd.common.subsystem.sftp.SftpException;
-import 
org.apache.sshd.common.subsystem.sftp.extensions.AclSupportedParser.AclCapabilities;
-import org.apache.sshd.common.subsystem.sftp.extensions.NewlineParser.Newline;
-import org.apache.sshd.common.subsystem.sftp.extensions.ParserUtils;
-import 
org.apache.sshd.common.subsystem.sftp.extensions.Supported2Parser.Supported2;
-import 
org.apache.sshd.common.subsystem.sftp.extensions.SupportedParser.Supported;
-import 
org.apache.sshd.common.subsystem.sftp.extensions.VersionsParser.Versions;
-import 
org.apache.sshd.common.subsystem.sftp.extensions.openssh.AbstractOpenSSHExtensionParser.OpenSSHExtension;
-import org.apache.sshd.common.util.GenericUtils;
-import org.apache.sshd.common.util.OsUtils;
-import org.apache.sshd.common.util.buffer.BufferUtils;
-import org.apache.sshd.common.util.buffer.ByteArrayBuffer;
-import org.apache.sshd.common.util.io.IoUtils;
-import org.apache.sshd.server.Command;
-import org.apache.sshd.server.session.ServerSession;
-import org.apache.sshd.server.subsystem.sftp.AbstractSftpEventListenerAdapter;
-import org.apache.sshd.server.subsystem.sftp.AbstractSftpSubsystemHelper;
-import org.apache.sshd.server.subsystem.sftp.DirectoryHandle;
-import 

[22/30] mina-sshd git commit: [SSHD-815] Extract SFTP in its own module

2018-04-16 Thread gnodet
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/251db9b9/sshd-core/src/main/java/org/apache/sshd/server/subsystem/sftp/AbstractSftpSubsystemHelper.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/server/subsystem/sftp/AbstractSftpSubsystemHelper.java
 
b/sshd-core/src/main/java/org/apache/sshd/server/subsystem/sftp/AbstractSftpSubsystemHelper.java
deleted file mode 100644
index 08213ee..000
--- 
a/sshd-core/src/main/java/org/apache/sshd/server/subsystem/sftp/AbstractSftpSubsystemHelper.java
+++ /dev/null
@@ -1,2580 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.sshd.server.subsystem.sftp;
-
-import java.io.EOFException;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.StreamCorruptedException;
-import java.nio.ByteBuffer;
-import java.nio.channels.SeekableByteChannel;
-import java.nio.charset.StandardCharsets;
-import java.nio.file.AccessDeniedException;
-import java.nio.file.CopyOption;
-import java.nio.file.FileAlreadyExistsException;
-import java.nio.file.FileStore;
-import java.nio.file.FileSystem;
-import java.nio.file.Files;
-import java.nio.file.InvalidPathException;
-import java.nio.file.LinkOption;
-import java.nio.file.NoSuchFileException;
-import java.nio.file.NotDirectoryException;
-import java.nio.file.Path;
-import java.nio.file.StandardCopyOption;
-import java.nio.file.StandardOpenOption;
-import java.nio.file.attribute.AclEntry;
-import java.nio.file.attribute.AclFileAttributeView;
-import java.nio.file.attribute.FileOwnerAttributeView;
-import java.nio.file.attribute.FileTime;
-import java.nio.file.attribute.GroupPrincipal;
-import java.nio.file.attribute.PosixFileAttributeView;
-import java.nio.file.attribute.PosixFilePermission;
-import java.nio.file.attribute.UserPrincipal;
-import java.nio.file.attribute.UserPrincipalLookupService;
-import java.nio.file.attribute.UserPrincipalNotFoundException;
-import java.security.Principal;
-import java.util.AbstractMap.SimpleImmutableEntry;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.EnumSet;
-import java.util.HashSet;
-import java.util.LinkedHashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.NavigableMap;
-import java.util.Objects;
-import java.util.Set;
-import java.util.TreeMap;
-import java.util.TreeSet;
-import java.util.concurrent.CopyOnWriteArraySet;
-import java.util.function.IntUnaryOperator;
-
-import org.apache.sshd.common.FactoryManager;
-import org.apache.sshd.common.NamedFactory;
-import org.apache.sshd.common.NamedResource;
-import org.apache.sshd.common.OptionalFeature;
-import org.apache.sshd.common.PropertyResolver;
-import org.apache.sshd.common.PropertyResolverUtils;
-import org.apache.sshd.common.config.VersionProperties;
-import org.apache.sshd.common.digest.BuiltinDigests;
-import org.apache.sshd.common.digest.Digest;
-import org.apache.sshd.common.subsystem.sftp.SftpConstants;
-import org.apache.sshd.common.subsystem.sftp.SftpException;
-import org.apache.sshd.common.subsystem.sftp.SftpHelper;
-import org.apache.sshd.common.subsystem.sftp.extensions.AclSupportedParser;
-import 
org.apache.sshd.common.subsystem.sftp.extensions.SpaceAvailableExtensionInfo;
-import 
org.apache.sshd.common.subsystem.sftp.extensions.openssh.AbstractOpenSSHExtensionParser.OpenSSHExtension;
-import 
org.apache.sshd.common.subsystem.sftp.extensions.openssh.FsyncExtensionParser;
-import 
org.apache.sshd.common.subsystem.sftp.extensions.openssh.HardLinkExtensionParser;
-import org.apache.sshd.common.util.EventListenerUtils;
-import org.apache.sshd.common.util.GenericUtils;
-import org.apache.sshd.common.util.NumberUtils;
-import org.apache.sshd.common.util.OsUtils;
-import org.apache.sshd.common.util.SelectorUtils;
-import org.apache.sshd.common.util.ValidateUtils;
-import org.apache.sshd.common.util.buffer.Buffer;
-import org.apache.sshd.common.util.buffer.BufferUtils;
-import org.apache.sshd.common.util.io.FileInfoExtractor;
-import 

[19/30] mina-sshd git commit: [SSHD-815] Extract SFTP in its own module

2018-04-16 Thread gnodet
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/251db9b9/sshd-core/src/test/java/org/apache/sshd/client/subsystem/sftp/SftpFileSystemTest.java
--
diff --git 
a/sshd-core/src/test/java/org/apache/sshd/client/subsystem/sftp/SftpFileSystemTest.java
 
b/sshd-core/src/test/java/org/apache/sshd/client/subsystem/sftp/SftpFileSystemTest.java
deleted file mode 100644
index bc7b7f3..000
--- 
a/sshd-core/src/test/java/org/apache/sshd/client/subsystem/sftp/SftpFileSystemTest.java
+++ /dev/null
@@ -1,490 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.sshd.client.subsystem.sftp;
-
-import java.io.IOException;
-import java.net.URI;
-import java.nio.ByteBuffer;
-import java.nio.channels.FileChannel;
-import java.nio.channels.FileLock;
-import java.nio.channels.OverlappingFileLockException;
-import java.nio.charset.StandardCharsets;
-import java.nio.file.DirectoryStream;
-import java.nio.file.FileAlreadyExistsException;
-import java.nio.file.FileStore;
-import java.nio.file.FileSystem;
-import java.nio.file.FileSystems;
-import java.nio.file.Files;
-import java.nio.file.LinkOption;
-import java.nio.file.NoSuchFileException;
-import java.nio.file.Path;
-import java.nio.file.StandardCopyOption;
-import java.nio.file.StandardOpenOption;
-import java.nio.file.attribute.AclEntry;
-import java.nio.file.attribute.AclFileAttributeView;
-import java.nio.file.attribute.FileAttributeView;
-import java.nio.file.attribute.FileTime;
-import java.nio.file.attribute.GroupPrincipal;
-import java.nio.file.attribute.PosixFilePermissions;
-import java.nio.file.attribute.UserPrincipalLookupService;
-import java.nio.file.attribute.UserPrincipalNotFoundException;
-import java.nio.file.spi.FileSystemProvider;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Date;
-import java.util.EnumSet;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.TreeMap;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import org.apache.sshd.client.SshClient;
-import org.apache.sshd.client.session.ClientSession;
-import org.apache.sshd.common.file.FileSystemFactory;
-import org.apache.sshd.common.file.virtualfs.VirtualFileSystemFactory;
-import org.apache.sshd.common.session.Session;
-import org.apache.sshd.common.subsystem.sftp.SftpConstants;
-import org.apache.sshd.common.util.GenericUtils;
-import org.apache.sshd.common.util.OsUtils;
-import org.apache.sshd.common.util.io.IoUtils;
-import org.apache.sshd.server.SshServer;
-import org.apache.sshd.server.scp.ScpCommandFactory;
-import org.apache.sshd.server.subsystem.sftp.SftpSubsystemEnvironment;
-import org.apache.sshd.server.subsystem.sftp.SftpSubsystemFactory;
-import org.apache.sshd.util.test.BaseTestSupport;
-import org.apache.sshd.util.test.Utils;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.FixMethodOrder;
-import org.junit.Test;
-import org.junit.runners.MethodSorters;
-
-@FixMethodOrder(MethodSorters.NAME_ASCENDING)
-public class SftpFileSystemTest extends BaseTestSupport {
-private static SshServer sshd;
-private static int port;
-
-private final FileSystemFactory fileSystemFactory;
-
-public SftpFileSystemTest() throws IOException {
-Path targetPath = detectTargetFolder();
-Path parentPath = targetPath.getParent();
-fileSystemFactory = new VirtualFileSystemFactory(parentPath);
-}
-
-@BeforeClass
-public static void setupServerInstance() throws Exception {
-sshd = Utils.setupTestServer(SftpFileSystemTest.class);
-sshd.setSubsystemFactories(Collections.singletonList(new 
SftpSubsystemFactory()));
-sshd.setCommandFactory(new ScpCommandFactory());
-sshd.start();
-port = sshd.getPort();
-}
-
-@AfterClass
-public static void tearDownServerInstance() throws Exception {
-if (sshd != null) {
-try {
-sshd.stop(true);
-} finally {
-sshd = null;
-}
-}
-}
-
-

[16/30] mina-sshd git commit: [SSHD-815] Extract SFTP in its own module

2018-04-16 Thread gnodet
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/251db9b9/sshd-core/src/test/java/org/apache/sshd/common/subsystem/sftp/SftpConstantsTest.java
--
diff --git 
a/sshd-core/src/test/java/org/apache/sshd/common/subsystem/sftp/SftpConstantsTest.java
 
b/sshd-core/src/test/java/org/apache/sshd/common/subsystem/sftp/SftpConstantsTest.java
deleted file mode 100644
index d059d36..000
--- 
a/sshd-core/src/test/java/org/apache/sshd/common/subsystem/sftp/SftpConstantsTest.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.sshd.common.subsystem.sftp;
-
-import org.apache.sshd.common.util.GenericUtils;
-import org.apache.sshd.util.test.BaseTestSupport;
-import org.apache.sshd.util.test.NoIoTestCase;
-import org.junit.FixMethodOrder;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-import org.junit.runners.MethodSorters;
-
-/**
- * @author mailto:d...@mina.apache.org;>Apache MINA SSHD Project
- */
-@FixMethodOrder(MethodSorters.NAME_ASCENDING)
-@Category({ NoIoTestCase.class })
-public class SftpConstantsTest extends BaseTestSupport {
-public SftpConstantsTest() {
-super();
-}
-
-@Test
-public void testRenameModesNotMarkedAsOpcodes() {
-for (int cmd : new int[]{
-SftpConstants.SSH_FXP_RENAME_OVERWRITE,
-SftpConstants.SSH_FXP_RENAME_ATOMIC,
-SftpConstants.SSH_FXP_RENAME_NATIVE
-}) {
-String name = SftpConstants.getCommandMessageName(cmd);
-assertFalse("Mismatched name for " + cmd + ": " + name, 
name.startsWith("SSH_FXP_RENAME_"));
-}
-}
-
-@Test
-public void testRealPathModesNotMarkedAsOpcodes() {
-for (int cmd = SftpConstants.SSH_FXP_REALPATH_NO_CHECK; cmd <= 
SftpConstants.SSH_FXP_REALPATH_STAT_IF; cmd++) {
-String name = SftpConstants.getCommandMessageName(cmd);
-assertFalse("Mismatched name for " + cmd + ": " + name, 
name.startsWith("SSH_FXP_REALPATH_"));
-}
-}
-
-@Test
-public void testSubstatusNameResolution() {
-for (int status = SftpConstants.SSH_FX_OK; status <= 
SftpConstants.SSH_FX_NO_MATCHING_BYTE_RANGE_LOCK; status++) {
-String name = SftpConstants.getStatusName(status);
-assertTrue("Failed to convert status=" + status + ": " + name, 
name.startsWith("SSH_FX_"));
-}
-}
-
-@Test
-public void testSubstatusMessageResolution() {
-for (int status = SftpConstants.SSH_FX_OK; status <= 
SftpConstants.SSH_FX_NO_MATCHING_BYTE_RANGE_LOCK; status++) {
-String message = SftpHelper.resolveStatusMessage(status);
-assertTrue("Missing message for status=" + status, 
GenericUtils.isNotEmpty(message));
-}
-}
-}

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/251db9b9/sshd-core/src/test/java/org/apache/sshd/common/subsystem/sftp/SftpUniversalOwnerAndGroupTest.java
--
diff --git 
a/sshd-core/src/test/java/org/apache/sshd/common/subsystem/sftp/SftpUniversalOwnerAndGroupTest.java
 
b/sshd-core/src/test/java/org/apache/sshd/common/subsystem/sftp/SftpUniversalOwnerAndGroupTest.java
deleted file mode 100644
index 704aa05..000
--- 
a/sshd-core/src/test/java/org/apache/sshd/common/subsystem/sftp/SftpUniversalOwnerAndGroupTest.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the

[15/30] mina-sshd git commit: [SSHD-815] Extract SFTP in its own module

2018-04-16 Thread gnodet
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/251db9b9/sshd-sftp/src/main/java/org/apache/sshd/client/subsystem/sftp/SftpClient.java
--
diff --git 
a/sshd-sftp/src/main/java/org/apache/sshd/client/subsystem/sftp/SftpClient.java 
b/sshd-sftp/src/main/java/org/apache/sshd/client/subsystem/sftp/SftpClient.java
new file mode 100644
index 000..43cc619
--- /dev/null
+++ 
b/sshd-sftp/src/main/java/org/apache/sshd/client/subsystem/sftp/SftpClient.java
@@ -0,0 +1,1038 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sshd.client.subsystem.sftp;
+
+import java.io.Closeable;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.nio.channels.Channel;
+import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.OpenOption;
+import java.nio.file.StandardOpenOption;
+import java.nio.file.attribute.AclEntry;
+import java.nio.file.attribute.FileTime;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.EnumSet;
+import java.util.List;
+import java.util.Map;
+import java.util.NavigableMap;
+import java.util.Objects;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicReference;
+
+import org.apache.sshd.client.subsystem.SubsystemClient;
+import org.apache.sshd.client.subsystem.sftp.extensions.SftpClientExtension;
+import org.apache.sshd.common.subsystem.sftp.SftpConstants;
+import org.apache.sshd.common.subsystem.sftp.SftpHelper;
+import org.apache.sshd.common.util.GenericUtils;
+import org.apache.sshd.common.util.ValidateUtils;
+import org.apache.sshd.common.util.buffer.BufferUtils;
+
+/**
+ * @author http://mina.apache.org;>Apache MINA Project
+ */
+public interface SftpClient extends SubsystemClient {
+/**
+ * Used to indicate the {@link Charset} (or its name) for decoding
+ * referenced files/folders names - extracted from the client session
+ * when 1st initialized.
+ * @see #DEFAULT_NAME_DECODING_CHARSET
+ * @see #getNameDecodingCharset()
+ * @see #setNameDecodingCharset(Charset)
+ */
+String NAME_DECODING_CHARSET = "sftp-name-decoding-charset";
+
+/**
+ * Default value of {@value #NAME_DECODING_CHARSET}
+ */
+Charset DEFAULT_NAME_DECODING_CHARSET = StandardCharsets.UTF_8;
+
+enum OpenMode {
+Read,
+Write,
+Append,
+Create,
+Truncate,
+Exclusive;
+
+/**
+ * The {@link Set} of {@link OpenOption}-s supported by {@link 
#fromOpenOptions(Collection)}
+ */
+public static final Set SUPPORTED_OPTIONS =
+Collections.unmodifiableSet(
+EnumSet.of(
+StandardOpenOption.READ, 
StandardOpenOption.APPEND,
+StandardOpenOption.CREATE, 
StandardOpenOption.TRUNCATE_EXISTING,
+StandardOpenOption.WRITE, 
StandardOpenOption.CREATE_NEW,
+StandardOpenOption.SPARSE));
+
+/**
+ * Converts {@link StandardOpenOption}-s into {@link OpenMode}-s
+ *
+ * @param options The original options - ignored if {@code null}/empty
+ * @return A {@link Set} of the equivalent modes
+ * @throws IllegalArgumentException If an unsupported option is 
requested
+ * @see #SUPPORTED_OPTIONS
+ */
+public static Set fromOpenOptions(Collection options) {
+if (GenericUtils.isEmpty(options)) {
+return Collections.emptySet();
+}
+
+Set modes = EnumSet.noneOf(OpenMode.class);
+for (OpenOption option : options) {
+if (option == StandardOpenOption.READ) {
+modes.add(Read);
+} else if (option == StandardOpenOption.APPEND) {
+modes.add(Append);
+} else if (option == StandardOpenOption.CREATE) {
+modes.add(Create);
+} else if (option == 

[17/30] mina-sshd git commit: [SSHD-815] Extract SFTP in its own module

2018-04-16 Thread gnodet
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/251db9b9/sshd-core/src/test/java/org/apache/sshd/client/subsystem/sftp/SftpVersionsTest.java
--
diff --git 
a/sshd-core/src/test/java/org/apache/sshd/client/subsystem/sftp/SftpVersionsTest.java
 
b/sshd-core/src/test/java/org/apache/sshd/client/subsystem/sftp/SftpVersionsTest.java
deleted file mode 100644
index 76711fe..000
--- 
a/sshd-core/src/test/java/org/apache/sshd/client/subsystem/sftp/SftpVersionsTest.java
+++ /dev/null
@@ -1,510 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.sshd.client.subsystem.sftp;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.nio.charset.StandardCharsets;
-import java.nio.file.Files;
-import java.nio.file.LinkOption;
-import java.nio.file.Path;
-import java.nio.file.attribute.AclEntry;
-import java.nio.file.attribute.AclEntryFlag;
-import java.nio.file.attribute.AclEntryPermission;
-import java.nio.file.attribute.AclEntryType;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Date;
-import java.util.EnumSet;
-import java.util.List;
-import java.util.Map;
-import java.util.NavigableMap;
-import java.util.TreeMap;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.concurrent.atomic.AtomicReference;
-import java.util.stream.Collectors;
-import java.util.stream.IntStream;
-
-import org.apache.sshd.client.session.ClientSession;
-import org.apache.sshd.client.subsystem.sftp.SftpClient.Attributes;
-import org.apache.sshd.client.subsystem.sftp.SftpClient.CloseableHandle;
-import org.apache.sshd.client.subsystem.sftp.SftpClient.DirEntry;
-import org.apache.sshd.client.subsystem.sftp.SftpClient.OpenMode;
-import org.apache.sshd.common.NamedFactory;
-import org.apache.sshd.common.subsystem.sftp.SftpConstants;
-import org.apache.sshd.common.subsystem.sftp.SftpHelper;
-import org.apache.sshd.common.util.GenericUtils;
-import org.apache.sshd.server.Command;
-import org.apache.sshd.server.session.ServerSession;
-import org.apache.sshd.server.subsystem.sftp.AbstractSftpEventListenerAdapter;
-import org.apache.sshd.server.subsystem.sftp.DefaultGroupPrincipal;
-import org.apache.sshd.server.subsystem.sftp.SftpEventListener;
-import org.apache.sshd.server.subsystem.sftp.SftpSubsystem;
-import org.apache.sshd.server.subsystem.sftp.SftpSubsystemEnvironment;
-import org.apache.sshd.server.subsystem.sftp.SftpSubsystemFactory;
-import org.apache.sshd.util.test.JUnit4ClassRunnerWithParametersFactory;
-import org.apache.sshd.util.test.Utils;
-import org.junit.Before;
-import org.junit.FixMethodOrder;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.MethodSorters;
-import org.junit.runners.Parameterized;
-import org.junit.runners.Parameterized.Parameters;
-import org.junit.runners.Parameterized.UseParametersRunnerFactory;
-
-/**
- * @author mailto:d...@mina.apache.org;>Apache MINA SSHD Project
- */
-@FixMethodOrder(MethodSorters.NAME_ASCENDING)
-@RunWith(Parameterized.class)   // see 
https://github.com/junit-team/junit/wiki/Parameterized-tests
-@UseParametersRunnerFactory(JUnit4ClassRunnerWithParametersFactory.class)
-public class SftpVersionsTest extends AbstractSftpClientTestSupport {
-private static final List VERSIONS =
-Collections.unmodifiableList(
-IntStream.rangeClosed(SftpSubsystemEnvironment.LOWER_SFTP_IMPL, 
SftpSubsystemEnvironment.HIGHER_SFTP_IMPL)
-.boxed()
-.collect(Collectors.toList()));
-
-private final int testVersion;
-
-public SftpVersionsTest(int version) throws IOException {
-testVersion = version;
-}
-
-@Parameters(name = "version={0}")
-public static Collection parameters() {
-return parameterize(VERSIONS);
-}
-
-@Before
-public void setUp() throws Exception {
-setupServer();
-}
-
-public final int getTestedVersion() {
-return testVersion;
-}
-
-@Test   // See SSHD-749
-public void testSftpOpenFlags() throws Exception {
-Path targetPath 

[4/5] mina-sshd git commit: Fix SSHD-721 unit test formatting

2018-04-16 Thread gnodet
Fix SSHD-721 unit test formatting


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/999c9868
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/999c9868
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/999c9868

Branch: refs/heads/master
Commit: 999c98689013a7f041ed235e7438633281c1a021
Parents: f029d16
Author: Guillaume Nodet 
Authored: Mon Apr 16 14:42:38 2018 +0200
Committer: Guillaume Nodet 
Committed: Mon Apr 16 14:42:38 2018 +0200

--
 .../forward/ConcurrentConnectionTest.java   | 442 +--
 1 file changed, 209 insertions(+), 233 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/999c9868/sshd-core/src/test/java/org/apache/sshd/common/forward/ConcurrentConnectionTest.java
--
diff --git 
a/sshd-core/src/test/java/org/apache/sshd/common/forward/ConcurrentConnectionTest.java
 
b/sshd-core/src/test/java/org/apache/sshd/common/forward/ConcurrentConnectionTest.java
index 38434df..89a282c 100644
--- 
a/sshd-core/src/test/java/org/apache/sshd/common/forward/ConcurrentConnectionTest.java
+++ 
b/sshd-core/src/test/java/org/apache/sshd/common/forward/ConcurrentConnectionTest.java
@@ -29,11 +29,9 @@ import java.util.concurrent.atomic.AtomicInteger;
 
 import org.apache.sshd.client.SshClient;
 import org.apache.sshd.client.session.ClientSession;
-import org.apache.sshd.common.session.Session;
 import org.apache.sshd.common.util.net.SshdSocketAddress;
 import org.apache.sshd.server.SshServer;
 import org.apache.sshd.server.forward.AcceptAllForwardingFilter;
-import org.apache.sshd.server.forward.ForwardingFilter;
 import org.apache.sshd.server.keyprovider.SimpleGeneratorHostKeyProvider;
 import org.apache.sshd.util.test.BaseTestSupport;
 import org.junit.After;
@@ -48,234 +46,212 @@ import org.slf4j.LoggerFactory;
  * Port forwarding test multiple clients connecting at once.
  */
 public class ConcurrentConnectionTest extends BaseTestSupport {
-   private static final byte[] PAYLOAD_TO_SERVER = "To Server -> To Server 
-> To Server".getBytes();
-   private static final byte[] PAYLOAD_TO_CLIENT = "<- To Client <- To 
Client <-".getBytes();
-   private final static Logger LOG = 
LoggerFactory.getLogger(ConcurrentConnectionTest.class);
-
-   // These are the critical test parameters.
-   // When the number of clients is greater than or equal to the number of 
IO
-   // Workers, the server deadlocks
-   private static final int SSHD_NIO_WORKERS = 8;
-   private static final int PORT_FORWARD_CLIENT_COUNT = 12;
-
-   // For very large numbers of clients and small numbers of threads this 
may
-   // need to be increased
-   private static final int TIMEOUT = (int) TimeUnit.SECONDS.toMillis(10L);
-
-   // Test Server State
-   private int testServerPort;
-   private ServerSocket testServerSock;
-   private Thread testServerThread;
-
-   // SSHD Server State
-   private static int sshServerPort;
-   private static SshServer server;
-
-   // SSH Client State
-   private ClientSession session;
-
-   /*
-* Start a server to forward to.
-*
-* Reads PAYLOAD_TO_SERVER from client and then sends PAYLOAD_TO_CLIENT 
to
-* client. This server emulates a web server, closely enough for thie 
test
-*/
-   @Before
-   public void startTestServer() throws Exception {
-   final AtomicInteger activeServers = new AtomicInteger(0);
-   testServerThread = new Thread(() -> {
-   try {
-   testServerSock = new ServerSocket(0);
-   testServerPort = testServerSock.getLocalPort();
-   LOG.debug("Listening on {}", testServerPort);
-   while (true) {
-   final Socket s = 
testServerSock.accept();
-   LOG.debug("Got connection");
-   final Thread server = new Thread(() -> {
-   try {
-   LOG.debug("Active 
Servers: {}", activeServers.incrementAndGet());
-   final byte[] buf = new 
byte[PAYLOAD_TO_SERVER.length];
-   final long r = 
s.getInputStream().read(buf);
-   LOG.debug("Read {} 
payload from client", r);
-   
s.getOutputStream().write(PAYLOAD_TO_CLIENT);
-   

[1/5] mina-sshd git commit: [SSHD-721] I/O workers exhaustion in tcpip forwarding

2018-04-16 Thread gnodet
Repository: mina-sshd
Updated Branches:
  refs/heads/master 251db9b9d -> 721f399bd


[SSHD-721] I/O workers exhaustion in tcpip forwarding


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/ca578eb1
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/ca578eb1
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/ca578eb1

Branch: refs/heads/master
Commit: ca578eb1c74d94ad89e2d4ab0d94489eace7a0c6
Parents: 3c9efa8
Author: Guillaume Nodet 
Authored: Sun Apr 15 21:01:09 2018 +0200
Committer: Guillaume Nodet 
Committed: Sun Apr 15 21:01:09 2018 +0200

--
 .../common/forward/DefaultForwardingFilter.java | 24 +---
 1 file changed, 16 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/ca578eb1/sshd-core/src/main/java/org/apache/sshd/common/forward/DefaultForwardingFilter.java
--
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/common/forward/DefaultForwardingFilter.java
 
b/sshd-core/src/main/java/org/apache/sshd/common/forward/DefaultForwardingFilter.java
index 7936415..751f73a 100644
--- 
a/sshd-core/src/main/java/org/apache/sshd/common/forward/DefaultForwardingFilter.java
+++ 
b/sshd-core/src/main/java/org/apache/sshd/common/forward/DefaultForwardingFilter.java
@@ -37,6 +37,7 @@ import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicLong;
 
 import org.apache.sshd.client.channel.ClientChannelEvent;
+import org.apache.sshd.client.future.OpenFuture;
 import org.apache.sshd.common.Closeable;
 import org.apache.sshd.common.Factory;
 import org.apache.sshd.common.FactoryManager;
@@ -979,15 +980,22 @@ public class DefaultForwardingFilter
   session, channel, totalMessages, 
message.available());
 }
 
-Collection result = 
channel.waitFor(STATIC_IO_MSG_RECEIVED_EVENTS, Long.MAX_VALUE);
-if (traceEnabled) {
-log.trace("messageReceived({}) channel={}, count={}, len={} 
wait result: {}",
-  session, channel, totalMessages, 
message.available(), result);
+OpenFuture future = channel.getOpenFuture();
+if (future.isOpened()) {
+OutputStream outputStream = channel.getInvertedIn();
+outputStream.write(buffer.array(), buffer.rpos(), 
buffer.available());
+outputStream.flush();
+} else {
+future.addListener(f -> {
+try {
+OutputStream outputStream = channel.getInvertedIn();
+outputStream.write(buffer.array(), buffer.rpos(), 
buffer.available());
+outputStream.flush();
+} catch (IOException e) {
+channel.getSession().exceptionCaught(e);
+}
+});
 }
-
-OutputStream outputStream = channel.getInvertedIn();
-outputStream.write(buffer.array(), buffer.rpos(), 
buffer.available());
-outputStream.flush();
 }
 
 @Override



[2/5] mina-sshd git commit: Test for SSHD-721. Many concurrent port forward connections deadlock.

2018-04-16 Thread gnodet
Test for SSHD-721. Many concurrent port forward connections deadlock.

Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/5abc47e8
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/5abc47e8
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/5abc47e8

Branch: refs/heads/master
Commit: 5abc47e8cc4655c8d58b6d8b41c291c33c2e13db
Parents: 83925cb
Author: bkuker 
Authored: Fri Apr 13 16:19:46 2018 -0400
Committer: bkuker 
Committed: Mon Apr 16 08:20:54 2018 -0400

--
 .../forward/ConcurrentConnectionTest.java   | 281 +++
 1 file changed, 281 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/5abc47e8/sshd-core/src/test/java/org/apache/sshd/common/forward/ConcurrentConnectionTest.java
--
diff --git 
a/sshd-core/src/test/java/org/apache/sshd/common/forward/ConcurrentConnectionTest.java
 
b/sshd-core/src/test/java/org/apache/sshd/common/forward/ConcurrentConnectionTest.java
new file mode 100644
index 000..38434df
--- /dev/null
+++ 
b/sshd-core/src/test/java/org/apache/sshd/common/forward/ConcurrentConnectionTest.java
@@ -0,0 +1,281 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sshd.common.forward;
+
+import java.io.IOException;
+import java.net.InetSocketAddress;
+import java.net.ServerSocket;
+import java.net.Socket;
+import java.net.SocketException;
+import java.util.concurrent.CyclicBarrier;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.apache.sshd.client.SshClient;
+import org.apache.sshd.client.session.ClientSession;
+import org.apache.sshd.common.session.Session;
+import org.apache.sshd.common.util.net.SshdSocketAddress;
+import org.apache.sshd.server.SshServer;
+import org.apache.sshd.server.forward.AcceptAllForwardingFilter;
+import org.apache.sshd.server.forward.ForwardingFilter;
+import org.apache.sshd.server.keyprovider.SimpleGeneratorHostKeyProvider;
+import org.apache.sshd.util.test.BaseTestSupport;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Port forwarding test multiple clients connecting at once.
+ */
+public class ConcurrentConnectionTest extends BaseTestSupport {
+   private static final byte[] PAYLOAD_TO_SERVER = "To Server -> To Server 
-> To Server".getBytes();
+   private static final byte[] PAYLOAD_TO_CLIENT = "<- To Client <- To 
Client <-".getBytes();
+   private final static Logger LOG = 
LoggerFactory.getLogger(ConcurrentConnectionTest.class);
+
+   // These are the critical test parameters.
+   // When the number of clients is greater than or equal to the number of 
IO
+   // Workers, the server deadlocks
+   private static final int SSHD_NIO_WORKERS = 8;
+   private static final int PORT_FORWARD_CLIENT_COUNT = 12;
+
+   // For very large numbers of clients and small numbers of threads this 
may
+   // need to be increased
+   private static final int TIMEOUT = (int) TimeUnit.SECONDS.toMillis(10L);
+
+   // Test Server State
+   private int testServerPort;
+   private ServerSocket testServerSock;
+   private Thread testServerThread;
+
+   // SSHD Server State
+   private static int sshServerPort;
+   private static SshServer server;
+
+   // SSH Client State
+   private ClientSession session;
+
+   /*
+* Start a server to forward to.
+*
+* Reads PAYLOAD_TO_SERVER from client and then sends PAYLOAD_TO_CLIENT 
to
+* client. This server emulates a web server, closely enough for thie 
test
+*/
+   @Before
+   public void startTestServer() throws Exception {
+   final AtomicInteger activeServers = new AtomicInteger(0);
+   testServerThread = new Thread(() 

[3/5] mina-sshd git commit: Merge pull request #1 from bkuker/sshd-721

2018-04-16 Thread gnodet
Merge pull request #1 from bkuker/sshd-721

[SSHD-721] I/O workers exhaustion in tcpip forwarding, test

Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/f029d162
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/f029d162
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/f029d162

Branch: refs/heads/master
Commit: f029d162c2dc732dabfd4b25c5790def917cba77
Parents: ca578eb 5abc47e
Author: Guillaume Nodet 
Authored: Mon Apr 16 14:30:10 2018 +0200
Committer: GitHub 
Committed: Mon Apr 16 14:30:10 2018 +0200

--
 .../forward/ConcurrentConnectionTest.java   | 281 +++
 1 file changed, 281 insertions(+)
--




[5/5] mina-sshd git commit: Merge branch 'SSHD-721'

2018-04-16 Thread gnodet
Merge branch 'SSHD-721'


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/721f399b
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/721f399b
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/721f399b

Branch: refs/heads/master
Commit: 721f399bd919845a15e678336baabaed2bf068d5
Parents: 251db9b 999c986
Author: Guillaume Nodet 
Authored: Mon Apr 16 14:43:20 2018 +0200
Committer: Guillaume Nodet 
Committed: Mon Apr 16 14:43:20 2018 +0200

--
 .../common/forward/DefaultForwardingFilter.java |  24 +-
 .../forward/ConcurrentConnectionTest.java   | 257 +++
 2 files changed, 273 insertions(+), 8 deletions(-)
--




[07/30] mina-sshd git commit: [SSHD-815] Extract SFTP in its own module

2018-04-16 Thread gnodet
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/251db9b9/sshd-sftp/src/main/java/org/apache/sshd/server/subsystem/sftp/DefaultGroupPrincipal.java
--
diff --git 
a/sshd-sftp/src/main/java/org/apache/sshd/server/subsystem/sftp/DefaultGroupPrincipal.java
 
b/sshd-sftp/src/main/java/org/apache/sshd/server/subsystem/sftp/DefaultGroupPrincipal.java
new file mode 100644
index 000..acf3118
--- /dev/null
+++ 
b/sshd-sftp/src/main/java/org/apache/sshd/server/subsystem/sftp/DefaultGroupPrincipal.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sshd.server.subsystem.sftp;
+
+import java.nio.file.attribute.GroupPrincipal;
+
+/**
+ * @author mailto:d...@mina.apache.org;>Apache MINA SSHD Project
+ */
+public class DefaultGroupPrincipal extends PrincipalBase implements 
GroupPrincipal {
+
+public DefaultGroupPrincipal(String name) {
+super(name);
+}
+
+}

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/251db9b9/sshd-sftp/src/main/java/org/apache/sshd/server/subsystem/sftp/DefaultUserPrincipal.java
--
diff --git 
a/sshd-sftp/src/main/java/org/apache/sshd/server/subsystem/sftp/DefaultUserPrincipal.java
 
b/sshd-sftp/src/main/java/org/apache/sshd/server/subsystem/sftp/DefaultUserPrincipal.java
new file mode 100644
index 000..d71d772
--- /dev/null
+++ 
b/sshd-sftp/src/main/java/org/apache/sshd/server/subsystem/sftp/DefaultUserPrincipal.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sshd.server.subsystem.sftp;
+
+import java.nio.file.attribute.UserPrincipal;
+
+/**
+ * @author mailto:d...@mina.apache.org;>Apache MINA SSHD Project
+ */
+public class DefaultUserPrincipal extends PrincipalBase implements 
UserPrincipal {
+
+public DefaultUserPrincipal(String name) {
+super(name);
+}
+
+}

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/251db9b9/sshd-sftp/src/main/java/org/apache/sshd/server/subsystem/sftp/DirectoryHandle.java
--
diff --git 
a/sshd-sftp/src/main/java/org/apache/sshd/server/subsystem/sftp/DirectoryHandle.java
 
b/sshd-sftp/src/main/java/org/apache/sshd/server/subsystem/sftp/DirectoryHandle.java
new file mode 100644
index 000..0ae60cf
--- /dev/null
+++ 
b/sshd-sftp/src/main/java/org/apache/sshd/server/subsystem/sftp/DirectoryHandle.java
@@ -0,0 +1,109 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sshd.server.subsystem.sftp;
+
+import java.io.IOException;
+import 

<    2   3   4   5   6   7   8   9   10   >