CVS commit: src/usr.sbin/sdpd

2019-02-03 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Feb  4 04:56:35 UTC 2019

Modified Files:
src/usr.sbin/sdpd: main.c

Log Message:
- convert 'done' to an unsigned, since it is used as one.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/sdpd/main.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/sdpd/main.c
diff -u src/usr.sbin/sdpd/main.c:1.9 src/usr.sbin/sdpd/main.c:1.10
--- src/usr.sbin/sdpd/main.c:1.9	Wed Aug 31 13:32:41 2011
+++ src/usr.sbin/sdpd/main.c	Mon Feb  4 04:56:35 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.9 2011/08/31 13:32:41 joerg Exp $	*/
+/*	$NetBSD: main.c,v 1.10 2019/02/04 04:56:35 mrg Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@ __COPYRIGHT("@(#) Copyright (c) 2009 The
   Copyright (c) 2006 Itronix, Inc.\
   Copyright (c) 2004 Maksim Yevmenkin m_evmen...@yahoo.com.\
   All rights reserved.");
-__RCSID("$NetBSD: main.c,v 1.9 2011/08/31 13:32:41 joerg Exp $");
+__RCSID("$NetBSD: main.c,v 1.10 2019/02/04 04:56:35 mrg Exp $");
 
 #include 
 #include 
@@ -53,7 +53,7 @@ static bool	drop_root	(char const *user,
 static void	sighandler	(int s);
 __dead static void	usage		(void);
 
-static bool	done;
+static unsigned	done;
 
 /*
  * Bluetooth Service Discovery Procotol (SDP) daemon



CVS commit: src/usr.sbin/sdpd

2017-12-21 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Thu Dec 21 08:59:58 UTC 2017

Modified Files:
src/usr.sbin/sdpd: sdpd.8

Log Message:
fix width of list


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/sdpd/sdpd.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/sdpd/sdpd.8
diff -u src/usr.sbin/sdpd/sdpd.8:1.11 src/usr.sbin/sdpd/sdpd.8:1.12
--- src/usr.sbin/sdpd/sdpd.8:1.11	Tue Mar 18 18:20:47 2014
+++ src/usr.sbin/sdpd/sdpd.8	Thu Dec 21 08:59:58 2017
@@ -1,4 +1,4 @@
-.\" $NetBSD: sdpd.8,v 1.11 2014/03/18 18:20:47 riastradh Exp $
+.\" $NetBSD: sdpd.8,v 1.12 2017/12/21 08:59:58 plunky Exp $
 .\"
 .\" Copyright (c) 2009 The NetBSD Foundation, Inc.
 .\" Copyright (c) 2004 Maksim Yevmenkin 
@@ -69,7 +69,7 @@ using the
 option.
 .Pp
 The command line options are as follows:
-.Bl -tag -width indent
+.Bl -tag -width ".Fl g Ar group"
 .It Fl c Ar path
 Specify path to the control socket.
 The default path is



CVS commit: src/usr.sbin/sdpd

2015-11-24 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Tue Nov 24 21:11:39 UTC 2015

Modified Files:
src/usr.sbin/sdpd: db.c

Log Message:
newer versions of the Bluetooth Core specification state that
service record number values of 0x0001->0x are
reserved, so comply with that here.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/sdpd/db.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/sdpd/db.c
diff -u src/usr.sbin/sdpd/db.c:1.1 src/usr.sbin/sdpd/db.c:1.2
--- src/usr.sbin/sdpd/db.c:1.1	Tue May 12 10:05:06 2009
+++ src/usr.sbin/sdpd/db.c	Tue Nov 24 21:11:39 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: db.c,v 1.1 2009/05/12 10:05:06 plunky Exp $	*/
+/*	$NetBSD: db.c,v 1.2 2015/11/24 21:11:39 plunky Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: db.c,v 1.1 2009/05/12 10:05:06 plunky Exp $");
+__RCSID("$NetBSD: db.c,v 1.2 2015/11/24 21:11:39 plunky Exp $");
 
 #include 
 #include 
@@ -96,8 +96,8 @@ static uint8_t sds_data[] = {
 /* BrowseGroupDescriptor service record */
 static uint8_t bgd_data[] = {
 	0x09, 0x00, 0x00,	//  uint16	ServiceRecordHandle
-	0x0a, 0x00, 0x00, 0x00,	//  uint32	0x0001
-	0x01,
+	0x0a, 0x00, 0x01, 0x00,	//  uint32	0x0001
+	0x00,
 
 	0x09, 0x00, 0x01,	//  uint16	ServiceClassIDList
 	0x35, 0x03,		//  seq8(3)
@@ -130,11 +130,11 @@ db_init(server_t *srv)
 	sdp_data_t d;
 
 	LIST_INIT(&srv->rlist);
-	srv->handle = 0;
+	srv->handle = 0x0001; /* values 0x0001->0x are reserved */
 
 	d.next = sds_data;
 	d.end = sds_data + sizeof(sds_data);
-	if (!db_create(srv, -1, BDADDR_ANY, srv->handle++, &d))
+	if (!db_create(srv, -1, BDADDR_ANY, 0x, &d))
 		return false;
 
 	d.next = bgd_data;



CVS commit: src/usr.sbin/sdpd

2015-03-31 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Tue Mar 31 09:25:41 UTC 2015

Modified Files:
src/usr.sbin/sdpd: service.c

Log Message:
fix typo: sparce->sparse


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/sdpd/service.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/sdpd/service.c
diff -u src/usr.sbin/sdpd/service.c:1.2 src/usr.sbin/sdpd/service.c:1.3
--- src/usr.sbin/sdpd/service.c:1.2	Sun Mar  7 10:58:40 2010
+++ src/usr.sbin/sdpd/service.c	Tue Mar 31 09:25:41 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: service.c,v 1.2 2010/03/07 10:58:40 plunky Exp $	*/
+/*	$NetBSD: service.c,v 1.3 2015/03/31 09:25:41 plunky Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: service.c,v 1.2 2010/03/07 10:58:40 plunky Exp $");
+__RCSID("$NetBSD: service.c,v 1.3 2015/03/31 09:25:41 plunky Exp $");
 
 #include 
 #include 
@@ -234,7 +234,7 @@ service_attribute_request(server_t *srv,
 
 	/*
 	 * Match the selected record against AttributeIDList, writing
-	 * the data to the sparce buffer.
+	 * the data to the sparse buffer.
 	 */
 	r = NULL;
 	db_next(srv, fd, &r);



CVS commit: src/usr.sbin/sdpd

2012-03-01 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Mar  1 22:38:31 UTC 2012

Modified Files:
src/usr.sbin/sdpd: sdpd.h server.c

Log Message:
Fix format string. Make sure it doesn't reappear by using __printf_like
as appropiate.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/sdpd/sdpd.h
cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/sdpd/server.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/sdpd/sdpd.h
diff -u src/usr.sbin/sdpd/sdpd.h:1.1 src/usr.sbin/sdpd/sdpd.h:1.2
--- src/usr.sbin/sdpd/sdpd.h:1.1	Tue May 12 10:05:07 2009
+++ src/usr.sbin/sdpd/sdpd.h	Thu Mar  1 22:38:31 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdpd.h,v 1.1 2009/05/12 10:05:07 plunky Exp $	*/
+/*	$NetBSD: sdpd.h,v 1.2 2012/03/01 22:38:31 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -134,14 +134,14 @@ void	db_release(server_t *, int);
 /* log.c */
 void	log_open(char const *, bool);
 void	log_close(void);
-void	log_emerg(char const *, ...);
-void	log_alert(char const *, ...);
-void	log_crit(char const *, ...);
-void	log_err(char const *, ...);
-void	log_warning(char const *, ...);
-void	log_notice(char const *, ...);
-void	log_info(char const *, ...);
-void	log_debug(char const *, ...);
+void	log_emerg(char const *, ...) __printflike(1, 2);
+void	log_alert(char const *, ...) __printflike(1, 2);
+void	log_crit(char const *, ...) __printflike(1, 2);
+void	log_err(char const *, ...) __printflike(1, 2);
+void	log_warning(char const *, ...) __printflike(1, 2);
+void	log_notice(char const *, ...) __printflike(1, 2);
+void	log_info(char const *, ...) __printflike(1, 2);
+void	log_debug(char const *, ...) __printflike(1, 2);
 
 /* record.c */
 uint16_t record_insert_request(server_t *, int);

Index: src/usr.sbin/sdpd/server.c
diff -u src/usr.sbin/sdpd/server.c:1.10 src/usr.sbin/sdpd/server.c:1.11
--- src/usr.sbin/sdpd/server.c:1.10	Fri Jul  1 03:07:21 2011
+++ src/usr.sbin/sdpd/server.c	Thu Mar  1 22:38:31 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: server.c,v 1.10 2011/07/01 03:07:21 joerg Exp $	*/
+/*	$NetBSD: server.c,v 1.11 2012/03/01 22:38:31 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -58,7 +58,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: server.c,v 1.10 2011/07/01 03:07:21 joerg Exp $");
+__RCSID("$NetBSD: server.c,v 1.11 2012/03/01 22:38:31 joerg Exp $");
 
 #include 
 #include 
@@ -112,7 +112,7 @@ server_init(server_t *srv, char const *c
 	srv->ctllen = CMSG_SPACE(SOCKCREDSIZE(MAX_GROUPS));
 	srv->ctlbuf = malloc(srv->ctllen);
 	if (srv->ctlbuf == NULL) {
-		log_crit("Malloc cmsg buffer (len=%d) failed.", srv->ctllen);
+		log_crit("Malloc cmsg buffer (len=%zu) failed.", srv->ctllen);
 		goto fail;
 	}
 



CVS commit: src/usr.sbin/sdpd

2011-06-30 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri Jul  1 03:07:21 UTC 2011

Modified Files:
src/usr.sbin/sdpd: server.c

Log Message:
Fix memset usage.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/sdpd/server.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/sdpd/server.c
diff -u src/usr.sbin/sdpd/server.c:1.9 src/usr.sbin/sdpd/server.c:1.10
--- src/usr.sbin/sdpd/server.c:1.9	Mon Oct 18 20:43:23 2010
+++ src/usr.sbin/sdpd/server.c	Fri Jul  1 03:07:21 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: server.c,v 1.9 2010/10/18 20:43:23 plunky Exp $	*/
+/*	$NetBSD: server.c,v 1.10 2011/07/01 03:07:21 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -58,7 +58,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: server.c,v 1.9 2010/10/18 20:43:23 plunky Exp $");
+__RCSID("$NetBSD: server.c,v 1.10 2011/07/01 03:07:21 joerg Exp $");
 
 #include 
 #include 
@@ -98,7 +98,7 @@
 	assert(srv != NULL);
 	assert(control != NULL);
 
-	memset(srv, 0, sizeof(srv));
+	memset(srv, 0, sizeof(*srv));
 	FD_ZERO(&srv->fdset);
 	srv->sgroup = sgroup;
 



CVS commit: src/usr.sbin/sdpd

2011-06-25 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Sat Jun 25 09:28:45 UTC 2011

Modified Files:
src/usr.sbin/sdpd: main.c

Log Message:
use appropriate types for uid/gid


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/sdpd/main.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/sdpd/main.c
diff -u src/usr.sbin/sdpd/main.c:1.7 src/usr.sbin/sdpd/main.c:1.8
--- src/usr.sbin/sdpd/main.c:1.7	Sun Aug 30 19:24:40 2009
+++ src/usr.sbin/sdpd/main.c	Sat Jun 25 09:28:45 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.7 2009/08/30 19:24:40 plunky Exp $	*/
+/*	$NetBSD: main.c,v 1.8 2011/06/25 09:28:45 plunky Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
   Copyright (c) 2006 Itronix, Inc.\
   Copyright (c) 2004 Maksim Yevmenkin m_evmen...@yahoo.com.\
   All rights reserved.");
-__RCSID("$NetBSD: main.c,v 1.7 2009/08/30 19:24:40 plunky Exp $");
+__RCSID("$NetBSD: main.c,v 1.8 2011/06/25 09:28:45 plunky Exp $");
 
 #include 
 #include 
@@ -155,7 +155,8 @@
 static bool
 drop_root(char const *user, char const *group)
 {
-	int	 uid, gid;
+	gid_t	gid;
+	uid_t	uid;
 	char	*ep;
 
 	if ((uid = getuid()) != 0) {



CVS commit: src/usr.sbin/sdpd

2010-10-18 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Mon Oct 18 20:43:24 UTC 2010

Modified Files:
src/usr.sbin/sdpd: server.c

Log Message:
move debug output before the loop, which possibly changes the value of fd


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/sdpd/server.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/sdpd/server.c
diff -u src/usr.sbin/sdpd/server.c:1.8 src/usr.sbin/sdpd/server.c:1.9
--- src/usr.sbin/sdpd/server.c:1.8	Sun Mar  7 10:58:40 2010
+++ src/usr.sbin/sdpd/server.c	Mon Oct 18 20:43:23 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: server.c,v 1.8 2010/03/07 10:58:40 plunky Exp $	*/
+/*	$NetBSD: server.c,v 1.9 2010/10/18 20:43:23 plunky Exp $	*/
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -58,7 +58,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: server.c,v 1.8 2010/03/07 10:58:40 plunky Exp $");
+__RCSID("$NetBSD: server.c,v 1.9 2010/10/18 20:43:23 plunky Exp $");
 
 #include 
 #include 
@@ -564,14 +564,14 @@
 	FD_CLR(fd, &srv->fdset);
 	srv->fdidx[fd].valid = false;
 
+	log_debug("client on fd#%d closed", fd);
+
 	if (fd == srv->fdmax) {
 		while (fd > 0 && !srv->fdidx[fd].valid)
 			fd--;
 
 		srv->fdmax = fd;
 	}
-
-	log_debug("client on fd#%d closed", fd);
 }
 
 /*



CVS commit: src/usr.sbin/sdpd

2009-08-30 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Sun Aug 30 19:24:40 UTC 2009

Modified Files:
src/usr.sbin/sdpd: main.c

Log Message:
actually exit on errors


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/sdpd/main.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/sdpd/main.c
diff -u src/usr.sbin/sdpd/main.c:1.6 src/usr.sbin/sdpd/main.c:1.7
--- src/usr.sbin/sdpd/main.c:1.6	Thu Aug 13 17:50:41 2009
+++ src/usr.sbin/sdpd/main.c	Sun Aug 30 19:24:40 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.6 2009/08/13 17:50:41 drochner Exp $	*/
+/*	$NetBSD: main.c,v 1.7 2009/08/30 19:24:40 plunky Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
   Copyright (c) 2006 Itronix, Inc.\
   Copyright (c) 2004 Maksim Yevmenkin m_evmen...@yahoo.com.\
   All rights reserved.");
-__RCSID("$NetBSD: main.c,v 1.6 2009/08/13 17:50:41 drochner Exp $");
+__RCSID("$NetBSD: main.c,v 1.7 2009/08/30 19:24:40 plunky Exp $");
 
 #include 
 #include 
@@ -131,10 +131,10 @@
 	}
 
 	/* Initialize server */
