-
Notifications
You must be signed in to change notification settings - Fork 4.7k
GitHub rsync escaping #15589
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
GitHub rsync escaping #15589
Conversation
(fyi corey was testing something for me, not trying to ram his own PRs through :) ) |
/retest |
@bparees @jim-minter added unit test |
[lgtm removed because the bot is being weird] will let @jim-minter have the last word though. |
@bparees you may want to /lgtm cancel |
@stevekuznetsov removing my comment and deleting the labels manually seems to have been sufficient to reign in the bot. |
|
||
// TestRsyncEscapeCommand ensures that command line options supplied to oc rsync | ||
// are properly escaped. | ||
func TestRsyncEscapeCommand(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: using raw strings (quote with `) will make this easier to validate
pkg/oc/cli/cmd/rsync/copyrsync.go
Outdated
// Example: " -> "" | ||
func rsyncEscapeCommand(command []string) []string { | ||
for key := range command { | ||
needsQuoted := strings.ContainsAny(command[key], `'" \`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't believe the backslash is necessary in this line
pkg/oc/cli/cmd/rsync/copyrsync.go
Outdated
// if it contains any of the following: single quote, double quote, backslash, or space | ||
// It also replaces every pre-existing double quote character in the element with a pair. | ||
// Example: " -> "" | ||
func rsyncEscapeCommand(command []string) []string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note that this function modifies its argument in place and returns it, which is a little unusual
@jim-minter comments addressed |
/retest |
/test extended_conformance_install_update |
2 similar comments
/test extended_conformance_install_update |
/test extended_conformance_install_update |
@bparees @jim-minter ptal |
/test extended_templates |
/lgtm |
/retest |
/approve
Ben Parees | OpenShift
…On Aug 4, 2017 3:19 PM, "OpenShift Merge Robot" ***@***.***> wrote:
[APPROVALNOTIFIER] This PR is *NOT APPROVED*
This pull-request has been approved by: *coreydaley
<#15589#>*, *jim-minter
<#15589 (comment)>*
We suggest the following additional approver: *bparees*
Assign the PR to them by writing /assign @bparees in a comment when ready.
The full list of commands accepted by this bot can be found here
<https://github.com/kubernetes/test-infra/blob/master/commands.md>.
Needs approval from an approver in each of these OWNERS Files:
- *pkg/cmd/OWNERS
<https://github.com/openshift/origin/blob/master/pkg/cmd/OWNERS>*
- *pkg/oc/OWNERS
<https://github.com/openshift/origin/blob/master/pkg/oc/OWNERS>*
You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#15589 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEvl3pk9fWw9zUSrUFvVL-s6EU8biCdgks5sU27DgaJpZM4Op4SD>
.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bparees, coreydaley, jim-minter The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
/test all [submit-queue is verifying that this PR is safe to merge] |
/test all [submit-queue is verifying that this PR is safe to merge] |
/test all [submit-queue is verifying that this PR is safe to merge] |
/retest Please review the full test history for this PR and help us cut down flakes. |
/test all [submit-queue is verifying that this PR is safe to merge] |
Automatic merge from submit-queue |
Correctly escapes oc rsync command arguments