cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/optional/net RExecTask.java TelnetTask.java

2005-02-18 Thread bodewig
bodewig 2005/02/18 03:00:58

  Modified:.WHATSNEW
   src/main/org/apache/tools/ant/taskdefs/optional/net
RExecTask.java TelnetTask.java
  Log:
  Don't close SocketClients if connect has failed, PR 33618
  
  Revision  ChangesPath
  1.748 +4 -0  ant/WHATSNEW
  
  Index: WHATSNEW
  ===
  RCS file: /home/cvs/ant/WHATSNEW,v
  retrieving revision 1.747
  retrieving revision 1.748
  diff -u -r1.747 -r1.748
  --- WHATSNEW  14 Feb 2005 14:39:37 -  1.747
  +++ WHATSNEW  18 Feb 2005 11:00:57 -  1.748
  @@ -318,6 +318,10 @@
 exec, apply, or java tasks was always logged to System.out
 instead of to the managing Task.
   
  +* telnet and rexec would try to disconnect from servers they never
  +  connetced to, potentially leading to exceptions in commons-net.
  +  Bugzilla Report 33618.
  +
   Changes from Ant 1.6.1 to Ant 1.6.2
   ===
   
  
  
  
  1.10  +10 -10
ant/src/main/org/apache/tools/ant/taskdefs/optional/net/RExecTask.java
  
  Index: RExecTask.java
  ===
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/net/RExecTask.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- RExecTask.java22 Nov 2004 09:23:34 -  1.9
  +++ RExecTask.java18 Feb 2005 11:00:58 -  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.
  @@ -342,15 +342,15 @@
   /** Keep reading input stream until end of it or time-out */
   rexec.waitForEOF(defaultTimeout);
  } finally {
  -   if (rexec != null) {
  -   try {
  -   rexec.disconnect();
  -   } catch (IOException e) {
  -   throw new BuildException(Error disconnecting from 
  -+ server);
  -   }
  -   }
  -   }
  +if (rexec != null  rexec.isConnected()) {
  +try {
  +rexec.disconnect();
  +} catch (IOException e) {
  +throw new BuildException(Error disconnecting from 
  + + server);
  +}
  +}
  +}
   }
   /**
*  Process a 'typical' login.  If it differs, use the read
  
  
  
  1.30  +3 -3  
ant/src/main/org/apache/tools/ant/taskdefs/optional/net/TelnetTask.java
  
  Index: TelnetTask.java
  ===
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/net/TelnetTask.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- TelnetTask.java   22 Nov 2004 09:23:34 -  1.29
  +++ TelnetTask.java   18 Feb 2005 11:00:58 -  1.30
  @@ -1,5 +1,5 @@
   /*
  - * Copyright  2000,2002-2004 The Apache Software Foundation
  + * Copyright  2000,2002-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.
  @@ -114,7 +114,7 @@
  task.execute(telnet);
  }
  } finally {
  -   if (telnet != null) {
  +   if (telnet != null  telnet.isConnected()) {
  try {
  telnet.disconnect();
  } catch (IOException e) {
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/optional/net RExecTask.java TelnetTask.java

2005-02-18 Thread bodewig
bodewig 2005/02/18 03:04:28

  Modified:.Tag: ANT_16_BRANCH WHATSNEW
   src/main/org/apache/tools/ant/taskdefs/optional/net Tag:
ANT_16_BRANCH RExecTask.java TelnetTask.java
  Log:
  merge
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.503.2.177 +4 -0  ant/WHATSNEW
  
  Index: WHATSNEW
  ===
  RCS file: /home/cvs/ant/WHATSNEW,v
  retrieving revision 1.503.2.176
  retrieving revision 1.503.2.177
  diff -u -r1.503.2.176 -r1.503.2.177
  --- WHATSNEW  14 Feb 2005 22:05:31 -  1.503.2.176
  +++ WHATSNEW  18 Feb 2005 11:04:28 -  1.503.2.177
  @@ -200,6 +200,10 @@
 exec, apply, or java tasks was always logged to System.out
 instead of to the managing Task.
   
  +* telnet and rexec would try to disconnect from servers they never
  +  connetced to, potentially leading to exceptions in commons-net.
  +  Bugzilla Report 33618.
  +
   Changes from Ant 1.6.1 to Ant 1.6.2
   ===
   
  
  
  
  No   revision
  No   revision
  1.4.2.5   +10 -10
ant/src/main/org/apache/tools/ant/taskdefs/optional/net/RExecTask.java
  
  Index: RExecTask.java
  ===
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/net/RExecTask.java,v
  retrieving revision 1.4.2.4
  retrieving revision 1.4.2.5
  diff -u -r1.4.2.4 -r1.4.2.5
  --- RExecTask.java23 Jun 2004 12:32:03 -  1.4.2.4
  +++ RExecTask.java18 Feb 2005 11:04:28 -  1.4.2.5
  @@ -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.
  @@ -342,15 +342,15 @@
   /** Keep reading input stream until end of it or time-out */
   rexec.waitForEOF(defaultTimeout);
  } finally {
  -   if (rexec != null) {
  -   try {
  -   rexec.disconnect();
  -   } catch (IOException e) {
  -   throw new BuildException(Error disconnecting from  
  -+ server);
  -   }
  -   }
  -   }
  +if (rexec != null  rexec.isConnected()) {
  +try {
  +rexec.disconnect();
  +} catch (IOException e) {
  +throw new BuildException(Error disconnecting from 
  + + server);
  +}
  +}
  +}
   }
   /**
*  Process a 'typical' login.  If it differs, use the read
  
  
  
  1.20.2.7  +3 -3  
ant/src/main/org/apache/tools/ant/taskdefs/optional/net/TelnetTask.java
  
  Index: TelnetTask.java
  ===
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/net/TelnetTask.java,v
  retrieving revision 1.20.2.6
  retrieving revision 1.20.2.7
  diff -u -r1.20.2.6 -r1.20.2.7
  --- TelnetTask.java   23 Jun 2004 12:26:35 -  1.20.2.6
  +++ TelnetTask.java   18 Feb 2005 11:04:28 -  1.20.2.7
  @@ -1,5 +1,5 @@
   /*
  - * Copyright  2000,2002-2004 The Apache Software Foundation
  + * Copyright  2000,2002-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.
  @@ -114,7 +114,7 @@
  task.execute(telnet);
  }
  } finally {
  -   if (telnet != null) {
  +   if (telnet != null  telnet.isConnected()) {
  try {
  telnet.disconnect();
  } catch (IOException e) {
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/optional/net RExecTask.java TelnetTask.java

2003-05-13 Thread bodewig
bodewig 2003/05/13 07:37:04

  Modified:.WHATSNEW build.xml
   docs/manual install.html optionaltasklist.html
   src/main/org/apache/tools/ant/taskdefs defaults.properties
   src/main/org/apache/tools/ant/taskdefs/optional/net
TelnetTask.java
  Added:   docs/manual/OptionalTasks rexec.html
   src/main/org/apache/tools/ant/taskdefs/optional/net
RExecTask.java
  Log:
  Add rexec to accompany telnet and/or sshexec.
  
  PR: 19541
  Submitted by: François Rey francois dot rey at capco dot com
  
  Revision  ChangesPath
  1.416 +3 -0  ant/WHATSNEW
  
  Index: WHATSNEW
  ===
  RCS file: /home/cvs/ant/WHATSNEW,v
  retrieving revision 1.415
  retrieving revision 1.416
  diff -u -r1.415 -r1.416
  --- WHATSNEW  13 May 2003 07:22:02 -  1.415
  +++ WHATSNEW  13 May 2003 14:36:56 -  1.416
  @@ -316,6 +316,9 @@
   * rpm will detect the rpmbuild executable of RedHat 8.0 and newer
 and use that if it is on your PATH.  Bugzilla Report 14650.
   
  +* A new task rexec has been added that requires commons-net to work.
  +  Bugzilla Report 19541.
  +
   Changes from Ant 1.5.2 to Ant 1.5.3
   ===
   
  
  
  
  1.376 +1 -0  ant/build.xml
  
  Index: build.xml
  ===
  RCS file: /home/cvs/ant/build.xml,v
  retrieving revision 1.375
  retrieving revision 1.376
  diff -u -r1.375 -r1.376
  --- build.xml 6 May 2003 15:19:16 -   1.375
  +++ build.xml 13 May 2003 14:36:59 -  1.376
  @@ -234,6 +234,7 @@
 selector id=needs.commons.net
   or
 filename name=${optional.package}/net/FTP*/
  +  filename name=${optional.package}/net/RExec*/
 filename name=${optional.package}/net/TelnetTask*/
   /or
 /selector
  
  
  
  1.52  +1 -1  ant/docs/manual/install.html
  
  Index: install.html
  ===
  RCS file: /home/cvs/ant/docs/manual/install.html,v
  retrieving revision 1.51
  retrieving revision 1.52
  diff -u -r1.51 -r1.52
  --- install.html  23 Apr 2003 15:57:43 -  1.51
  +++ install.html  13 May 2003 14:37:00 -  1.52
  @@ -378,7 +378,7 @@
 /tr
 tr
   tdcommons-net.jar/td
  -tdftp and telnet tasks/td
  +tdftp, rexec and telnet tasks/td
   tda href=http://jakarta.apache.org/commons/net/index.html;
  
target=_tophttp://jakarta.apache.org/commons/net/index.html/a/td
 /tr
  
  
  
  1.38  +1 -0  ant/docs/manual/optionaltasklist.html
  
  Index: optionaltasklist.html
  ===
  RCS file: /home/cvs/ant/docs/manual/optionaltasklist.html,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- optionaltasklist.html 16 Apr 2003 12:44:44 -  1.37
  +++ optionaltasklist.html 13 May 2003 14:37:00 -  1.38
  @@ -53,6 +53,7 @@
   a href=OptionalTasks/pvcstask.htmlPvcs/abr
   a href=OptionalTasks/renameextensions.htmliRenameExtensions/i/abr
   a href=OptionalTasks/replaceregexp.htmlReplaceRegExp/abr
  +a href=OptionalTasks/rexec.htmlRExec/abr
   a href=OptionalTasks/rpm.htmlRpm/abr
   a href=OptionalTasks/serverdeploy.htmlServerDeploy/abr
   a href=OptionalTasks/setproxy.htmlSetproxy/abr
  
  
  
  1.1  ant/docs/manual/OptionalTasks/rexec.html
  
  Index: rexec.html
  ===
  html
  
  head
  meta http-equiv=Content-Language content=en-us
  titleRExec Task/title
  /head
  
  body
  
  h2a name=rexecRExec/a/h2
  h3Description/h3
  Task to automate a remote rexec session. Just like the Telnet task,
  it uses nested ttlt;readgt;/tt to indicate strings to wait for, and
  ttlt;writegt;/tt tags to specify text to send to the remote process.
  
  pbNote:/b This task depends on external libraries not included in the 
Ant distribution.
  See a href=../install.html#librarydependenciesLibrary Dependencies/a 
for more information./p
  
  h3Parameters/h3
  table border=1 cellpadding=2 cellspacing=0
tr
  thAttribute/th
  thValues/th
  thRequired/th
/tr
tr
   tduserid/td
   tdthe login id to use on the remote server./td
   tdYes/td
/tr
tr
   tdpassword/td
   tdthe login password to use on the remote server./td
   tdYes/td
/tr
tr
   tdserver/td
   tdthe address of the remote rexec server./td
   tdYes/td
/tr
tr
   tdcommand/td
   tdthe command to execute on the remote server./td
   tdYes/td
/tr
tr
   tdport/td
   tdthe port number of the remote rexec server. Defaults to port 512 in 
BSD Unix systems./td
   tdNo/td
/tr
tr
   tdtimeout/td
   tdset a default