maven-wagon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r660528 - in /maven/wagon/trunk: wagon-provider-api/src/main/java/org/apache/maven/wagon/ wagon-providers/wagon-ssh-common/src/main/java/org/apache/maven/wagon/providers/ssh/ wagon-providers/wagon-ssh-external/src/main/java/org/apache/maven...
Date Tue, 27 May 2008 14:21:47 GMT
Author: brett
Date: Tue May 27 07:21:39 2008
New Revision: 660528

URL: http://svn.apache.org/viewvc?rev=660528&view=rev
Log:
[WAGON-152] scpexe won't honour .ssh/config information

Modified:
    maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/WagonUtils.java
    maven/wagon/trunk/wagon-providers/wagon-ssh-common/src/main/java/org/apache/maven/wagon/providers/ssh/AbstractSshWagon.java
    maven/wagon/trunk/wagon-providers/wagon-ssh-external/src/main/java/org/apache/maven/wagon/providers/ssh/external/ScpExternalWagon.java
    maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/main/java/org/apache/maven/wagon/providers/ssh/ganymed/AbstractGanymedWagon.java
    maven/wagon/trunk/wagon-providers/wagon-ssh/src/main/java/org/apache/maven/wagon/providers/ssh/jsch/AbstractJschWagon.java

Modified: maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/WagonUtils.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/WagonUtils.java?rev=660528&r1=660527&r2=660528&view=diff
==============================================================================
--- maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/WagonUtils.java
(original)
+++ maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/WagonUtils.java
Tue May 27 07:21:39 2008
@@ -119,37 +119,4 @@
         }
 
     }
-
-    public static AuthenticationInfo getAuthInfo()
-    {
-        // TODO: not used presently?
-
-        AuthenticationInfo authInfo = new AuthenticationInfo();
-
-        String userName = getUserName();
-
-        authInfo.setUserName( userName );
-
-        File privateKey = new File( System.getProperty( "user.home" ), "/.ssh/id_dsa" );
-
-        if ( privateKey.exists() )
-        {
-            authInfo.setPrivateKey( privateKey.getAbsolutePath() );
-
-            authInfo.setPassphrase( "" );
-        }
-
-        // TODO: what about modes, groups?
-
-        return authInfo;
-    }
-
-    public static String getUserName()
-    {
-        String retValue = System.getProperty( "user.name" );
-
-        return retValue;
-    }
-
-
 }

Modified: maven/wagon/trunk/wagon-providers/wagon-ssh-common/src/main/java/org/apache/maven/wagon/providers/ssh/AbstractSshWagon.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-providers/wagon-ssh-common/src/main/java/org/apache/maven/wagon/providers/ssh/AbstractSshWagon.java?rev=660528&r1=660527&r2=660528&view=diff
==============================================================================
--- maven/wagon/trunk/wagon-providers/wagon-ssh-common/src/main/java/org/apache/maven/wagon/providers/ssh/AbstractSshWagon.java
(original)
+++ maven/wagon/trunk/wagon-providers/wagon-ssh-common/src/main/java/org/apache/maven/wagon/providers/ssh/AbstractSshWagon.java
Tue May 27 07:21:39 2008
@@ -157,11 +157,6 @@
         {
             authenticationInfo = new AuthenticationInfo();
         }
-
-        if ( authenticationInfo.getUserName() == null )
-        {
-            authenticationInfo.setUserName( System.getProperty( "user.name" ) );
-        }
     }
 
     public void closeConnection()

Modified: maven/wagon/trunk/wagon-providers/wagon-ssh-external/src/main/java/org/apache/maven/wagon/providers/ssh/external/ScpExternalWagon.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-providers/wagon-ssh-external/src/main/java/org/apache/maven/wagon/providers/ssh/external/ScpExternalWagon.java?rev=660528&r1=660527&r2=660528&view=diff
==============================================================================
--- maven/wagon/trunk/wagon-providers/wagon-ssh-external/src/main/java/org/apache/maven/wagon/providers/ssh/external/ScpExternalWagon.java
(original)
+++ maven/wagon/trunk/wagon-providers/wagon-ssh-external/src/main/java/org/apache/maven/wagon/providers/ssh/external/ScpExternalWagon.java
Tue May 27 07:21:39 2008
@@ -101,7 +101,15 @@
         {
             username = authenticationInfo.getUserName();
         }
-        return username + "@" + getRepository().getHost();
+        
+        if ( username == null )
+        {
+            return getRepository().getHost();
+        }
+        else
+        {
+            return username + "@" + getRepository().getHost();
+        }
     }
     
     public Streams executeCommand( String command, boolean ignoreFailures )

Modified: maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/main/java/org/apache/maven/wagon/providers/ssh/ganymed/AbstractGanymedWagon.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/main/java/org/apache/maven/wagon/providers/ssh/ganymed/AbstractGanymedWagon.java?rev=660528&r1=660527&r2=660528&view=diff
==============================================================================
--- maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/main/java/org/apache/maven/wagon/providers/ssh/ganymed/AbstractGanymedWagon.java
(original)
+++ maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/main/java/org/apache/maven/wagon/providers/ssh/ganymed/AbstractGanymedWagon.java
Tue May 27 07:21:39 2008
@@ -138,15 +138,19 @@
         {
             boolean authenticated;
 
+            String userName = authenticationInfo.getUserName();
+            if ( userName == null )
+            {
+                userName = System.getProperty( "user.name" );
+            }
             if ( privateKey != null && privateKey.exists() )
             {
-                authenticated = connection.authenticateWithPublicKey( authenticationInfo.getUserName(),
privateKey,
-                                                                      authenticationInfo.getPassphrase()
);
+                authenticated =
+                    connection.authenticateWithPublicKey( userName, privateKey, authenticationInfo.getPassphrase()
);
             }
             else
             {
-                authenticated = connection.authenticateWithPassword( authenticationInfo.getUserName(),
-                                                                     authenticationInfo.getPassword()
);
+                authenticated = connection.authenticateWithPassword( userName, authenticationInfo.getPassword()
);
             }
             // TODO! keyboard interactive
 

Modified: maven/wagon/trunk/wagon-providers/wagon-ssh/src/main/java/org/apache/maven/wagon/providers/ssh/jsch/AbstractJschWagon.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-providers/wagon-ssh/src/main/java/org/apache/maven/wagon/providers/ssh/jsch/AbstractJschWagon.java?rev=660528&r1=660527&r2=660528&view=diff
==============================================================================
--- maven/wagon/trunk/wagon-providers/wagon-ssh/src/main/java/org/apache/maven/wagon/providers/ssh/jsch/AbstractJschWagon.java
(original)
+++ maven/wagon/trunk/wagon-providers/wagon-ssh/src/main/java/org/apache/maven/wagon/providers/ssh/jsch/AbstractJschWagon.java
Tue May 27 07:21:39 2008
@@ -126,7 +126,12 @@
         int port = getPort();
         try
         {
-            session = sch.getSession( authenticationInfo.getUserName(), host, port );
+            String userName = authenticationInfo.getUserName();
+            if ( userName == null )
+            {
+                userName = System.getProperty( "user.name" );
+            }
+            session = sch.getSession( userName, host, port );
             session.setTimeout(getTimeout());
         }
         catch ( JSchException e )



---------------------------------------------------------------------
To unsubscribe, e-mail: wagon-commits-unsubscribe@maven.apache.org
For additional commands, e-mail: wagon-commits-help@maven.apache.org


Mime
View raw message