Skip site navigation (1)Skip section navigation (2)
Date:      14 Jul 2002 12:19:42 +0200
From:      Frank Nobis <fn@Radio-do.de>
To:        freebsd-stable@FreeBSD.ORG
Subject:   usbd dumps core after changing /etc/usbd.conf on 4.6-RELEASE-p1
Message-ID:  <ygeadour4qp.fsf@cube.radio-do.de>

next in thread | raw e-mail | index | archive | help
--=-=-=


Hi,

did anyone see this too?.

I changed my /etc/usbd.conf to have additional entries for a
Microsoft Intelli Mouse with 3 and 5 Buttons and a wheel.

Now the usbd dumps core in read_configuration on line 464 of
usbd.c revision 1.10.2.4.

This seems to be, because of the whitespace and comment checking
part is counting len to zero, while searching for real config
lines and skiping the comments etc. But somehow len now become -1
and obviuosly dumps out in strncpy(linez, line, len)

A patch may be this:

Index: usbd.c
===================================================================
RCS file: /net/ga/home2/ncvs/src/usr.sbin/usbd/usbd.c,v
retrieving revision 1.10.2.4
diff -c -r1.10.2.4 usbd.c
*** usbd.c	24 Feb 2002 14:23:13 -0000	1.10.2.4
--- usbd.c	13 Jul 2002 16:25:40 -0000
***************
*** 449,455 ****
  			len--;
  		}
  
! 		if (len == 0)		/* empty line */
  			continue;
  		if (line[0] == '#')	/* comment line */
  			continue;
--- 449,455 ----
  			len--;
  		}
  
! 		if (len <= 0)		/* empty line */
  			continue;
  		if (line[0] == '#')	/* comment line */
  			continue;

Here is my /etc/usdb.conf which causes that trouble.


--=-=-=
Content-Disposition: attachment; filename=usbd.conf
Content-Description: usbd.conf for Intelli Mouse

# Configuration file the USB daemon.
#
# See usbd.conf(5) for the description of the format of the file.
#
# $FreeBSD: src/etc/usbd.conf,v 1.5.2.2 2000/10/16 16:32:12 n_hibma Exp $

# Firmware download into the ActiveWire board. After the firmware download is
# done the device detaches and reappears as something new and shiny automatically.
#
device "ActiveWire board, firmware download"
	vendor  0x0854
	product 0x0100
	release 0x0000
	attach "/usr/local/bin/ezdownload -f /usr/local/share/usb/firmware/0854.0100.0_01.hex ${DEVNAME}"

# Firmware download for Entrega Serial DB25 adapter.
#
device "Entrega Serial with UART"
	product 0x8001
	vendor  0x1645
	release 0x0101
	attach "if ! kldstat -n usio > /dev/null 2>&1 ; then kldload usio; fi"
	attach "/usr/sbin/ezdownload -v -f /usr/share/usb/firmware/1645.8001.0101 /dev/${DEVNAME}"

# The entry below starts and stops dhclient when an ethernet device is inserted
# Caveat: It does not support multiple interfaces (but neither does pccardd,
# it shouldn't be too big a deal :-)
#
device "USB ethernet"
	devname "[ack]ue[0-9]+"
	attach "dhclient ${DEVNAME}"
	detach "killall dhclient"

# The entry below starts moused when a mouse is plugged in. Moused
# stops automatically (actually it bombs :) when the device disappears.
#
#device "Microsoft 5-Button Mouse with IntelliEye(TM)"
#	devname "ums[0-9]+"
#	product	0x0039
#	vendor	0x045e
#	attach "/usr/sbin/moused -p /dev/${DEVNAME} -I /var/run/moused.${DEVNAME}.pid -z 6 7"


device "Microsoft 3-Button Mouse with IntelliEye(TM)"
	devname "ums[0-9]+"
	product	0x0040
	vendor	0x045e
	attach "/usr/sbin/moused -p /dev/${DEVNAME} -I /var/run/moused.${DEVNAME}.pid -z 4 5"


# The entry below starts moused when a mouse is plugged in. Moused
# stops automatically (actually it bombs :) when the device disappears.
#
device "Mouse"
	devname "ums[0-9]+"
	attach "/usr/sbin/moused -p /dev/${DEVNAME} -I /var/run/moused.${DEVNAME}.pid"

# The fallthrough entry: Nothing is specified, nothing is done.  And it isn't
# necessary at all :-).  Just for pretty printing in debugging mode.
#
device "USB device"

--=-=-=



Greetings
        Frank Nobis
-- 
.signature is: umop 3p!sdn

--=-=-=--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




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