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; )
{
_______________________________________________
freebsd-bluetooth freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-blu
etooth
To unsubscribe, send any mail to
"freebsd-bluetooth-unsubscribe freebsd.org"
|