cvs commit: src/sys/kern uipc_usrreq.c

Maxim Konovalov maxim at FreeBSD.org
Tue Jun 13 14:35:56 UTC 2006


maxim       2006-06-13 14:33:35 UTC

  FreeBSD src repository

  Modified files:
    sys/kern             uipc_usrreq.c 
  Log:
  o There are two methods to get a process credentials over the unix
  sockets:
  
  1) A sender sends SCM_CREDS message to a reciever, struct cmsgcred;
  2) A reciever sets LOCAL_CREDS socket option and gets sender
  credentials in control message, struct sockcred.
  
  Both methods use the same control message type SCM_CREDS with the
  same control message level SOL_SOCKET, so they are indistinguishable
  for the receiver.  A difference in struct cmsgcred and struct sockcred
  layouts may lead to unwanted effects.
  
  Now for sockets with LOCAL_CREDS option remove all previous linked
  SCM_CREDS control messages and then add a control message with
  struct sockcred so the process specifically asked for the peer
  credentials by LOCAL_CREDS option always gets struct sockcred.
  
  PR:             kern/90800
  Submitted by:   Andrey Simonenko
  Regres. tests:  tools/regression/sockets/unix_cmsg/
  MFC after:      1 month
  
  Revision  Changes    Path
  1.168     +24 -10    src/sys/kern/uipc_usrreq.c


More information about the cvs-src mailing list