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

Fix non-root build and signing for rpm packages #47545

Merged
merged 4 commits into from May 17, 2018

Conversation

Projects
None yet
3 participants
@dmurphy18
Contributor

dmurphy18 commented May 8, 2018

What does this PR do?

Restores the ability to build and sign packages for rpm builds as a non-root user
This ability was changed in the Nitrogen release.

What issues does this PR fix or reference?

saltstack/salt-pack#545

Previous Behavior

Could only perform builds and signing for rpm packages as root since 2017.7.0

New Behavior

Restores ability to perform builds and signing for rpm packages as non-root user, for example: builder, with Salt minions as prior to the 2017.7.0 release.

Tests written?

No, built and signed Centos 7 packages.

Commits signed with GPG?

No

Please review Salt's Contributing Guide for best practices.

See GitHub's page on GPG signing for more information about signing commits with GPG.

@dmurphy18 dmurphy18 force-pushed the dmurphy18:fix_nonroot_build branch 2 times, most recently from 9bd6292 to 45fa27a May 8, 2018

@rallytime rallytime requested a review from terminalmage May 9, 2018

@dmurphy18 dmurphy18 force-pushed the dmurphy18:fix_nonroot_build branch from 45fa27a to a36de5c May 9, 2018

@rallytime

This comment has been minimized.

Contributor

rallytime commented May 15, 2018

re-run py2

@terminalmage

One small problem here. Also, I thought we standardized on using user instead of runas everywhere else beside cmdmod.py.

srpms = os.path.join(tree_base, 'SRPMS')
ret = []
if not os.path.isdir(dest_dir):
os.makedirs(dest_dir)
__salt__['file.chown'](path=dest_dir, user=runas, group='mock')

This comment has been minimized.

@terminalmage

terminalmage May 16, 2018

Member

This appears to be chown'ing a directory that doesn't exist, since you have removed the os.makedirs(dest_dir)

This comment has been minimized.

@dmurphy18

dmurphy18 May 16, 2018

Contributor

Thanks for the catch, that looks like it should have been makedirs_perms, will fix

@dmurphy18 dmurphy18 force-pushed the dmurphy18:fix_nonroot_build branch from a36de5c to 220f887 May 16, 2018

@rallytime rallytime requested a review from terminalmage May 16, 2018

@dmurphy18

This comment has been minimized.

Contributor

dmurphy18 commented May 16, 2018

@terminalmage There is a change coming from a contributor see #47056, so minimizing merge (user vs runas) when that is delivered. Post merge can update both debbuild.py and rpmbuild.py, as the contributor is also updating debbuild.py.

Also reluctant to change preexisting code for new naming scheme in minor release, fix up in develop after merge.

@terminalmage

Was not aware that runas was already used elsewhere in the module. That's fine, then. I just didn't want to be introducing new usage of runas if we were moving away from it.

@dmurphy18

This comment has been minimized.

Contributor

dmurphy18 commented May 17, 2018

re-run py2

@rallytime rallytime merged commit dbf12f9 into saltstack:2018.3 May 17, 2018

4 of 9 checks passed

jenkins/PR/salt-pr-linode-cent7-py3 Pull Requests » Salt PR - Linode CentOS 7 - PY3 #4950 — ABORTED
Details
jenkins/PR/salt-pr-linode-ubuntu16-py3 Pull Requests » Salt PR - Linode Ubuntu16.04 - PY3 #9920 — ABORTED
Details
jenkins/PR/salt-pr-rs-cent7-n Pull Requests » Salt PR - RS CentOS 7 #19007 — ABORTED
Details
default Build finished.
Details
jenkins/PR/salt-pr-linode-ubuntu14-n Pull Requests » Salt PR - Linode Ubuntu14.04 #22884 — FAILURE
Details
WIP ready for review
Details
jenkins/PR/salt-pr-clone Pull Requests » Salt PR - Clone #25137 — SUCCESS
Details
jenkins/PR/salt-pr-docs-n Pull Requests » Salt PR - Docs #17237 — SUCCESS
Details
jenkins/PR/salt-pr-lint-n Pull Requests » Salt PR - Code Lint #21867 — SUCCESS
Details

@dmurphy18 dmurphy18 deleted the dmurphy18:fix_nonroot_build branch Aug 31, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment