From owner-freebsd-bugs@FreeBSD.ORG Sat May 6 10:10:41 2006 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2D3A016A43C for ; Sat, 6 May 2006 10:10:41 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0B3C243D7E for ; Sat, 6 May 2006 10:10:26 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k46AAQgv058016 for ; Sat, 6 May 2006 10:10:26 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k46AAQXk058015; Sat, 6 May 2006 10:10:26 GMT (envelope-from gnats) Resent-Date: Sat, 6 May 2006 10:10:26 GMT Resent-Message-Id: <200605061010.k46AAQXk058015@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "Shin'ya Kumabuchi" Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9F15716A415 for ; Sat, 6 May 2006 10:07:38 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2570F43D6A for ; Sat, 6 May 2006 10:07:35 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k46A7Y0x074624 for ; Sat, 6 May 2006 10:07:34 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id k46A7YSV074623; Sat, 6 May 2006 10:07:34 GMT (envelope-from nobody) Message-Id: <200605061007.k46A7YSV074623@www.freebsd.org> Date: Sat, 6 May 2006 10:07:34 GMT From: "Shin'ya Kumabuchi" To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Cc: Subject: bin/96854: devd(8) parses events incorrectly in some cases X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 May 2006 10:10:41 -0000 >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 at 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: