-
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
Added ucred (sockpeercred) for OpenBSD and Bitrig #941
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
@bors: r+ Thanks! |
📌 Commit 2e38d9a has been approved by |
Added ucred (sockpeercred) for OpenBSD and Bitrig OpenBSD and Bitrig has `struct ucred`implemented in the way it is used in `getsockopt(2)` with `SOL_SOCKET` and `SO_PEERCRED`. However, it is called `struct sockpeercred`. Source: https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/sys/socket.h?rev=1.65&content-type=text/x-cvsweb-markup I added a type alias for `ucred` to enable Linux compatibility, but I'm not sure this is the correct way to do it.
☀️ Test successful - status-appveyor, status-travis |
if I have no problem with `struct sockpeercred` addition, I don't
understand the type alias with `ucred` name.
it is confusing as this struct name already exists in OpenBSD but for
something else:
https://github.com/openbsd/src/blob/master/sys/sys/ucred.h#L43
I found accepting such alias is really bad: it makes libc to behave as
compatibility layer (which it is not), and it makes the real `struct
ucred` unable to be used in libc if somebody needs it some day.
Did I miss something ?
|
I don't think you missed anything. I wanted the |
Retract ucred type alias for sockpeercred from OpenBSD and Bitrig Introduced in [this](#941) PR.
@semarie without automatic validation we don't really have any way of knowing whether anything added for OpenBSD is correct, so I'm just r+'ing PRs. |
OpenBSD and Bitrig has
struct ucred
implemented in the way it is used ingetsockopt(2)
withSOL_SOCKET
andSO_PEERCRED
. However, it is calledstruct sockpeercred
.Source: https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/sys/socket.h?rev=1.65&content-type=text/x-cvsweb-markup
I added a type alias for
ucred
to enable Linux compatibility, but I'm not sure this is the correct way to do it.