From 442f5f318a0e8465711c64b917e837849b8d4f4f Mon Sep 17 00:00:00 2001 From: wpaul Date: Fri, 21 Mar 1997 16:52:05 +0000 Subject: [PATCH] Document SCM_CREDS changes. --- lib/libc/sys/recv.2 | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/lib/libc/sys/recv.2 b/lib/libc/sys/recv.2 index 575102249f6..fdf02e32631 100644 --- a/lib/libc/sys/recv.2 +++ b/lib/libc/sys/recv.2 @@ -200,6 +200,34 @@ and set to .Dv SCM_RIGHTS . .Pp +Process credentials can also be passed as ancillary data for +.Dv AF_UNIX +domain sockets using a +.Fa cmsg_type +of +.Dv SCM_CREDS. +In this case, +.Fa cmsg_data +should be a structure of type +.Fa cmsgcred , +which is defined in +.Ao Pa sys/socket.h Ac +as follows: +.Pp +.Bd -literal +struct cmsgcred { + pid_t cmcred_pid; /* PID of sending process */ + uid_t cmcred_uid; /* real UID of sending process */ + uid_t cmcred_euid; /* effective UID of sending process */ + gid_t cmcred_gid; /* real GID of sending process */ + short cmcred_ngroups; /* number or groups */ + gid_t cmcred_groups[CMGROUP_MAX]; /* groups */ +}; +.Ed +.Pp +The kernel will fill in the credential information of the sending process +and deliver it to the receiver. +.Pp The .Fa msg_flags field is set on return according to the message received. -- 2.45.2