Re: [PATCH 4/4] ssh.exp: do not call rm in ssh_exec

Joseph Myers <[email protected]> Wed, 17 Jun 2026 22:16:41 +0000 (UTC)
Newsgroups gmane.comp.sysutils.dejagnu.general
Message-ID <[email protected]>
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
---1152306461-1086853076-1781734601=:856349
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8BIT

remote_exec is sometimes used with the name of an installed command
plus its arguments, which means the 'rm -f $program' breaks in
general.

---

On Tue, 2 Jun 2026, Jacob Bachmeyer wrote:

> Logically, this makes sense:  ssh_exec did not transfer $program to the
> remote, so it should not be performing cleanup like that. However, the
> trailing semicolon also should be removed, so that the string ends with ZYX.

This version also removes the trailing semicolon.

---
 lib/ssh.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/ssh.exp b/lib/ssh.exp
index b0f0696..0282bff 100644
--- a/lib/ssh.exp
+++ b/lib/ssh.exp
@@ -168,7 +168,7 @@ proc ssh_exec { boardname program pargs inp outp } {
 	set inp "/dev/null"
     }
 
-    set ret [local_exec "$SSH $ssh_useropts $ssh_user$hostname sh -c '$program $pargs 2>&1 ; echo XYZ\\\${?}ZYX \\; rm -f $program'" $inp $outp $timeout]
+    set ret [local_exec "$SSH $ssh_useropts $ssh_user$hostname sh -c '$program $pargs 2>&1 ; echo XYZ\\\${?}ZYX'" $inp $outp $timeout]
     set status [lindex $ret 0]
     set output [lindex $ret 1]
 
-- 
2.54.0

-- 
Joseph S. Myers
[email protected]

---1152306461-1086853076-1781734601=:856349--