HomeFreeBSD

o There are two methods to get a process credentials over the unix
rS159575Unpublished

Unpublished Commit ยท Learn More

No further details are available.

Description

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

Details

Provenance
maximAuthored on
Parents
rS159574: Fix missing \n and when there are no arg's that means just print out
Branches
Unknown
Tags
Unknown

Event Timeline