Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Jul 2000 00:18:33 -0700 (PDT)
From:      scott_long@btc.adaptec.com
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/19817: usbd broken, does not parse usbd.conf
Message-ID:  <20000710071833.43E2537B669@hub.freebsd.org>

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

>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




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