Commit graph

2 commits

Author SHA1 Message Date
vrubelroman
dc3d1b77fe fix(remote): make SSHClient safe to close concurrently; refcount shared clients
- sshConn/sftpCli are immutable after Connect; Close is serialized, only
  sets an atomic closed flag and closes the clients, so concurrent calls
  get errors instead of a data race or nil dereference (N-P0-8)
- Acquire/Release user counting: panes own the client from Connect,
  mirror and remote copy/delete jobs take a reference, and leaving a host
  (goParent at root, re-mirror, exit SSH mode) releases instead of closing
  a client another pane or job still uses (N-P1-12, partial)
- ports TestCloseRace; adds a mirror-then-leave UI regression test

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 23:14:53 +03:00
vrubelroman
8d6fe48536 fix(remote): never follow a symlink when deleting recursively (N-P0-3)
RemoveRecursive used Stat on the root, so deleting a remote symlink to a
directory walked into the target and deleted its contents. The root is
now examined with Lstat (links are removed with Remove), and Walk also
Lstats its root. Ports the analysts' TestRemoveRecursiveSymlinkToDir onto
the sshtest server.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 23:07:26 +03:00