bodewig 2003/10/16 04:21:14 Modified: docs/manual/OptionalTasks scp.html sshexec.html src/main/org/apache/tools/ant/taskdefs/optional/ssh SSHBase.java SSHUserInfo.java Log: Make .ssh/known_hosts optional Revision Changes Path 1.9 +4 -1 ant/docs/manual/OptionalTasks/scp.html Index: scp.html =================================================================== RCS file: /home/cvs/ant/docs/manual/OptionalTasks/scp.html,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- scp.html 23 Sep 2003 09:32:48 -0000 1.8 +++ scp.html 16 Oct 2003 11:21:14 -0000 1.9 @@ -53,7 +53,10 @@ </tr> <tr> <td valign="top">trust</td> - <td valign="top">This trusts all unknown hosts if set to yes/true.</td> + <td valign="top">This trusts all unknown hosts if set to yes/true.<br> + <strong>Note</strong> If you set this to false (the default), the + host you connect to must be listed in your knownhosts file, this + also implies that the file exists.</td> <td valian="top" align="center">No, defaults to No.</td> </tr> <tr> 1.7 +5 -1 ant/docs/manual/OptionalTasks/sshexec.html Index: sshexec.html =================================================================== RCS file: /home/cvs/ant/docs/manual/OptionalTasks/sshexec.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- sshexec.html 23 Sep 2003 09:32:48 -0000 1.6 +++ sshexec.html 16 Oct 2003 11:21:14 -0000 1.7 @@ -46,7 +46,11 @@ </tr> <tr> <td valign="top">trust</td> - <td valign="top">This trusts all unknown hosts if set to yes/true.</td> + + <td valign="top">This trusts all unknown hosts if set to yes/true.<br> + <strong>Note</strong> If you set this to false (the default), the + host you connect to must be listed in your knownhosts file, this + also implies that the file exists.</td> <td valian="top" align="center">No, defaults to No.</td> </tr> <tr> 1.6 +1 -3 ant/src/main/org/apache/tools/ant/taskdefs/optional/ssh/SSHBase.java Index: SSHBase.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/ssh/SSHBase.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- SSHBase.java 9 Jul 2003 12:12:59 -0000 1.5 +++ SSHBase.java 16 Oct 2003 11:21:14 -0000 1.6 @@ -77,7 +77,6 @@ private String host; private String keyfile; private String knownHosts; - private boolean trust = false; private int port = SSH_PORT; private boolean failOnError = true; private SSHUserInfo userInfo; @@ -185,7 +184,6 @@ public void init() throws BuildException { super.init(); this.knownHosts = System.getProperty("user.home") + "/.ssh/known_hosts"; - this.trust = false; this.port = SSH_PORT; } @@ -195,7 +193,7 @@ jsch.addIdentity(userInfo.getKeyfile()); } - if (knownHosts != null) { + if (!userInfo.getTrust() && knownHosts != null) { log("Using known hosts: " + knownHosts, Project.MSG_DEBUG); jsch.setKnownHosts(knownHosts); } 1.4 +8 -1 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.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- SSHUserInfo.java 9 Jul 2003 12:12:59 -0000 1.3 +++ SSHUserInfo.java 16 Oct 2003 11:21:14 -0000 1.4 @@ -70,7 +70,7 @@ public SSHUserInfo() { super(); - this.trustAllCertificates = true; + this.trustAllCertificates = false; } public SSHUserInfo(String password, boolean trustAllCertificates) { @@ -144,6 +144,13 @@ */ public void setTrust(boolean trust) { this.trustAllCertificates = trust; + } + + /** + * @return whether to trust or not. + */ + public boolean getTrust() { + return this.trustAllCertificates; } /**
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]