Skip to content

Properly escape paths to executables. Fixes #18632. #18673

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 3 commits into from
Nov 7, 2014
Merged

Properly escape paths to executables. Fixes #18632. #18673

merged 3 commits into from
Nov 7, 2014

Conversation

vharavy
Copy link
Contributor

@vharavy vharavy commented Nov 5, 2014

  1. Introduce putpathvar function that prints variable shell-quoted by using %q format specifier. This function is used within probe to save the result into config.tmp.
  2. Removes search-and-replace pattern that transforms \ into / as it messes up shell-quoted strings.

@rust-highfive
Copy link
Contributor

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @aturon (or someone else) soon.

@aturon
Copy link
Member

aturon commented Nov 5, 2014

cc @alexcrichton @brson

@brson
Copy link
Contributor

brson commented Nov 6, 2014

Thanks @vharavy! 🍰

@vharavy
Copy link
Contributor Author

vharavy commented Nov 6, 2014

You are welcome! But it seems there is a problem. Shell from busybox does not recognize %q format qualifier. I will try to find a more portable way to do it.

@vharavy
Copy link
Contributor Author

vharavy commented Nov 6, 2014

Okay. Instead of using %q with printf I put all paths in double quotes instead. make passes successfully on Windows 7 64-bit and Arch Linux. Also, I corrected the way the version of Pandoc is obtained to be compatible with how Pandoc reports its version on Windows.

@vharavy
Copy link
Contributor Author

vharavy commented Nov 7, 2014

I have updated configure script to prevent it from putting double quotes around empty variables as it messes up make's conditional:

ifeq ($(CFG_PANDOC),)
     ...

bors added a commit that referenced this pull request Nov 7, 2014
1. Introduce `putpathvar` function that prints variable shell-quoted by using `%q` format specifier. This function is used within `probe` to save the result into `config.tmp`.
2. Removes search-and-replace pattern that transforms `\` into `/` as it messes up shell-quoted strings.
@bors bors closed this Nov 7, 2014
@bors bors merged commit c7a0b9c into rust-lang:master Nov 7, 2014
@vharavy vharavy deleted the issue-18632 branch November 7, 2014 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants