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

Hugepages: use tee when writing with sudo #3595

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Hugepages: use tee when writing with sudo #3595

wants to merge 2 commits into from

Conversation

mcgov
Copy link
Collaborator

@mcgov mcgov commented Jan 8, 2025

Prefer
echo 'value' | sudo tee /possibly/priviledged/file <- uses pipe, sudo is explicitly applied to file write
over
sudo sh -c 'echo "value" ' > /possibly/priviledged/file <- uses redirect, sudo is applied to the echo only (or based on the whims of the shell)

This avoids occasional weird silent failures. This was present previously in the DPDK hugepages code but it must have been swapped back to echo during the hugepages refactor.

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.

1 participant