Skip to content

x/sys/unix: UnixCredentials etc. missing on FreeBSD #51711

@guelfey

Description

@guelfey

On Linux, the definitions to pass Unix credentials over sockets via SCM_CREDENTIALS like Ucred are exposed and there are helper functions like UnixCredentials to convert between raw and structured representations. FreeBSD has a similar capability via SCM_CREDS (see its unix manpage), which is not part of x/sys right now. This is not POSIX-standardized as far as I can tell.

At the minimum, we could include struct cmsgcred as part of the Go types (I'm happy to contribute here). Ideally we'd also add matching FreeBSD-implementations for UnixCredentials and ParseUnixCredentials, though signature and semantics would be slightly different (on FreeBSD, it's recommended to pass a zeroed buffer since the kernel apparently fills the fields, while on Linux the sender can explicitly set the fields as long as it has appropriate privileges).

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions