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 -k, --fwmark with setuid fping executable #342

Merged
merged 1 commit into from
Aug 17, 2024

Conversation

auerswal
Copy link
Collaborator

@auerswal auerswal commented Aug 4, 2024

  • Setting the SO_MARK socket option requires root privileges (or CAP_NET_ADMIN), thus temporarily elevate privileges for this operation, if possible, by using the p_setsockopt() function. This allows to use -k, --fwmark with setuid fping.
  • Adjust README.md since setuid now works for -k, --fwmark.
  • Remove "sudo" from testing -k since it is no longer needed.
  • Test failure of setting firewall mark without privileges or capabilities for both IPv4 and IPv6.

* Setting the SO_MARK socket option requires root privileges (or
  CAP_NET_ADMIN), thus temporarily elevate privileges for this
  operation, if possible, by using the p_setsockopt() function.
  This allows to use -k, --fwmark with setuid fping.
* Adjust README.md since setuid now works for -k, --fwmark.
* Remove "sudo" from testing -k since it is no longer needed.
* Test failure of setting firewall mark without privileges or
  capabilities for both IPv4 and IPv6.
@coveralls
Copy link

Coverage Status

coverage: 87.526% (+0.4%) from 87.085%
when pulling 0b9181c on auerswal:fwmark_priv_fix
into fc2fcb3 on schweikert:develop.

@gsnw-sebast
Copy link
Collaborator

That looks good

@auerswal
Copy link
Collaborator Author

Thanks for the review, I plan to merge this next weekend.

@auerswal auerswal merged commit 096a75f into schweikert:develop Aug 17, 2024
9 checks passed
@auerswal auerswal deleted the fwmark_priv_fix branch August 17, 2024 15:11
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