-	if (server_init(&server, control, sgroup) < 0)
+	if (!server_init(&server, control, sgroup))
 		exit(EXIT_FAILURE);
 
-	if ((user != NULL || group != NULL) && drop_root(user, group) < 0)
+	if ((user != NULL || group != NULL) && !drop_root(user, group))
 		exit(EXIT_FAILURE);
 
 	for (done = 0; !done; ) {



CVS commit: src/usr.sbin/sdpd

2009-08-20 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Aug 20 15:59:57 UTC 2009

Modified Files:
src/usr.sbin/sdpd: sdpd.8

Log Message:
New sentence, new line.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/sdpd/sdpd.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/sdpd/sdpd.8
diff -u src/usr.sbin/sdpd/sdpd.8:1.7 src/usr.sbin/sdpd/sdpd.8:1.8
--- src/usr.sbin/sdpd/sdpd.8:1.7	Thu Aug 20 15:51:28 2009
+++ src/usr.sbin/sdpd/sdpd.8	Thu Aug 20 15:59:57 2009
@@ -1,4 +1,4 @@
-.\" $NetBSD: sdpd.8,v 1.7 2009/08/20 15:51:28 joerg Exp $
+.\" $NetBSD: sdpd.8,v 1.8 2009/08/20 15:59:57 wiz Exp $
 .\"
 .\" Copyright (c) 2009 The NetBSD Foundation, Inc.
 .\" Copyright (c) 2004 Maksim Yevmenkin 
@@ -49,7 +49,8 @@
 .Pp
 In order to discover services, remote Bluetooth devices send Service
 Search and Service Attribute or Service Search Attribute requests over
-Bluetooth L2CAP connections on the SDP PSM (0x0001).  The
+Bluetooth L2CAP connections on the SDP PSM (0x0001).
+The
 .Nm
 daemon will try to find matching Service Records in its Service Database
 and will return the requested record extracts for the remote device to



CVS commit: src/usr.sbin/sdpd

2009-08-20 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Aug 20 15:51:29 UTC 2009

Modified Files:
src/usr.sbin/sdpd: sdpd.8

Log Message:
Simplify.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/sdpd/sdpd.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/sdpd/sdpd.8
diff -u src/usr.sbin/sdpd/sdpd.8:1.6 src/usr.sbin/sdpd/sdpd.8:1.7
--- src/usr.sbin/sdpd/sdpd.8:1.6	Tue May 12 10:27:53 2009
+++ src/usr.sbin/sdpd/sdpd.8	Thu Aug 20 15:51:28 2009
@@ -1,4 +1,4 @@
-.\" $NetBSD: sdpd.8,v 1.6 2009/05/12 10:27:53 wiz Exp $
+.\" $NetBSD: sdpd.8,v 1.7 2009/08/20 15:51:28 joerg Exp $
 .\"
 .\" Copyright (c) 2009 The NetBSD Foundation, Inc.
 .\" Copyright (c) 2004 Maksim Yevmenkin 
@@ -49,9 +49,7 @@
 .Pp
 In order to discover services, remote Bluetooth devices send Service
 Search and Service Attribute or Service Search Attribute requests over
-Bluetooth L2CAP connections on the SDP PSM
-. Pq 0x0001 .
-The
+Bluetooth L2CAP connections on the SDP PSM (0x0001).  The
 .Nm
 daemon will try to find matching Service Records in its Service Database
 and will return the requested record extracts for the remote device to



CVS commit: src/usr.sbin/sdpd

2009-08-13 Thread Matthias Drochner
Module Name:src
Committed By:   drochner
Date:   Thu Aug 13 17:50:41 UTC 2009

Modified Files:
src/usr.sbin/sdpd: main.c

Log Message:
give up root's supplementary group memberships when switching
to _sdpd._sdpd privileges, approved by plunky


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/sdpd/main.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/sdpd/main.c
diff -u src/usr.sbin/sdpd/main.c:1.5 src/usr.sbin/sdpd/main.c:1.6
--- src/usr.sbin/sdpd/main.c:1.5	Tue May 12 10:05:06 2009
+++ src/usr.sbin/sdpd/main.c	Thu Aug 13 17:50:41 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.5 2009/05/12 10:05:06 plunky Exp $	*/
+/*	$NetBSD: main.c,v 1.6 2009/08/13 17:50:41 drochner Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
   Copyright (c) 2006 Itronix, Inc.\
   Copyright (c) 2004 Maksim Yevmenkin m_evmen...@yahoo.com.\
   All rights reserved.");
-__RCSID("$NetBSD: main.c,v 1.5 2009/05/12 10:05:06 plunky Exp $");
+__RCSID("$NetBSD: main.c,v 1.6 2009/08/13 17:50:41 drochner Exp $");
 
 #include 
 #include 
@@ -200,6 +200,13 @@
 		return false;
 	}
 
+	if (setgroups(0, NULL) < 0) {
+		log_err("Could not setgroups(0). %s (%d)",
+		strerror(errno), errno);
+
+		return false;
+	}
+
 	if (setuid(uid) < 0) {
 		log_err("Could not setuid(%s). %s (%d)", user,
 		strerror(errno), errno);



CVS commit: src/usr.sbin/sdpd

2009-05-12 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue May 12 10:27:53 UTC 2009

Modified Files:
src/usr.sbin/sdpd: sdpd.8

Log Message:
Sort sections, fix section header.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/sdpd/sdpd.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/sdpd/sdpd.8
diff -u src/usr.sbin/sdpd/sdpd.8:1.5 src/usr.sbin/sdpd/sdpd.8:1.6
--- src/usr.sbin/sdpd/sdpd.8:1.5	Tue May 12 10:05:07 2009
+++ src/usr.sbin/sdpd/sdpd.8	Tue May 12 10:27:53 2009
@@ -1,4 +1,4 @@
-.\" $NetBSD: sdpd.8,v 1.5 2009/05/12 10:05:07 plunky Exp $
+.\" $NetBSD: sdpd.8,v 1.6 2009/05/12 10:27:53 wiz Exp $
 .\"
 .\" Copyright (c) 2009 The NetBSD Foundation, Inc.
 .\" Copyright (c) 2004 Maksim Yevmenkin 
@@ -106,33 +106,6 @@
 The default user name is
 .Dq Li _sdpd .
 .El
-.Sh CAVEAT
-The
-.Nm
-daemon
-will listen for incoming L2CAP connections on a wildcard BD_ADDR.
-.Pp
-In case of multiple Bluetooth controllers connected to the same host
-it is possible to limit visibility of Service Records according to
-the controller the connection is made through.
-.Pp
-Requests to insert, remove or update service records can only be made
-via the control socket.
-The
-.Nm
-daemon will check the peer's credentials and will only accept the request
-when the peer is the superuser, of if the peer is a member of the group
-specified with the
-.Fl G
-option.
-.Pp
-The
-.Nm
-daemon does not check for duplicated Service Records and only
-performs minimal validation of the record data sent in the Insert/Update
-Record requests.
-It is assumed that application must obtain all required resources such
-as RFCOMM channels etc., before registering the service.
 .Sh FILES
 .Bl -tag -width ".Pa /var/run/sdp" -compact
 .It Pa /var/run/sdp
@@ -165,6 +138,33 @@
 .Sh AUTHORS
 .An Maksim Yevmenkin Aq m_evmen...@yahoo.com
 .An Iain Hibbert
+.Sh CAVEATS
+The
+.Nm
+daemon
+will listen for incoming L2CAP connections on a wildcard BD_ADDR.
+.Pp
+In case of multiple Bluetooth controllers connected to the same host
+it is possible to limit visibility of Service Records according to
+the controller the connection is made through.
+.Pp
+Requests to insert, remove or update service records can only be made
+via the control socket.
+The
+.Nm
+daemon will check the peer's credentials and will only accept the request
+when the peer is the superuser, of if the peer is a member of the group
+specified with the
+.Fl G
+option.
+.Pp
+The
+.Nm
+daemon does not check for duplicated Service Records and only
+performs minimal validation of the record data sent in the Insert/Update
+Record requests.
+It is assumed that application must obtain all required resources such
+as RFCOMM channels etc., before registering the service.
 .Sh BUGS
 .Nm
 only ever generates 16-bit sequence headers, so if a response was



CVS commit: src/usr.sbin/sdpd

2009-04-18 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Sat Apr 18 13:53:59 UTC 2009

Modified Files:
src/usr.sbin/sdpd: profile.c server.c

Log Message:
Fix -Wcast-qual and -Wsign-compare issues


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/sdpd/profile.c \
src/usr.sbin/sdpd/server.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/sdpd/profile.c
diff -u src/usr.sbin/sdpd/profile.c:1.5 src/usr.sbin/sdpd/profile.c:1.6
--- src/usr.sbin/sdpd/profile.c:1.5	Wed Mar 19 23:15:19 2008
+++ src/usr.sbin/sdpd/profile.c	Sat Apr 18 13:53:59 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: profile.c,v 1.5 2008/03/19 23:15:19 plunky Exp $	*/
+/*	$NetBSD: profile.c,v 1.6 2009/04/18 13:53:59 lukem Exp $	*/
 
 /*
  * profile.c
@@ -28,12 +28,12 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $Id: profile.c,v 1.5 2008/03/19 23:15:19 plunky Exp $
+ * $Id: profile.c,v 1.6 2009/04/18 13:53:59 lukem Exp $
  * $FreeBSD: src/usr.sbin/bluetooth/sdpd/profile.c,v 1.2 2004/07/28 07:15:44 kan Exp $
  */
 
 #include 
-__RCSID("$NetBSD: profile.c,v 1.5 2008/03/19 23:15:19 plunky Exp $");
+__RCSID("$NetBSD: profile.c,v 1.6 2009/04/18 13:53:59 lukem Exp $");
 
 #include 
 #include 
@@ -79,7 +79,7 @@
 		&sp_profile_descriptor,
 	};
 
