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

mkdeps doesn't handle shell special characters #1100

Closed
yamt opened this issue May 22, 2020 · 0 comments · Fixed by #1183
Closed

mkdeps doesn't handle shell special characters #1100

yamt opened this issue May 22, 2020 · 0 comments · Fixed by #1183

Comments

@yamt
Copy link
Contributor

yamt commented May 22, 2020

mkdeps uses system() thus a shell to execute cc.
it doesn't work if you have something like

CFLAGS   += -DMBEDTLS_USER_CONFIG_FILE="<mbedtls/user_config.h>"

because the shell interprets "<" as a redirect.

to fix it, we should do either

  • make it shell-quote arguments
  • or, stop using system()

some platforms provide easy ways to do the former.
eg. https://netbsd.gw.com/cgi-bin/man-cgi?shquote++NetBSD-current
but unfortunately none of them seems available widely.

i guess the latter approach is more common.
eg. https://github.com/NetBSD/src/blob/4464250282160188d09bef1ac67ec944b9a8a828/usr.bin/mkdep/mkdep.c#L137-L154
but i might be a burden for windows. (i don't know)

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 a pull request may close this issue.

1 participant