You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mina.apache.org by gn...@apache.org on 2013/07/26 11:49:17 UTC

[1/4] git commit: Fix small typo

Updated Branches:
  refs/heads/master 050eb2d64 -> f3444e0c8


Fix small typo

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

Branch: refs/heads/master
Commit: 5debd37d64a70836f4371b643bbe7bfcf9b07989
Parents: 050eb2d
Author: Guillaume Nodet <gn...@apache.org>
Authored: Fri Jul 26 11:37:12 2013 +0200
Committer: Guillaume Nodet <gn...@apache.org>
Committed: Fri Jul 26 11:37:12 2013 +0200

----------------------------------------------------------------------
 .../java/org/apache/sshd/common/io/DefaultIoServiceFactory.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/5debd37d/sshd-core/src/main/java/org/apache/sshd/common/io/DefaultIoServiceFactory.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/main/java/org/apache/sshd/common/io/DefaultIoServiceFactory.java b/sshd-core/src/main/java/org/apache/sshd/common/io/DefaultIoServiceFactory.java
index 4111bfa..552d069 100644
--- a/sshd-core/src/main/java/org/apache/sshd/common/io/DefaultIoServiceFactory.java
+++ b/sshd-core/src/main/java/org/apache/sshd/common/io/DefaultIoServiceFactory.java
@@ -57,7 +57,7 @@ public class DefaultIoServiceFactory implements IoServiceFactory {
                 return t;
             }
         }
-        throw new IllegalStateException("Cound not find a valid sshd io provider");
+        throw new IllegalStateException("Could not find a valid sshd io provider");
     }
 
     private static <T> T tryLoad(ServiceLoader<T> loader) {


[2/4] git commit: [SSHD-247] Enable SCP and SFTP in the default distribution Also add an option to select the IO provider

Posted by gn...@apache.org.
[SSHD-247] Enable SCP and SFTP in the default distribution
Also add an option to select the 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/925e3ff5
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/925e3ff5
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/925e3ff5

Branch: refs/heads/master
Commit: 925e3ff50a9d64f7f48bc7f2cea9da50969fb7e0
Parents: 5debd37
Author: Guillaume Nodet <gn...@apache.org>
Authored: Fri Jul 26 11:48:34 2013 +0200
Committer: Guillaume Nodet <gn...@apache.org>
Committed: Fri Jul 26 11:48:34 2013 +0200

----------------------------------------------------------------------
 .../main/java/org/apache/sshd/SshServer.java    | 28 +++++++++++++++++++-
 1 file changed, 27 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/925e3ff5/sshd-core/src/main/java/org/apache/sshd/SshServer.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/main/java/org/apache/sshd/SshServer.java b/sshd-core/src/main/java/org/apache/sshd/SshServer.java
index 59c2f79..57d9faf 100644
--- a/sshd-core/src/main/java/org/apache/sshd/SshServer.java
+++ b/sshd-core/src/main/java/org/apache/sshd/SshServer.java
@@ -62,7 +62,10 @@ import org.apache.sshd.common.future.CloseFuture;
 import org.apache.sshd.common.future.SshFutureListener;
 import org.apache.sshd.common.io.DefaultIoServiceFactory;
 import org.apache.sshd.common.io.IoAcceptor;
+import org.apache.sshd.common.io.IoServiceFactory;
 import org.apache.sshd.common.io.IoSession;
+import org.apache.sshd.common.io.mina.MinaServiceFactory;
+import org.apache.sshd.common.io.nio2.Nio2ServiceFactory;
 import org.apache.sshd.common.mac.HMACMD5;
 import org.apache.sshd.common.mac.HMACMD596;
 import org.apache.sshd.common.mac.HMACSHA1;
@@ -87,12 +90,14 @@ import org.apache.sshd.server.auth.UserAuthPublicKey;
 import org.apache.sshd.server.auth.gss.GSSAuthenticator;
 import org.apache.sshd.server.auth.gss.UserAuthGSS;
 import org.apache.sshd.server.channel.ChannelSession;
+import org.apache.sshd.server.command.ScpCommandFactory;
 import org.apache.sshd.server.kex.DHG1;
 import org.apache.sshd.server.kex.DHG14;
 import org.apache.sshd.server.keyprovider.PEMGeneratorHostKeyProvider;
 import org.apache.sshd.server.keyprovider.SimpleGeneratorHostKeyProvider;
 import org.apache.sshd.server.session.ServerSession;
 import org.apache.sshd.server.session.SessionFactory;
+import org.apache.sshd.server.sftp.SftpSubsystem;
 import org.apache.sshd.server.shell.ProcessShellFactory;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -445,6 +450,7 @@ public class SshServer extends AbstractFactoryManager implements ServerFactoryMa
 
     public static void main(String[] args) throws Exception {
         int port = 8000;
+        String provider;
         boolean error = false;
 
         for (int i = 0; i < args.length; i++) {
@@ -454,6 +460,20 @@ public class SshServer extends AbstractFactoryManager implements ServerFactoryMa
                     break;
                 }
                 port = Integer.parseInt(args[++i]);
+            } else if ("-io".equals(args[i])) {
+                if (i + 1 >= args.length) {
+                    System.err.println("option requires an argument: " + args[i]);
+                    break;
+                }
+                provider = args[++i];
+                if ("mina".equals(provider)) {
+                    System.setProperty(IoServiceFactory.class.getName(), MinaServiceFactory.class.getName());
+                } else if ("nio2".endsWith(provider)) {
+                    System.setProperty(IoServiceFactory.class.getName(), Nio2ServiceFactory.class.getName());
+                } else {
+                    System.err.println("provider should be mina or nio2: " + args[i]);
+                    break;
+                }
             } else if (args[i].startsWith("-")) {
                 System.err.println("illegal option: " + args[i]);
                 error = true;
@@ -465,7 +485,7 @@ public class SshServer extends AbstractFactoryManager implements ServerFactoryMa
             }
         }
         if (error) {
-            System.err.println("usage: sshd [-p port]");
+            System.err.println("usage: sshd [-p port] [-io mina|nio2]");
             System.exit(-1);
         }
 
