Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 May 2006 10:07:34 GMT
From:      "Shin'ya Kumabuchi" <kumabu@t3.rim.or.jp>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   bin/96854: devd(8) parses events incorrectly in some cases
Message-ID:  <200605061007.k46A7YSV074623@www.freebsd.org>
Resent-Message-ID: <200605061010.k46AAQXk058015@freefall.freebsd.org>

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

>Number:         96854
>Category:       bin
>Synopsis:       devd(8) parses events incorrectly in some cases
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat May 06 10:10:26 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Shin'ya Kumabuchi
>Release:        6-stable
>Organization:
>Environment:
FreeBSD hoge 6.0-STABLE FreeBSD 6.0-STABLE #1: Mon Jan 23 05:39:57 JST 2006     root@hoge:/usr/local/obj/usr/src/sys/KUMA  i386
>Description:
devd should care about multiple white spaces in event message.
For example my usb speaker produces following event.
(with running devd -Dd)

Processing event '+pcm1  at   on uaudio0'
(Processing event '+pcm1&#x20;&#x20;at&#x20;&#x20;&#x20;on uaudio0')

But devd is expecting that words are delimited by single space,
so particular event isn't fully parsed by devd.

# In above case, `bus=uaudio0' should be set.
>How-To-Repeat:

>Fix:
--- /usr/src/sbin/devd/devd.cc.org      Mon Dec 19 12:33:05 2005
+++ /usr/src/sbin/devd/devd.cc  Sat May  6 18:58:34 2006
@@ -644,9 +644,11 @@
                if (sp == NULL)
                        return; /* Can't happen? */
                *sp++ = '\0';
+               while (isspace(*sp)) sp++;
                if (strncmp(sp, "at ", 3) == 0)
                        sp += 3;
                sp = cfg.set_vars(sp);
+               while (isspace(*sp)) sp++;
                if (strncmp(sp, "on ", 3) == 0)
                        cfg.set_variable("bus", sp + 3);
                break;
@@ -657,9 +659,11 @@
                        return; /* Can't happen? */
                *sp++ = '\0';
                cfg.set_variable("device-name", buffer);
+               while (isspace(*sp)) sp++;
                if (strncmp(sp, "at ", 3) == 0)
                        sp += 3;
                sp = cfg.set_vars(sp);
+               while (isspace(*sp)) sp++;
                if (strncmp(sp, "on ", 3) == 0)
                        cfg.set_variable("bus", sp + 3);
                break;

>Release-Note:
>Audit-Trail:
>Unformatted:



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