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

fix: fail if the user is root #749

Merged
merged 1 commit into from
Aug 1, 2022
Merged

fix: fail if the user is root #749

merged 1 commit into from
Aug 1, 2022

Conversation

f0rmiga
Copy link
Collaborator

@f0rmiga f0rmiga commented Jul 12, 2022

We have seen folks excluding the .pyc files due to cache misses. See:

This PR adds a check under Linux and macOS that fails if running as root. For those who want to still ignore it, I added a new attribute.

@f0rmiga f0rmiga mentioned this pull request Jul 12, 2022
12 tasks
@f0rmiga f0rmiga requested review from hrfuller and removed request for brandjon and lberki July 12, 2022 20:25
if uid == 0:
fail("The current user is root, please run as non-root when using the hermetic Python interpreter. See https://github.com/bazelbuild/rules_python/pull/713.")
else:
fail("The current user has CAP_DAC_OVERRIDE set, please drop this capability when using the hermetic Python interpreter. See https://github.com/bazelbuild/rules_python/pull/713.")
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps a comment with https://man7.org/linux/man-pages/man7/capabilities.7.html for developers would be helpful.

Also, add a new attribute for the brave to ignore the check.

Signed-off-by: Thulio Ferraz Assis <3149049+f0rmiga@users.noreply.github.com>
@groodt groodt merged commit e67e7dd into main Aug 1, 2022
@groodt groodt deleted the f0rmiga/check-root-user branch August 1, 2022 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants