-
-
Notifications
You must be signed in to change notification settings - Fork 148
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
selinux_build_module_simple.sh: improve quoting #375
Conversation
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.
That look more correct!
I guess the CI don't the case with spaces but maybe you have a real-case scenario you can check against this branch to ensure correctness?
LGTM!
Yeah, that's another problem with using a shell script like this, it would have to be tested in acceptance tests. I found more command lines where filenames should be quoted. Tomorrow I'll see if I can add an acceptance test that fails without this PR. |
Thinking about it, the "best" is probably to rely on shellquote to escape shell special chars. I can't really think that somebody able to inject malicious subcommands in a control-repo without validation has no prior root access to the system, but for the sake of best practice it may make sense to prevent such misuse. |
Hmmmm, the command line is actually already shellquoted: puppet-selinux/manifests/module.pp Line 83 in 37e1761
I used a |
If module_name or module_dir had a space, this script would fail. Also avoid existence test for the tmp dir and use mkdir -p instead.
If module_name or module_dir had a space, this script would fail.
Also avoid existence test for the tmp dir and use mkdir -p instead.