Feat(Apple): Add the LOCAL_PEERTOKEN socket option#3929
Merged
tgross35 merged 3 commits intorust-lang:mainfrom Sep 30, 2024
PaulDance:macos-socket-token
Merged
Feat(Apple): Add the LOCAL_PEERTOKEN socket option#3929tgross35 merged 3 commits intorust-lang:mainfrom PaulDance:macos-socket-token
tgross35 merged 3 commits intorust-lang:mainfrom
PaulDance:macos-socket-token
Conversation
Taken from `sys/un.h`. Signed-off-by: Paul Mabileau <paul.mabileau@harfanglab.fr>
Signed-off-by: Paul Mabileau <paul.mabileau@harfanglab.fr>
Signed-off-by: Paul Mabileau <paul.mabileau@harfanglab.fr>
Collaborator
|
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 (
|
Contributor
Author
|
@rustbot label stable-nominated seems appropriate? |
Contributor
Author
|
Cool, thanks! Should I open a PR for the backport to 0.2 myself or will it be done soon anyway? |
Contributor
|
Before doing a release I go through and cherry pick the backports, nothing for you to do :) |
Merged
tgross35
pushed a commit
to tgross35/rust-libc
that referenced
this pull request
Oct 15, 2024
* Feat(apple): Add LOCAL_PEERTOKEN Taken from `sys/un.h`. Signed-off-by: Paul Mabileau <paul.mabileau@harfanglab.fr> * Docs(apple): Add description for LOCAL_PEER* socket options Signed-off-by: Paul Mabileau <paul.mabileau@harfanglab.fr> * Chore(test/apple): Add the LOCAL_PEERTOKEN symbol Signed-off-by: Paul Mabileau <paul.mabileau@harfanglab.fr> --------- Signed-off-by: Paul Mabileau <paul.mabileau@harfanglab.fr> (backport <rust-lang#3929>) (cherry picked from commit 0a25ed8)
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Dear maintainers,
This proposes to add the Darwin-only
LOCAL_PEERTOKENconstant as a new API. It is agetsockoptoption 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.hheader.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_PEERTOKENor even removed entirely.Cheers,
Paul.