Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Feb 2007 19:59:00 +0000 (GMT)
From:      Iain Hibbert <plunky@rya-online.net>
To:        Maksim Yevmenkin <maksim.yevmenkin@gmail.com>
Cc:        freebsd-bluetooth@freebsd.org
Subject:   Re: obexapp 1.4.5
Message-ID:  <1172174340.896345.1439.nullmailer@galant.ukfsn.org>
In-Reply-To: <bb4a86c70702220943m4761c2abh770a19602d793f14@mail.gmail.com>
References:  <45dd83a3.33a.2350.278725879@rya-online.net> <bb4a86c70702220943m4761c2abh770a19602d793f14@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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; ) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1172174340.896345.1439.nullmailer>