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

@woodruffw woodruffw commented Nov 26, 2020

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

woodruffw commented Nov 26, 2020

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

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

woodruffw commented Nov 27, 2020

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.

@unrelentingtech
Copy link
Contributor

unrelentingtech commented Nov 27, 2020

You should also add target_os = "dragonfly"

Copy link
Member

@asomers asomers left a comment

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

@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

woodruffw commented Nov 29, 2020

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

Copy link
Member

@asomers asomers left a comment

bors r+

bors bot added a commit that referenced this issue 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 Nov 29, 2020
@woodruffw
Copy link
Contributor Author

woodruffw commented Nov 29, 2020

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 issue 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 issue 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

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

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

woodruffw commented Dec 8, 2020

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

woodruffw commented Dec 15, 2020

Rebased!

CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Member

@asomers asomers left a comment

bors r+

bors bot added a commit that referenced this issue 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

woodruffw commented Dec 19, 2020

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

woodruffw commented Dec 19, 2020

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

Copy link
Member

@asomers asomers left a comment

bors r+

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

woodruffw commented Dec 22, 2020

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.

3 participants