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

feat(unistd): Add getpeereid(3) #1342

Merged
merged 1 commit into from Dec 22, 2020
Merged

Conversation

woodruffw
Copy link
Contributor

getpeereid(3) is not POSIX, but it's present on many BSD-derived Unices. It's also the standard mechanism on those OSes for retrieving socket peer credentials (compare getsockopt + SO_PEERCRED on Linux, which nix already supports).

Closes #1339.

@woodruffw
Copy link
Contributor Author

N.B. I added this to nix::unistd since it's exposed via unistd.h in libbsd, FreeBSD, and on macOS.

OpenBSD exposes it in socket.h, but it seems to be the only one to do so.

Copy link
Member

@asomers asomers left a comment

Choose a reason for hiding this comment

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

This looks pretty good so far. Don't forget to add a CHANGELOG entry.

src/unistd.rs Outdated Show resolved Hide resolved
src/unistd.rs Outdated Show resolved Hide resolved
@woodruffw
Copy link
Contributor Author

I noticed that my editor cleaned up some trailing whitespace in the files that I modified. Let me know if you want me to prune those changes from this PR.

@valpackett
Copy link
Contributor

You should also add target_os = "dragonfly"

Copy link
Member

@asomers asomers left a comment

Choose a reason for hiding this comment

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

Could you please squash your commits before we merge this PR?

test/test_unistd.rs Show resolved Hide resolved
@woodruffw
Copy link
Contributor Author

woodruffw commented Nov 29, 2020 via email

@asomers
Copy link
Member

asomers commented Nov 29, 2020

This looks good now. The only thing it needs is to squash the commits and remove unrelated formatting changes.

@woodruffw
Copy link
Contributor Author

Okay, rebased. Let me know if there's anything else I can do.

Copy link
Member

@asomers asomers left a comment

Choose a reason for hiding this comment

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

bors r+

bors bot added a commit that referenced this pull request Nov 29, 2020
1342: feat(unistd): Add getpeereid(3) r=asomers a=woodruffw

`getpeereid(3)` is not POSIX, but it's present on many BSD-derived Unices. It's also the standard mechanism on those OSes for retrieving socket peer credentials (compare `getsockopt` + `SO_PEERCRED` on Linux, which `nix` already supports).

Closes #1339.

Co-authored-by: William Woodruff <william@yossarian.net>
@bors
Copy link
Contributor

bors bot commented Nov 29, 2020

This PR was included in a batch that successfully built, but then failed to merge into master (it was a non-fast-forward update). It will be automatically retried.

@bors
Copy link
Contributor

bors bot commented Nov 29, 2020

Merge conflict.

@woodruffw woodruffw force-pushed the ww/getpeereid branch 3 times, most recently from 354b3c6 to 000e671 Compare November 29, 2020 05:52
@woodruffw
Copy link
Contributor Author

Rebased again, and killed the whitespace changes.

@asomers
Copy link
Member

asomers commented Dec 2, 2020

bors r+

bors bot added a commit that referenced this pull request Dec 2, 2020
1342: feat(unistd): Add getpeereid(3) r=asomers a=woodruffw

`getpeereid(3)` is not POSIX, but it's present on many BSD-derived Unices. It's also the standard mechanism on those OSes for retrieving socket peer credentials (compare `getsockopt` + `SO_PEERCRED` on Linux, which `nix` already supports).

Closes #1339.

Co-authored-by: William Woodruff <william@yossarian.net>
@bors
Copy link
Contributor

bors bot commented Dec 2, 2020

Timed out.

@asomers
Copy link
Member

asomers commented Dec 2, 2020

bors retry

bors bot added a commit that referenced this pull request Dec 2, 2020
1342: feat(unistd): Add getpeereid(3) r=asomers a=woodruffw

`getpeereid(3)` is not POSIX, but it's present on many BSD-derived Unices. It's also the standard mechanism on those OSes for retrieving socket peer credentials (compare `getsockopt` + `SO_PEERCRED` on Linux, which `nix` already supports).

Closes #1339.

Co-authored-by: William Woodruff <william@yossarian.net>
@bors
Copy link
Contributor

bors bot commented Dec 2, 2020

Timed out.

@asomers
Copy link
Member

asomers commented Dec 2, 2020

This is Travis's fault. The current build has been waiting for more than 6 hours to start. I'll again late at night.

@woodruffw
Copy link
Contributor Author

This is Travis's fault. The current build has been waiting for more than 6 hours to start. I'll again late at night.

Got it, thanks. It sounds like they cut back quotas for OSS projects recently 😞

@asomers
Copy link
Member

asomers commented Dec 8, 2020

Try rebasing now.

@woodruffw
Copy link
Contributor Author

Okay, rebased. Let me know if there's anything else I can do.

@asomers
Copy link
Member

asomers commented Dec 15, 2020

Try rebasing again.

@woodruffw
Copy link
Contributor Author

Rebased!

CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Member

@asomers asomers left a comment

Choose a reason for hiding this comment

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

bors r+

bors bot added a commit that referenced this pull request Dec 16, 2020
1342: feat(unistd): Add getpeereid(3) r=asomers a=woodruffw

`getpeereid(3)` is not POSIX, but it's present on many BSD-derived Unices. It's also the standard mechanism on those OSes for retrieving socket peer credentials (compare `getsockopt` + `SO_PEERCRED` on Linux, which `nix` already supports).

Closes #1339.

Co-authored-by: William Woodruff <william@yossarian.net>
@woodruffw
Copy link
Contributor Author

Hmm, bors has been stuck for a few days now. Might need manual intervention?

@asomers
Copy link
Member

asomers commented Dec 19, 2020

It was a bug in our bors configuration, since fixed. You'll have to rebase again.

@woodruffw
Copy link
Contributor Author

Okay, rebased again. Also killed off some whitespace that I added to the CHANGELOG by mistake.

Copy link
Member

@asomers asomers left a comment

Choose a reason for hiding this comment

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

bors r+

@bors bors bot merged commit 8cff207 into nix-rust:master Dec 22, 2020
@woodruffw woodruffw deleted the ww/getpeereid branch December 22, 2020 17:46
@woodruffw
Copy link
Contributor Author

Thanks!

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.

Support for getpeereid(3)
3 participants