-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Feat(Apple): Add the LOCAL_PEERTOKEN socket option #3929
Conversation
Taken from `sys/un.h`. Signed-off-by: Paul Mabileau <[email protected]>
Signed-off-by: Paul Mabileau <[email protected]>
Signed-off-by: Paul Mabileau <[email protected]>
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @tgross35 (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
@rustbot label stable-nominated seems appropriate? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Cool, thanks! Should I open a PR for the backport to 0.2 myself or will it be done soon anyway? |
Before doing a release I go through and cherry pick the backports, nothing for you to do :) |
* Feat(apple): Add LOCAL_PEERTOKEN Taken from `sys/un.h`. Signed-off-by: Paul Mabileau <[email protected]> * Docs(apple): Add description for LOCAL_PEER* socket options Signed-off-by: Paul Mabileau <[email protected]> * Chore(test/apple): Add the LOCAL_PEERTOKEN symbol Signed-off-by: Paul Mabileau <[email protected]> --------- Signed-off-by: Paul Mabileau <[email protected]> (backport <rust-lang#3929>) (cherry picked from commit 0a25ed8)
Dear maintainers,
This proposes to add the Darwin-only
LOCAL_PEERTOKEN
constant as a new API. It is agetsockopt
option variant that enables retrieving the connected peer's audit token, which enables uniquely identifying the process with respect to the underlying system. It is taken from XNU'ssys/un.h
header.Regarding a justification of a use case, this would be for reliably authenticating a peer process that attempts to communicate with the current one after connecting to one of its opened sockets. However, due to it being a simple constant, this is not strictly-speaking necessary. This should therefore be seen as more of an upstreaming and contributing to complete the already-existing APIs as all the other
LOCAL_PEER*
constants are already included.One thing this also does in addition is to add the small descriptions from the header as documentation comments in the Rust module, since I could see it was done from time to time, although not always. It is also done for the other similar constants, for completion's sake. If needed, this can be restricted to only
LOCAL_PEERTOKEN
or even removed entirely.Cheers,
Paul.