fix: commands on SSH hosts run under sh -c, so hosts whose login shell is csh or tcsh list, zip and send files too

This commit is contained in:
redtea committed 2026-10-16 10:02:10 +03:00
1 parent 458d826de6
commit 6d8f39f2a5
3 files changed
+29 -6

No files matched your search

+4 -4
View File
@@ -246,7 +246,7 @@ func (a *Agent) sshfsRun(c *sshfsConn, cmd string, stdin io.Reader) ([]byte, err
if stdin != nil {
s.Stdin = stdin
}
if err := s.Run(cmd); err != nil {
if err := s.Run(posix(cmd)); err != nil {
msg := strings.TrimSpace(errb.String())
if msg == "" {
msg = err.Error()
@@ -535,7 +535,7 @@ func (a *Agent) doSSHFSSend(ctx context.Context, env proto.TaskEnvelope) proto.T
}
defer s.Close()
out, _ := s.StdoutPipe()
if err := s.Start("cat -- " + shq(args.Path)); err != nil {
if err := s.Start(posix("cat -- " + shq(args.Path))); err != nil {
return proto.TaskResult{Error: err.Error()}
}
// Read in order from cat, posted to the server a few at a time.
@@ -612,7 +612,7 @@ func (a *Agent) doSSHFSPut(ctx context.Context, env proto.TaskEnvelope) proto.Ta
in, _ := s.StdinPipe()
var errb bytes.Buffer
s.Stderr = &limitBuf{b: &errb, max: 4096}
if err := s.Start(writeCommand(args.Path)); err != nil {
if err := s.Start(posix(writeCommand(args.Path))); err != nil {
return proto.TaskResult{Error: err.Error()}
}
// Pieces come in a few ahead; stdin takes them in order. ack: how many
@@ -711,7 +711,7 @@ func (a *Agent) packRemote(ctx context.Context, w io.Writer, c *sshfsConn, srcs,
rename[b] = names[i]
cmd += " " + shq(b)
}
if err := s.Start(cmd); err != nil {
if err := s.Start(posix(cmd)); err != nil {
return err
}
if err := renameTar(w, &countReader{r: out, n: &m.done}, rename); err != nil {