From owner-cvs-sys Fri Mar 21 08:12:42 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id IAA23742 for cvs-sys-outgoing; Fri, 21 Mar 1997 08:12:42 -0800 (PST) Received: (from wpaul@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id IAA23735; Fri, 21 Mar 1997 08:12:38 -0800 (PST) Date: Fri, 21 Mar 1997 08:12:38 -0800 (PST) From: Bill Paul Message-Id: <199703211612.IAA23735@freefall.freebsd.org> To: CVS-committers, cvs-all, cvs-sys Subject: cvs commit: src/sys/kern uipc_usrreq.c src/sys/sys socket.h Sender: owner-cvs-sys@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk wpaul 97/03/21 08:12:36 Modified: sys/sys socket.h sys/kern uipc_usrreq.c Log: Add support to sendmsg()/recvmsg() for passing credentials between processes using AF_LOCAL sockets. This hack is going to be used with Secure RPC to duplicate a feature of STREAMS which has no real counterpart in sockets (with STREAMS/TLI, you can apparently use t_getinfo() to learn UID of a local process on the other side of a transport endpoint). What happens is this: the client sets up a sendmsg() call with ancillary data using the SCM_CREDS socket-level control message type. It does not need to fill in the structure. When the kernel notices the data, unp_internalize() fills in the cmesgcred structure with the sending process' credentials (UID, EUID, GID, and ancillary groups). This data is later delivered to the receiving process. The receiver can then perform the follwing tests: - Did the client send ancillary data? o Yes, proceed. o No, refuse to authenticate the client. - The the client send data of type SCM_CREDS? o Yes, proceed. o No, refuse to authenticate the client. - Is the cmsgcred structure the right size? o Yes, proceed. o No, signal a possible error. The receiver can now inspect the credential information and use it to authenticate the client. Revision Changes Path 1.18 +25 -1 src/sys/sys/socket.h 1.21 +25 -3 src/sys/kern/uipc_usrreq.c