Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

better transport argument sanitization #1032

Merged
merged 3 commits into from
Sep 24, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
improve journey test to validate handling ambiguous of ssh-hosts
  • Loading branch information
Byron committed Sep 24, 2023
commit 114e91c5dbec1a1345fbb84a5625ab5c55abf8a5
17 changes: 17 additions & 0 deletions tests/journey/gix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,12 @@ title "gix commit-graph"
}
)
)
(with "an ambiguous ssh host which could be mistaken for an argument"
it "fails without trying to pass it to command-line programs" && {
WITH_SNAPSHOT="$snapshot/fail-ambigous-host" \
expect_run $WITH_FAILURE "$exe_plumbing" free pack receive 'ssh://-oProxyCommand=open$IFS-aCalculator/foo'
}
)
fi
)
elif [[ "$kind" = "small" ]]; then
Expand All @@ -355,6 +361,17 @@ title "gix commit-graph"
fi
)
)
if test "$kind" = "max" || test "$kind" = "max-pure"; then
(with "the 'clone' sub-command"
snapshot="$snapshot/clone"
(with "an ambiguous ssh host which could be mistaken for an argument"
it "fails without trying to pass it to command-line programs" && {
WITH_SNAPSHOT="$snapshot/fail-ambigous-host" \
expect_run $WITH_FAILURE "$exe_plumbing" clone 'ssh://-oProxyCommand=open$IFS-aCalculator/foo'
}
)
)
fi
(with "the 'index' sub-command"
snapshot="$snapshot/index"
title "gix free pack index create"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Error: Host name '-oProxyCommand=open$IFS-aCalculator' could be mistaken for a command-line argument
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Error: Host name '-oProxyCommand=open$IFS-aCalculator' could be mistaken for a command-line argument