-	int32_t			i;
+	size_t			i;
 
 	for (i = 0; i < sizeof(profiles)/sizeof(profiles[0]); i++)
 		if (profiles[i]->uuid[0] == uuid)
@@ -415,7 +415,7 @@
 #endif
 	};
 	const int psize = __arraycount(ptype) * 3;
-	int i;
+	size_t i;
 
 	if (datalen != 2 || (18 + psize) > 255 || (buf + 20 + psize) > eob)
 		return (-1);
@@ -428,7 +428,7 @@
 	SDP_PUT8(SDP_DATA_UUID16, buf);
 	SDP_PUT16(SDP_UUID_PROTOCOL_L2CAP, buf);
 	SDP_PUT8(SDP_DATA_UINT16, buf);
-	SDP_PUT16(*(uint16_t *)data, buf);
+	SDP_PUT16(*(const uint16_t *)data, buf);
 
 	SDP_PUT8(SDP_DATA_SEQ8, buf);
 	SDP_PUT8(8 + psize, buf);
Index: src/usr.sbin/sdpd/server.c
diff -u src/usr.sbin/sdpd/server.c:1.5 src/usr.sbin/sdpd/server.c:1.6
--- src/usr.sbin/sdpd/server.c:1.5	Thu Jan 15 23:17:00 2009
+++ src/usr.sbin/sdpd/server.c	Sat Apr 18 13:53:59 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: server.c,v 1.5 2009/01/15 23:17:00 plunky Exp $	*/
+/*	$NetBSD: server.c,v 1.6 2009/04/18 13:53:59 lukem Exp $	*/
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -55,12 +55,12 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $Id: server.c,v 1.5 2009/01/15 23:17:00 plunky Exp $
+ * $Id: server.c,v 1.6 2009/04/18 13:53:59 lukem Exp $
  * $FreeBSD: src/usr.sbin/bluetooth/sdpd/server.c,v 1.2 2005/12/06 17:56:36 emax Exp $
  */
 
 #include 
-__RCSID("$NetBSD: server.c,v 1.5 2009/01/15 23:17:00 plunky Exp $");
+__RCSID("$NetBSD: server.c,v 1.6 2009/04/18 13:53:59 lukem Exp $");
 
 #include 
 #include 
@@ -476,8 +476,8 @@
 		srv->fdidx[fd].priv =
 		server_auth_check(srv, (struct sockcred *)CMSG_DATA(cmsg));
 
-	if (len >= sizeof(*pdu)
-	&& (sizeof(*pdu) + (pdu->len = ntohs(pdu->len))) == len) {
+	if ((uint32_t)len >= sizeof(*pdu)
+	&& (sizeof(*pdu) + (pdu->len = ntohs(pdu->len))) == (uint32_t)len) {
 		switch (pdu->pid) {
 		case SDP_PDU_SERVICE_SEARCH_REQUEST:
 			error = server_prepare_service_search_response(srv, fd);