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

docker_run_flags: Shellescape any provided values #869

Merged
merged 7 commits into from
Nov 8, 2022

Conversation

LukasAud
Copy link
Contributor

@LukasAud LukasAud commented Nov 7, 2022

Reverts #862

Original PR: #811
By: @neomilium

Ruby Shellwords#shellescape "Escapes a string so that it can be safely
used in a Bourne shell command line".  This is fine for a UNIX like
operating system, but windows does not complies with this.

Attempt to fix CI by manually "escaping" strings on windows (i.e. quote
them and escape quotes with a backslash), and relying on shellescape for
other operating systems.
At the cost of one more function call, we gain in readability and what
the docker::escape functions is more straightforward.
Escaped strings should not be quotted.

While here, also rework the way networks are escaped: the previous code
was generating invalid parameters.
@LukasAud LukasAud force-pushed the GH-811-reimplement_reverted_PR branch from de64963 to 3f09d92 Compare November 8, 2022 11:23
Copy link
Contributor

@GSPatton GSPatton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants