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

Add Socket::passcred/set_passcred for working with SO_PASSCRED. #506

Merged
merged 2 commits into from
Apr 18, 2024

Conversation

tobz
Copy link
Contributor

@tobz tobz commented Apr 15, 2024

This PR adds the ability to get and set the value of SO_PASSCRED on sockets.

Theoretically, FreeBSD does support the equivalent behavior, but does so via differently named constants/values, so I've opted to constrain this implementation to Linux only for now.

Copy link
Collaborator

@Thomasdezeeuw Thomasdezeeuw left a comment

Choose a reason for hiding this comment

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

Any chance you can add a smoke test to this?

@tobz
Copy link
Contributor Author

tobz commented Apr 16, 2024

When you say smoke test, what are you thinking? Like an integration test that only runs on Linux and actually sets the option on a Unix domain socket?

@tobz
Copy link
Contributor Author

tobz commented Apr 16, 2024

Just went ahead and added a test which hopefully fits your definition of "smoke test."

@tobz
Copy link
Contributor Author

tobz commented Apr 17, 2024

Woops, thought I added a test but I had committed to the wrong branch.

Should be all set now.

@tobz
Copy link
Contributor Author

tobz commented Apr 18, 2024

@Thomasdezeeuw Small bump.

Not in a rush, but I have the feeling this might have fallen off your radar after the approval. 😄

@Thomasdezeeuw
Copy link
Collaborator

Thomasdezeeuw commented Apr 18, 2024

Not in a rush, but I have the feeling this might have fallen off your radar after the approval. 😄

Hadn't fallen off my radar, but $dayjob got busy, then my open source work is the first on the chopping block I'm afraid.

Test looks good, for future reference we have a little test! macro to help with this:

test!(nodelay, set_nodelay(true));
. But merging as is.

Thanks @tobz!

@Thomasdezeeuw Thomasdezeeuw merged commit 6923954 into rust-lang:master Apr 18, 2024
41 checks passed
@tobz tobz deleted the tobz/add-set-passcred-support branch April 18, 2024 13:07
@tobz
Copy link
Contributor Author

tobz commented Apr 18, 2024

Doh! Sorry about the pushiness. Totally understand $dayjob cutting into open source time. 😓

Thanks again for approving/merging! Is there a general cadence you follow for cutting releases? I'm already using a Git ref at the moment, so I'm fine continuing to do so for a little while... but mostly curious. :)

@Thomasdezeeuw
Copy link
Collaborator

Doh! Sorry about the pushiness. Totally understand $dayjob cutting into open source time. 😓

👍

Thanks again for approving/merging! Is there a general cadence you follow for cutting releases? I'm already using a Git ref at the moment, so I'm fine continuing to do so for a little while... but mostly curious. :)

Not really, I mostly make releases on request. We don't see too many changes

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