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

Merged
merged 2 commits into from
Jan 12, 2025
Merged

Hugepages: use tee when writing with sudo #3595

merged 2 commits into from
Jan 12, 2025

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.

@mcgov mcgov marked this pull request as ready for review January 10, 2025 18:56
@LiliDeng LiliDeng merged commit f55683a into main Jan 12, 2025
45 checks passed
@LiliDeng LiliDeng deleted the mcgov/hugetee branch January 12, 2025 15:16
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.

2 participants