Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Mar 1997 08:12:38 -0800 (PST)
From:      Bill Paul <wpaul>
To:        CVS-committers, cvs-all, cvs-sys
Subject:   cvs commit:  src/sys/kern uipc_usrreq.c src/sys/sys socket.h
Message-ID:  <199703211612.IAA23735@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199703211612.IAA23735>