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

RFE: isolate package builds to %builddir #2989

Open
pmatilai opened this issue Mar 22, 2024 · 0 comments
Open

RFE: isolate package builds to %builddir #2989

pmatilai opened this issue Mar 22, 2024 · 0 comments
Labels
packaging Package building, SPEC files, etc. RFE SECURITY

Comments

@pmatilai
Copy link
Member

pmatilai commented Mar 22, 2024

Specs have no business writing anywhere else than their designated %builddir. %_tmpdir too, but that belongs inside %builddir so it doesn't need special cleanup, just special setup.

This should be entirely doable with Linux namespaces. Of course we can't depend on those being available so it needs to be an optional feature - and other OS'es may have similar technologies they could utilize instead. An alternative means to achieve similar things is SELinux: run build scriptlets under a restrictive context that only has write capability to the suitably labeled %builddir.

And of course, tools like mock do this isolation already. But as long as rpmbuild is a standalone executable thing, some people will use it that way. If/when we have the means to prevent somebody's home getting nuked from an errant %clean or similar, we should do so.

This is mainly talking about build scriptlets, but what really should be isolated is the entire spec parse, because that stage can already write to the filesystem. Examples in the wild include things like %global gnupghome %(mktemp --directory).

@pmatilai pmatilai added RFE SECURITY packaging Package building, SPEC files, etc. labels Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packaging Package building, SPEC files, etc. RFE SECURITY
Projects
Status: Backlog
Development

No branches or pull requests

1 participant