From owner-freebsd-bluetooth@FreeBSD.ORG Wed Feb 21 22:34:54 2007 Return-Path: X-Original-To: freebsd-bluetooth@freebsd.org Delivered-To: freebsd-bluetooth@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1003E16A400 for ; Wed, 21 Feb 2007 22:34:54 +0000 (UTC) (envelope-from plunky@rya-online.net) Received: from smarthost01.eng.net (smarthost01.eng.net [213.130.146.173]) by mx1.freebsd.org (Postfix) with ESMTP id CB75B13C46B for ; Wed, 21 Feb 2007 22:34:53 +0000 (UTC) (envelope-from plunky@rya-online.net) Received: from netmail01.eng.net ([213.130.128.38] helo=rya-online.net) by smarthost01.eng.net with smtp (Exim 4.62) (envelope-from ) id 1HK02x-0005Ma-Rj; Wed, 21 Feb 2007 22:34:52 +0000 Received: (nullmailer pid 24855 invoked by uid 1000); Wed, 21 Feb 2007 22:23:48 -0000 Date: Wed, 21 Feb 2007 22:23:48 +0000 (GMT) To: Maksim Yevmenkin In-Reply-To: References: <1171997469.725737.13812.nullmailer@galant.ukfsn.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Message-Id: <1172096628.479674.24514.nullmailer@galant.ukfsn.org> From: Iain Hibbert Cc: freebsd-bluetooth@freebsd.org Subject: Re: obexapp 1.4.5 X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Feb 2007 22:34:54 -0000 On Wed, 21 Feb 2007, Maksim Yevmenkin wrote: > well, the sdp_session_open() is called before setgid()/setuid() so > sdpd will mark this session as "privileged". once sdp session is open, > obexapp can drop its privileges and still be able to register service > with sdpd. I think the problem with my implementation of this is that the SCM_CREDS information is sent alongside the first normal message, and because that are not sent until after the setuid(), the credentials have changed.. As I recall, for PEER_CREDS, sdpd actively queries the remote credentials when as the socket is open - (it seems that a slight race condition could exist there, or are the credentials passed the ones that were used to open the socket?) I will look into this a bit more, maybe if I arrange to send() an zero length message before changing the uid it may work, though I'm not sure how well sdpd will handle that.. iain