Commit 91b5f0a
Eric Bower
·
2026-02-24 20:46:40 -0500 EST
parent 1acc4d5
fix(pssh): strip quotes after splitting on them
2 files changed,
+2,
-2
+1,
-1
| ... | ... | @@ -537,7 +537,7 @@ func NewSSHServer(ctx context.Context, logger *slog.Logger, config *SSHServerCon | |
| 537 | 537 | splitter.SingleQuotes, | |
| 538 | 538 | ) | |
| 539 | 539 | command = payload.Value | |
| 540 | - | cmdSlice, _ := commaSplitter.Split(command) | |
| 540 | + | cmdSlice, _ := commaSplitter.Split(command, splitter.StripQuotes) | |
| 541 | 541 | sesh.SetValue("command", cmdSlice) | |
| 542 | 542 | } | |
| 543 | 543 |
+1,
-1
| ... | ... | @@ -329,7 +329,7 @@ func TestSSHServerCommandParsing(t *testing.T) { | |
| 329 | 329 | ||
| 330 | 330 | time.Sleep(100 * time.Millisecond) | |
| 331 | 331 | ||
| 332 | - | expectedCommand := []string{"accept", "--comment", "'here we go'", "101"} | |
| 332 | + | expectedCommand := []string{"accept", "--comment", "here we go", "101"} | |
| 333 | 333 | if !slices.Equal(expectedCommand, capturedCommand) { | |
| 334 | 334 | t.Error("command not exected", capturedCommand, len(capturedCommand), expectedCommand, len(expectedCommand)) | |
| 335 | 335 | } |