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

Add PID to UCred on remaining platforms #3102

Open
Darksonn opened this issue Nov 6, 2020 · 3 comments
Open

Add PID to UCred on remaining platforms #3102

Darksonn opened this issue Nov 6, 2020 · 3 comments
Labels
A-tokio Area: The main tokio crate C-feature-request Category: A feature request. E-help-wanted Call for participation: Help is requested to fix this issue. M-net Module: tokio/net

Comments

@Darksonn
Copy link
Contributor

Darksonn commented Nov 6, 2020

Implement pid on windows for UCred. See #3085 and #2633.

What other platforms are missing?

cc @de-vri-es, @Kloenk

@Darksonn Darksonn added A-tokio Area: The main tokio crate M-net Module: tokio/net C-feature-request Category: A feature request. labels Nov 6, 2020
@Kloenk
Copy link
Contributor

Kloenk commented Nov 6, 2020

IIRC I left open nearly all BSDs (only MacOS) and Solaris.

EDIT: Solaris got already implemented by somebody else

@Darksonn
Copy link
Contributor Author

Darksonn commented Nov 6, 2020

The currently supported platforms are listed here:

/// Gets PID (process ID) of the process.
///
/// This is only implemented under Linux, Android, iOS, macOS, Solaris and
/// Illumos. On other plaforms this will always return `None`.

@de-vri-es
Copy link
Contributor

de-vri-es commented Nov 7, 2020

Windows doesn't have UCred at all right? Makes sense since Windows doesn't have Unix sockets. Although maybe there's something similar for pipes on Windows? I'm really not familiar with Windows.

OpenBSD and NetBSD do support PID though.

NetBSD supports it with the LOCAL_PEEREID socket option:
https://man.netbsd.org/NetBSD-9.0/unix.4

OpenBSD supports it with the SO_PEERCRED socket option:
https://man.openbsd.org/getsockopt.2

FreeBSD doesn't support it as far as I can tell. The struct returned with the LOCAL_PEERCRED option doesn't include a PID:
https://www.freebsd.org/cgi/man.cgi?query=unix&apropos=0&sektion=0&manpath=FreeBSD+12.2-RELEASE+and+Ports&arch=default&format=html

DragonFly BSD also doesn't seem to support it. They seem to have the same system as FreeBSD:
https://leaf.dragonflybsd.org/cgi/web-man?command=unix&section=ANY

@Darksonn Darksonn changed the title Add PID to UCred in windows Add PID to UCred on remaining platforms Nov 8, 2020
@carllerche carllerche added the E-help-wanted Call for participation: Help is requested to fix this issue. label Nov 12, 2020
devnexen added a commit to devnexen/tokio that referenced this issue Jul 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate C-feature-request Category: A feature request. E-help-wanted Call for participation: Help is requested to fix this issue. M-net Module: tokio/net
Projects
None yet
Development

No branches or pull requests

4 participants