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

[BUG] rpm: shell scripts should have macros escaped #330

Open
1 task
cpuguy83 opened this issue Jul 18, 2024 · 3 comments
Open
1 task

[BUG] rpm: shell scripts should have macros escaped #330

cpuguy83 opened this issue Jul 18, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@cpuguy83
Copy link
Member

Expected Behavior

No response

Actual Behavior

Currently it may be possible to inject custom macros or access things that we aren't expecting and potentially break the build (even accidentally) based on if some value matches an rpmbuild macro.

Steps To Reproduce

As an example: in a build step inject a macro like:

%install
# insert extra stuff not in the yaml artifact spec

Are you willing to submit PRs to contribute to this bug fix?

  • Yes, I am willing to implement it.
@cpuguy83 cpuguy83 added the bug Something isn't working label Jul 18, 2024
@adamperlin
Copy link
Contributor

We should definitely try and escape macros, though I do worry about the difficulty of handling all edge cases here. As an additional part of this issue, I would propose more validation on build steps using a shell parser such as https:/mvdan/sh, at least for RPM targets

@cpuguy83
Copy link
Member Author

Was thinking about this yesterday.
We could probably just drop all the build scripts into a separate script file, include it as a Source in the rpm spec and execute that.

@cpuguy83
Copy link
Member Author

There's still potentially some other problems that would be easier to address in things like artifact lists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants