ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/optional/ssh SSHUserInfo.java
Date Tue, 28 Jun 2005 12:38:46 GMT
bodewig     2005/06/28 05:38:46

  Modified:    .        WHATSNEW
               src/main/org/apache/tools/ant/taskdefs/optional/ssh
                        SSHUserInfo.java
  Log:
  Add support for keyboard-interactive authentication to SSH tasks.
  
  Submitted by:	Atsuhiko Yamanaka
  
  Revision  Changes    Path
  1.841     +2 -0      ant/WHATSNEW
  
  Index: WHATSNEW
  ===================================================================
  RCS file: /home/cvs/ant/WHATSNEW,v
  retrieving revision 1.840
  retrieving revision 1.841
  diff -u -r1.840 -r1.841
  --- WHATSNEW	21 Jun 2005 12:09:24 -0000	1.840
  +++ WHATSNEW	28 Jun 2005 12:38:46 -0000	1.841
  @@ -239,6 +239,8 @@
   * Try to make subprojects of custom Project subclasses instances of the
     same type. Bugzilla report 17901.
   
  +* <ssh> and <scp> support keyboard-interactive authentication now.
  +
   Changes from Ant 1.6.4 to Ant 1.6.5
   ===================================
   
  
  
  
  1.10      +16 -2     ant/src/main/org/apache/tools/ant/taskdefs/optional/ssh/SSHUserInfo.java
  
  Index: SSHUserInfo.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/ssh/SSHUserInfo.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- SSHUserInfo.java	12 Nov 2004 11:07:12 -0000	1.9
  +++ SSHUserInfo.java	28 Jun 2005 12:38:46 -0000	1.10
  @@ -1,5 +1,5 @@
   /*
  - * Copyright  2003-2004 The Apache Software Foundation
  + * Copyright  2003-2005 The Apache Software Foundation
    *
    *  Licensed under the Apache License, Version 2.0 (the "License");
    *  you may not use this file except in compliance with the License.
  @@ -18,10 +18,11 @@
   package org.apache.tools.ant.taskdefs.optional.ssh;
   
   import com.jcraft.jsch.UserInfo;
  +import com.jcraft.jsch.UIKeyboardInteractive;
   
   /**
    */
  -public class SSHUserInfo implements UserInfo {
  +public class SSHUserInfo implements UserInfo, UIKeyboardInteractive {
   
       private String name;
       private String password = null;
  @@ -167,5 +168,18 @@
       public void showMessage(String message) {
           //log(message, Project.MSG_DEBUG);
       }
  +    
  +    public String[] promptKeyboardInteractive(String destination,
  +                                              String name,
  +                                              String instruction,
  +                                              String[] prompt,
  +                                              boolean[] echo) {
  +    	if (prompt.length != 1 || echo[0] != false || this.password == null) {
  +            return null;
  +    	}
  +    	String[] response=new String[1];
  +    	response[0]=this.password;
  +    	return response;
  +    }
   
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message