'make install' should require the caller to invoke sudo, not attempt to do so itself. #36
Labels
No labels
Bug
BuildIssue
Claude-fixed
Enhancement
In Progress
Low priority
On Hold
Rejected
Security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
keyop-go/nfq_forwarder#36
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
We should remove use of 'sudo' inside the Makefile, as the caller may not be able to use sudo without passwords and the result will be counter-intuitive. Instead add some guard checks that we already have the correct privileges when privileged targets are called. We will also need to ensure the environment is sane, since 'sudo' can modify several env vars including
PATH.changed the description
Plan: both
check-build-requirementsandinstallcurrently self-invokesudo(confirmed via Danny that both are in scope, not justinstall).check-build-requirements: stop self-elevating viasudo apt-get/dnf/yum install libpam0g-dev- instead print the exact install command for the detected package manager and exit 1, leaving it to the caller to run it (with sudo or otherwise) and retry. Avoids a confusing non-interactive hang/failure for a caller without passwordless sudo, in the middle of an unrelatedmake build/test/lint.install: drop thebuildprerequisite and every internalsudoprefix. Add an explicit guard requiring EUID 0 ("try: sudo make install"), and a second guard requiringdist/nfq_forwarder/dist/iptablesto already exist ("run 'make build' first, as yourself"). This directly fixes the "sane environment" concern too: previouslysudo make installre-ranbuild(goreleaser, etc.) under sudo's own environment, which commonly resets PATH (secure_path) and HOME, breaking lookups for a per-user-installed toolchain. Splitting the privileged half (install(1)/setcap, both on any reasonable secure_path) away from the build step avoids needing any PATH-preservation workaround at all.mentioned in commit 16e08fb12a5fa24d0f3dae02a86e44c6e0ae68b0
mentioned in merge request !79
mentioned in commit
14f847bf81mentioned in commit
6c88be75e0mentioned in commit
ad5d4b4646Merged via !79 (merge commit
ad5d4b4). No release for this one either, as agreed - Makefile/dev-workflow only, nothing in the shipped binary changes.