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

Added ucred (sockpeercred) for OpenBSD and Bitrig #941

Merged
merged 1 commit into from
Mar 7, 2018

Conversation

wictory
Copy link
Contributor

@wictory wictory commented Mar 7, 2018

OpenBSD and Bitrig has struct ucredimplemented 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.

@rust-highfive
Copy link

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.

@alexcrichton
Copy link
Member

@bors: r+

Thanks!

@bors
Copy link
Contributor

bors commented Mar 7, 2018

📌 Commit 2e38d9a has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented Mar 7, 2018

⌛ Testing commit 2e38d9a with merge 659de79...

bors added a commit that referenced this pull request Mar 7, 2018
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.
@bors
Copy link
Contributor

bors commented Mar 7, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: alexcrichton
Pushing 659de79 to master...

@bors bors merged commit 2e38d9a into rust-lang:master Mar 7, 2018
@wictory wictory deleted the ucred_openbsd branch March 7, 2018 19:54
@semarie
Copy link
Contributor

semarie commented Mar 8, 2018 via email

@wictory wictory restored the ucred_openbsd branch March 8, 2018 20:12
@wictory wictory deleted the ucred_openbsd branch March 8, 2018 20:13
@wictory
Copy link
Contributor Author

wictory commented Mar 8, 2018

I don't think you missed anything. I wanted the SO_PEERCRED functionality available in OpenBSD from rust. The pub type... thing is a hack to achieve direct compatibility with software written with Linux in mind because the interfaces seemed rather similar and the type alias would fix everything out of the box. However, I realize now that this is a mistake for multiple reasons. From my point of view the ucred type should be retracted.

bors added a commit that referenced this pull request Mar 8, 2018
Retract ucred type alias for sockpeercred from OpenBSD and Bitrig

Introduced in [this](#941) PR.
@alexcrichton
Copy link
Member

@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.

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.

5 participants