From owner-cvs-src@FreeBSD.ORG Tue Jun 13 14:35:56 2006 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2C83416A474; Tue, 13 Jun 2006 14:35:56 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9F84B43D77; Tue, 13 Jun 2006 14:35:54 +0000 (GMT) (envelope-from maxim@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k5DEXZK3041254; Tue, 13 Jun 2006 14:33:35 GMT (envelope-from maxim@repoman.freebsd.org) Received: (from maxim@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k5DEXZTW041253; Tue, 13 Jun 2006 14:33:35 GMT (envelope-from maxim) Message-Id: <200606131433.k5DEXZTW041253@repoman.freebsd.org> From: Maxim Konovalov Date: Tue, 13 Jun 2006 14:33:35 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/sys/kern uipc_usrreq.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jun 2006 14:35:56 -0000 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