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

Do not set attributes when spawning the getter child #16791

Merged
merged 3 commits into from
Apr 5, 2023

Conversation

the-nando
Copy link
Contributor

@the-nando the-nando commented Apr 5, 2023

95359b8 disabled running the artifact downloader on Linux as the user nobody but left behind the code to set UID / GID, which are currently set as the same ones the user Nomad runs under. The current implementation however doesn't work, as described in #16789.

This PR removes setting attributes altogether as they are technically non required and they'll be inherited from the parent.

Fixes #16789

@hashicorp-cla
Copy link

hashicorp-cla commented Apr 5, 2023

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@shoenig shoenig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @the-nando!

I believe we can eliminate the credentials() helpers altogether now as well since they aren't being used in any case. Do you mind cleaning those up as well?

And can you run make cl to add a Changelog entry for this PR?

Thanks!

@the-nando
Copy link
Contributor Author

The credentials() helper is still referenced in

uid, gid := credentials()

Does it still make sense to test for directory ownership as the getter now can only run under the same user Nomad runs?
If not, I can remove the chown's assertions and cleanup the other files too.

@the-nando
Copy link
Contributor Author

@shoenig please have a look if it looks ok this way. Thanks!

Copy link
Member

@shoenig shoenig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@shoenig shoenig added the backport/1.5.x backport to 1.5.x release line label Apr 5, 2023
@shoenig shoenig added this to the 1.5.x milestone Apr 5, 2023
@shoenig shoenig merged commit 385e3ba into hashicorp:main Apr 5, 2023
@the-nando the-nando deleted the GH_16789 branch April 5, 2023 17:25
shoenig pushed a commit that referenced this pull request Apr 10, 2023
* Do not set attributes when spawning the getter child

* Cleanup

* Cleanup

---------

Co-authored-by: the-nando <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/1.5.x backport to 1.5.x release line
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Artifact getter breaks when Nomad is run as non-root
3 participants