Skip to content

Commit c960e6a

Browse files
committed
pkg/hostagent: Remove ControlMaster related args from reversesshfs config on Windows
HostAgent's `sshConfig` already has some ControlMaster related args in `AdditionalArgs`, so it is necessary to remove them to avoid overrides above `Persist=false`. Signed-off-by: Norio Nomura <[email protected]>
1 parent cb6b4cd commit c960e6a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/hostagent/mount.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515

1616
"github.com/lima-vm/lima/v2/pkg/ioutilx"
1717
"github.com/lima-vm/lima/v2/pkg/limatype"
18+
"github.com/lima-vm/lima/v2/pkg/sshutil"
1819
)
1920

2021
type mount struct {
@@ -76,6 +77,10 @@ func (a *HostAgent) setupMount(ctx context.Context, m limatype.Mount) (*mount, e
7677
// 2. these errors still imply additional coms over mux socket, which resulted sftp-server to fail more often statistically during test runs.
7778
// It is reasonable to disable this on Windows if required feature is not fully operational.
7879
rsf.SSHConfig.Persist = false
80+
81+
// HostAgent's `sshConfig` already has some ControlMaster related args in `AdditionalArgs`,
82+
// so it is necessary to remove them to avoid overrides above `Persist=false`.
83+
rsf.SSHConfig.AdditionalArgs = sshutil.DisableControlMasterOptsFromSSHArgs(rsf.SSHConfig.AdditionalArgs)
7984
}
8085
if err := rsf.Prepare(); err != nil {
8186
return nil, fmt.Errorf("failed to prepare reverse sshfs for %q on %q: %w", resolvedLocation, *m.MountPoint, err)

0 commit comments

Comments
 (0)