Maxim Konovalov 70df31f4de 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
2006-06-13 14:33:35 +00:00
..
2006-03-23 08:48:37 +00:00
2006-01-27 23:06:08 +00:00
2005-12-23 21:32:40 +00:00
2006-03-03 22:36:52 +00:00
2005-12-04 02:12:43 +00:00
2006-05-19 06:37:24 +00:00
2006-05-28 22:15:28 +00:00
2005-03-14 06:51:29 +00:00
2006-03-23 08:48:37 +00:00