Skip to content

Peer credentials on Unix socket #42839

Open
@Kixunil

Description

@Kixunil
Contributor

tokio-rs/tokio-uds#13 was recently merged, so I'd like to open an issue of adding same thing to stdlib. TL;DR It allows one to get effective UID and GID of the process which created the remote socket.

I suggest to test it with Tokio now and when there is consensus, we can merge similar change. I need this function, so I'm going to test it anyway.

Activity

added
T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.
on Jun 22, 2017
Kixunil

Kixunil commented on Jul 11, 2017

@Kixunil
ContributorAuthor

Considering that newtypes for pid_t, uid_t and gid_t landed in nix, we shoul consider using same newtypes in std and then simply reexport them in nix.

sfackler

sfackler commented on Jul 11, 2017

@sfackler
Member

This seems like a reasonable addition. It looks like there are some extra platforms that require special handling though - Solaris and FreeBSD: https://doxygen.postgresql.org/getpeereid_8c_source.html

Kixunil

Kixunil commented on Jul 11, 2017

@Kixunil
ContributorAuthor

The implementation in tokio handles Linux and FreeBSD (incl. macOS). I doesn't handle Solaris because I don't have Solaris machine.

added
C-feature-acceptedCategory: A feature request that has been accepted pending implementation.
and removed
C-feature-requestCategory: A feature request, i.e: not implemented / a PR.
on Nov 19, 2017
dtolnay

dtolnay commented on Nov 19, 2017

@dtolnay
Member

This isn't my area of expertise but I would be interested to see an API proposed for this in a PR.

joechrisellis

joechrisellis commented on Jul 28, 2020

@joechrisellis
Contributor

Hi guys. We're quite keen for something like this in the stdlib. The implementation in the Tokio repository looks good to me, and from a cursory glance it looks like the stdlib can be very similar. I'm happy to give this a crack -- should I submit an RFC first or is a normal code pull request OK? 😄

Cheers! 🙂

hug-dev

hug-dev commented on Aug 28, 2020

@hug-dev
Contributor

The PR which implements this issue is ready for review 🚀
#75148

Kixunil

Kixunil commented on Sep 16, 2020

@Kixunil
ContributorAuthor

Since the PR was merged should the labels (and perhaps also the title) be updated to tracking issue?

hug-dev

hug-dev commented on Sep 16, 2020

@hug-dev
Contributor

I would agree with that!
I guess the steps to follow for stabilization are here?

26 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @andrewbaxter@Kixunil@sfackler@emc2@jonas-schievink

        Issue actions

          Peer credentials on Unix socket · Issue #42839 · rust-lang/rust