Skip to content

Commit

Permalink
machine_core: Avoid long ssh control path
Browse files Browse the repository at this point in the history
When there is long hostname, the socket path can easily
exceed the 108 limit.

`%C`  creates a hash from host, port, and some more things.

Fixes #6806
  • Loading branch information
jscotka authored Aug 29, 2024
1 parent 39c9212 commit cf7be0b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion machine/machine_core/ssh_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def reboot(self, timeout_sec: int = 180) -> None:
def _start_ssh_master(self) -> None:
self._kill_ssh_master()

control = os.path.join(tempfile.gettempdir(), ".cockpit-test-resources", "ssh-%h-%p-%r-" + str(os.getpid()))
control = os.path.join(tempfile.gettempdir(), ".cockpit-test-resources", "ssh-%C-" + str(os.getpid()))
os.makedirs(os.path.dirname(control), exist_ok=True)

cmd = (
Expand Down

0 comments on commit cf7be0b

Please sign in to comment.