From owner-freebsd-hackers@FreeBSD.ORG Mon May 26 19:49:18 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F071C1065672; Mon, 26 May 2008 19:49:18 +0000 (UTC) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by mx1.freebsd.org (Postfix) with ESMTP id BD6B28FC23; Mon, 26 May 2008 19:49:18 +0000 (UTC) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (localhost [127.0.0.1]) by apollo.backplane.com (8.14.1/8.14.1) with ESMTP id m4QJaS8Z074047; Mon, 26 May 2008 12:36:28 -0700 (PDT) Received: (from dillon@localhost) by apollo.backplane.com (8.14.1/8.13.4/Submit) id m4QJaS7Q074045; Mon, 26 May 2008 12:36:28 -0700 (PDT) Date: Mon, 26 May 2008 12:36:28 -0700 (PDT) From: Matthew Dillon Message-Id: <200805261936.m4QJaS7Q074045@apollo.backplane.com> To: Kris Kennaway References: <483B05DB.3000309@FreeBSD.org> Cc: freebsd-hackers@freebsd.org, Steven Hartland Subject: Re: Using sendmsg for SCM_CREDS results in EINVAL on PF_INET socket X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 May 2008 19:49:19 -0000 :> using the following code to send credentials to a remote host :> results in EINVAL from sendmsg. :> :> I suspect that SCM_CREDS is only valid for PF_LOCAL / PF_UNIX :> sockets and not PF_INET sockets and hence the code in dbus :> is actually invalid. :> :> Can anyone confirm this is the case or not? : :What would it even mean to send credentials to a remote host over an :AF_INET socket? : :Kris The only way to do it is to do a connect-back to a secure port. In otherwords, to use the identd protocol. Control messages like SCM_CREDS (and descriptor passing for that matter) only work over local protocol sockets. -Matt Matthew Dillon