Skip to content

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

Merged
merged 1 commit into from
Aug 7, 2017
Merged

GitHub rsync escaping #15589

merged 1 commit into from
Aug 7, 2017

Conversation

coreydaley
Copy link
Member

Correctly escapes oc rsync command arguments

@openshift-merge-robot openshift-merge-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Aug 1, 2017
@bparees bparees assigned jim-minter and unassigned fabianofranz Aug 1, 2017
@coreydaley coreydaley added the lgtm Indicates that a PR is ready to be merged. label Aug 1, 2017
@bparees
Copy link
Contributor

bparees commented Aug 1, 2017

(fyi corey was testing something for me, not trying to ram his own PRs through :) )

@bparees bparees removed the lgtm Indicates that a PR is ready to be merged. label Aug 1, 2017
@bparees
Copy link
Contributor

bparees commented Aug 1, 2017

/retest

@coreydaley coreydaley added approved Indicates a PR has been approved by an approver from all required OWNERS files. and removed approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Aug 1, 2017
@openshift-merge-robot openshift-merge-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 2, 2017
@coreydaley
Copy link
Member Author

@bparees @jim-minter added unit test

@bparees
Copy link
Contributor

bparees commented Aug 2, 2017

[lgtm removed because the bot is being weird]

will let @jim-minter have the last word though.

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 2, 2017
@openshift-merge-robot openshift-merge-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 2, 2017
@bparees bparees removed the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 2, 2017
@openshift-merge-robot openshift-merge-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 2, 2017
@bparees bparees removed approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. labels Aug 2, 2017
@stevekuznetsov
Copy link
Contributor

@bparees you may want to /lgtm cancel

@bparees
Copy link
Contributor

bparees commented Aug 2, 2017

@stevekuznetsov removing my comment and deleting the labels manually seems to have been sufficient to reign in the bot.

@openshift openshift deleted a comment from openshift-ci-robot Aug 2, 2017

// TestRsyncEscapeCommand ensures that command line options supplied to oc rsync
// are properly escaped.
func TestRsyncEscapeCommand(t *testing.T) {
Copy link
Contributor

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

// Example: " -> ""
func rsyncEscapeCommand(command []string) []string {
for key := range command {
needsQuoted := strings.ContainsAny(command[key], `'" \`)
Copy link
Contributor

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

// 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 {
Copy link
Contributor

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

@coreydaley
Copy link
Member Author

@jim-minter comments addressed

@coreydaley
Copy link
Member Author

coreydaley commented Aug 3, 2017

/retest

@stevekuznetsov
Copy link
Contributor

/test extended_conformance_install_update

2 similar comments
@stevekuznetsov
Copy link
Contributor

/test extended_conformance_install_update

@stevekuznetsov
Copy link
Contributor

/test extended_conformance_install_update

@coreydaley
Copy link
Member Author

@bparees @jim-minter ptal
comments have been addressed and tests are green

@0xmichalis
Copy link
Contributor

/test extended_templates

@jim-minter
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 4, 2017
@0xmichalis
Copy link
Contributor

/retest

@bparees
Copy link
Contributor

bparees commented Aug 4, 2017 via email

@openshift-merge-robot
Copy link
Contributor

[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 /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 4, 2017
@openshift-merge-robot
Copy link
Contributor

/test all [submit-queue is verifying that this PR is safe to merge]

@coreydaley
Copy link
Member Author

coreydaley commented Aug 5, 2017 via email

@openshift-merge-robot
Copy link
Contributor

/test all [submit-queue is verifying that this PR is safe to merge]

@coreydaley
Copy link
Member Author

coreydaley commented Aug 6, 2017 via email

@openshift-merge-robot
Copy link
Contributor

/test all [submit-queue is verifying that this PR is safe to merge]

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot
Copy link
Contributor

/test all [submit-queue is verifying that this PR is safe to merge]

@openshift-merge-robot
Copy link
Contributor

Automatic merge from submit-queue

@openshift-merge-robot openshift-merge-robot merged commit ef91f06 into openshift:master Aug 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants