Skip to content

Commit 2911623

Browse files
committed
Reallow user@-arg... in prepare_invocation
Since the `user@` prefix makes it safe as gix-transport uses it, and there are test cases specifying that it should be permitted.
1 parent 4dda375 commit 2911623

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

gix-transport/src/client/blocking_io/ssh/program_kind.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ impl ProgramKind {
6565

6666
let host_maybe_with_user_as_ssh_arg = match (url.user_as_argument(), url.host_as_argument()) {
6767
(Usable(user), Usable(host)) => format!("{user}@{host}"),
68+
(Usable(user), Dangerous(host)) => format!("{user}@{host}"), // The `user@` makes it safe.
6869
(Absent, Usable(host)) => host.into(),
6970
(Dangerous(user), _) => Err(ssh::invocation::Error::AmbiguousUserName { user: user.into() })?,
7071
(_, Dangerous(host)) => Err(ssh::invocation::Error::AmbiguousHostName { host: host.into() })?,

0 commit comments

Comments
 (0)