From owner-freebsd-bluetooth@FreeBSD.ORG Thu Feb 22 20:09:12 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 B2E8B16A401 for ; Thu, 22 Feb 2007 20:09:12 +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 5556113C46B for ; Thu, 22 Feb 2007 20:09:12 +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 1HKKFQ-0004HR-Mw; Thu, 22 Feb 2007 20:09:11 +0000 Received: (nullmailer pid 928 invoked by uid 1000); Thu, 22 Feb 2007 19:59:00 -0000 Date: Thu, 22 Feb 2007 19:59:00 +0000 (GMT) To: Maksim Yevmenkin In-Reply-To: References: <45dd83a3.33a.2350.278725879@rya-online.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Message-Id: <1172174340.896345.1439.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: Thu, 22 Feb 2007 20:09:12 -0000 On Thu, 22 Feb 2007, Maksim Yevmenkin wrote: > ah, i see. i was thinking exactly the same, except that i would like > to make authentication procedure between local sdp client and local > sdp server well defined and mandatory. Hmm, maybe with an AUTH Request/Response rather than credential check? I'm not sure if that would be a lot of work..? I had a thought before about adding an option to permit group access to the server (eg "-G staff"), and this would not seem so very difficult to implement (maybe even multiple groups..) > right now, sdpd simply uses getsockopt() to pull cached (inside > socket) peers credentials (i.e. no messages flow between the client > and the server) Yeah, thats a FreeBSD extension though and so far as I recall, I think there was some resistance to including it in NetBSD for whatever reason. I didn't get around to the zero length packets, but the following diff which moves the ServerRegister up before the setuid() calls does the job for NetBSD at least.. iain --- server.c.orig 2007-01-30 00:35:23.000000000 +0000 +++ server.c @@ -149,6 +149,19 @@ obexapp_server(obex_t *handle) strlcpy(context->root, pw->pw_dir, PATH_MAX); } + log_info("%s: Starting OBEX server", __func__); + + if (OBEX_SetTransportMTU(handle, context->mtu, context->mtu) < 0) { + log_err("%s(): OBEX_SetTransportMTU failed", __func__); + goto done; + } + + if (OBEX_ServerRegister(handle, (struct sockaddr *) &context->addr, + sizeof(context->addr)) < 0) { + log_err("%s(): OBEX_ServerRegister failed", __func__); + goto done; + } + if (getuid() == 0) { if (context->secure) { if (chroot(context->root) < 0) { @@ -184,19 +197,6 @@ obexapp_server(obex_t *handle) goto done; } - log_info("%s: Starting OBEX server", __func__); - - if (OBEX_SetTransportMTU(handle, context->mtu, context->mtu) < 0) { - log_err("%s(): OBEX_SetTransportMTU failed", __func__); - goto done; - } - - if (OBEX_ServerRegister(handle, (struct sockaddr *) &context->addr, - sizeof(context->addr)) < 0) { - log_err("%s(): OBEX_ServerRegister failed", __func__); - goto done; - } - log_debug("%s(): Entering event processing loop...", __func__); for (error = 0, context->done = 0; !context->done; ) {