File tree Expand file tree Collapse file tree 2 files changed +6
-12
lines changed
Expand file tree Collapse file tree 2 files changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -895,18 +895,6 @@ export class SSHRuntime implements Runtime {
895895 return { success : false , error : `Failed to delete directory: ${ getErrorMessage ( error ) } ` } ;
896896 }
897897 }
898-
899- /**
900- * Cleanup SSH control socket on disposal.
901- *
902- * Note: This is a no-op because:
903- * - ControlPersist=60 automatically removes socket 60s after last use
904- * - Multiple SSHRuntime instances may share the same connection
905- * - Explicit cleanup could interfere with other active operations
906- */
907- dispose ( ) : void {
908- // No-op: Let ControlPersist handle cleanup automatically
909- }
910898}
911899
912900/**
Original file line number Diff line number Diff line change @@ -23,6 +23,10 @@ import type { SSHRuntimeConfig } from "./SSHRuntime";
2323 * Socket files are created by SSH and cleaned up automatically:
2424 * - ControlPersist=60: Removes socket 60s after last use
2525 * - OS: Cleans /tmp on reboot
26+ *
27+ * Includes local username in hash to prevent cross-user collisions on
28+ * multi-user systems (different users connecting to same remote would
29+ * otherwise generate same socket path, causing permission errors).
2630 */
2731export function getControlPath ( config : SSHRuntimeConfig ) : string {
2832 const key = makeConnectionKey ( config ) ;
@@ -33,9 +37,11 @@ export function getControlPath(config: SSHRuntimeConfig): string {
3337/**
3438 * Generate stable key from config.
3539 * Identical configs produce identical keys.
40+ * Includes local username to prevent cross-user socket collisions.
3641 */
3742function makeConnectionKey ( config : SSHRuntimeConfig ) : string {
3843 const parts = [
44+ os . userInfo ( ) . username , // Include local user to prevent cross-user collisions
3945 config . host ,
4046 config . port ?. toString ( ) ?? "22" ,
4147 config . srcBaseDir ,
You can’t perform that action at this time.
0 commit comments