@@ -514,7 +534,13 @@ public class SshServer extends AbstractFactoryManager implements ServerFactoryMa
                 return true;
             }
         });
+        sshd.setCommandFactory(new ScpCommandFactory());
+        sshd.setSubsystemFactories(Arrays.<NamedFactory<Command>>asList(
+                new SftpSubsystem.Factory()
+        ));
         sshd.start();
+
+        Thread.sleep(Long.MAX_VALUE);
     }
 
 }


[4/4] git commit: Remove quotes in SCP transfers

Posted by gn...@apache.org.
Remove quotes in SCP transfers

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

Branch: refs/heads/master
Commit: f3444e0c876dae83a0113046b4862cdd3fa7ec1c
Parents: ec9d260
Author: Guillaume Nodet <gn...@apache.org>
Authored: Fri Jul 26 11:49:01 2013 +0200
Committer: Guillaume Nodet <gn...@apache.org>
Committed: Fri Jul 26 11:49:01 2013 +0200

----------------------------------------------------------------------
 .../src/main/java/org/apache/sshd/server/command/ScpCommand.java  | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/f3444e0c/sshd-core/src/main/java/org/apache/sshd/server/command/ScpCommand.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/main/java/org/apache/sshd/server/command/ScpCommand.java b/sshd-core/src/main/java/org/apache/sshd/server/command/ScpCommand.java
index d67715c..be5fc91 100644
--- a/sshd-core/src/main/java/org/apache/sshd/server/command/ScpCommand.java
+++ b/sshd-core/src/main/java/org/apache/sshd/server/command/ScpCommand.java
@@ -90,6 +90,9 @@ public class ScpCommand implements Command, Runnable, FileSystemAware {
                 }
             } else {
                 path = command.substring(command.indexOf(args[i-1]) + args[i-1].length() + 1);
+                if (path.startsWith("\"") && path.endsWith("\"") || path.startsWith("'") && path.endsWith("'")) {
+                    path = path.substring(1, path.length() - 1);
+                }
                 break;
             }
         }


[3/4] git commit: Fix distribution readme

Posted by gn...@apache.org.
Fix distribution 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/ec9d260a
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/ec9d260a
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/ec9d260a

Branch: refs/heads/master
Commit: ec9d260ab898a1a6265eb376dd864ef236371885
Parents: 925e3ff
Author: Guillaume Nodet <gn...@apache.org>
Authored: Fri Jul 26 11:48:44 2013 +0200
Committer: Guillaume Nodet <gn...@apache.org>
Committed: Fri Jul 26 11:48:44 2013 +0200

----------------------------------------------------------------------
 assembly/src/main/distribution/README.txt | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/ec9d260a/assembly/src/main/distribution/README.txt
----------------------------------------------------------------------
diff --git a/assembly/src/main/distribution/README.txt b/assembly/src/main/distribution/README.txt
index 81e0c30..e6852a8 100644
--- a/assembly/src/main/distribution/README.txt
+++ b/assembly/src/main/distribution/README.txt
@@ -26,12 +26,20 @@ This distribution provides a simple demonstration of a SSH
 server that you can launched using the shell scripts in the
 bin folder.  By default, the port used is 8000 and the authentication
 will succeed if the username and password are the same.
+SCP and SFTP support are both enabled in this configuration.
 
 The lib folder contains the sshd-core jar which is the main jar
 and its required dependencies (slf4j-api and mina-core).
+Note that if you're running on JDK 7, mina-core becomes an optional
+dependency as a native IO layer built on top of NIO2 is provided
+and selected by default if available.
+
 The sshd-pam module is an experimental module for leveraging the
 Unix PAM authentication mechanism which is not really usable at the
 moment.
+The sshf-sftp module is an experimental module which provides an
+object model for the SFTP subsystem to ease writing custom SFTP
+servers.
 
 Please send feedback to users@mina.apache.org.