SSHOptsRemovingControlPath removes ControlMaster, ControlPath, and ControlPersist options from SSH options.
(opts []string)
| 380 | |
| 381 | // SSHOptsRemovingControlPath removes ControlMaster, ControlPath, and ControlPersist options from SSH options. |
| 382 | func SSHOptsRemovingControlPath(opts []string) []string { |
| 383 | // Create a copy of opts to avoid modifying the original slice, since slices.DeleteFunc modifies the slice in place. |
| 384 | copiedOpts := slices.Clone(opts) |
| 385 | return slices.DeleteFunc(copiedOpts, func(s string) bool { |
| 386 | return strings.HasPrefix(s, "ControlMaster") || strings.HasPrefix(s, "ControlPath") || strings.HasPrefix(s, "ControlPersist") |
| 387 | }) |
| 388 | } |
| 389 | |
| 390 | func ParseOpenSSHVersion(version []byte) *semver.Version { |
| 391 | regex := regexp.MustCompile(`(?m)^OpenSSH_(\d+\.\d+)(?:p(\d+))?\b`) |
no test coverage detected