From owner-freebsd-bugs Mon Jul 10 0:20:21 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 829BE37BFB9 for ; Mon, 10 Jul 2000 00:20:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id AAA65512; Mon, 10 Jul 2000 00:20:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: by hub.freebsd.org (Postfix, from userid 32767) id 43E2537B669; Mon, 10 Jul 2000 00:18:33 -0700 (PDT) Message-Id: <20000710071833.43E2537B669@hub.freebsd.org> Date: Mon, 10 Jul 2000 00:18:33 -0700 (PDT) From: scott_long@btc.adaptec.com To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: misc/19817: usbd broken, does not parse usbd.conf Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 19817 >Category: misc >Synopsis: usbd broken, does not parse usbd.conf >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Jul 10 00:20:01 PDT 2000 >Closed-Date: >Last-Modified: >Originator: Scott Long >Release: 5.0-CURRENT >Organization: >Environment: FreeBSD mitchman.co 5.0-CURRENT FreeBSD 5.0-CURRENT #0: Sun Jul 9 22:33:53 MDT 2000 scottl@mitchman.co:/usr/obj/usr/src/sys/MITCHMAN i386 >Description: usbd fails to parse it's config file, usbd.conf. Even though the conf file is correct in all respects, attempting to start usbd yields "etc/usbd.conf:10: Syntax error in 'device'". Looking at the source of usbd shows a for loop that reads each line of the conf file and parses it. The problem arises in that when the 'device' line is parsed, the same line is then parsed for the next keyword. COrrect behaviour is for the for loop to break and allow the next conf file line to be read in. Attahched patch does this. >How-To-Repeat: Problem will be apparent when usbd is run >Fix: *** usbd.c.old Mon Jul 10 00:48:05 2000 --- usbd.c Mon Jul 10 00:46:46 2000 *************** *** 516,528 **** /* Add it to the end of the list to preserve order */ STAILQ_INSERT_TAIL(&actions, action, next); - } ! if (action == NULL) { ! line[len] = '\0'; /* XXX zero terminate */ ! fprintf(stderr, "%s:%d: Doesn't start with 'device' " ! "but '%s'\n", configfile, lineno, field); ! exit(2); } for (i = 0; config_fields[i].name ; i++) { --- 516,531 ---- /* Add it to the end of the list to preserve order */ STAILQ_INSERT_TAIL(&actions, action, next); ! if (action == NULL) { ! line[len] = '\0'; /* XXX zero terminate */! fprintf(stderr, "%s:%d: Doesn't start with " ! "'device' but '%s'\n", configfile, ! lineno, field); ! exit(2); ! } ! /* Break here so that the next line can be parsed */ ! break; } for (i = 0; config_fields[i].name ; i++) { >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message