NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: install/41117: ddb.onpanic=0 in default sysctl.conf(5) could cause error



The following reply was made to PR install/41117; it has been noted by GNATS.

From: christos%zoulas.com@localhost (Christos Zoulas)
To: gnats-bugs%NetBSD.org@localhost, martin%NetBSD.org@localhost, 
gnats-admin%netbsd.org@localhost, 
        netbsd-bugs%netbsd.org@localhost, tsutsui%ceres.dti.ne.jp@localhost
Cc: 
Subject: Re: install/41117: ddb.onpanic=0 in default sysctl.conf(5) could cause 
error
Date: Wed, 1 Apr 2009 11:09:35 -0400

 On Apr 1,  2:40pm, cube%cubidou.net@localhost (Quentin Garnier) wrote:
 -- Subject: Re: install/41117: ddb.onpanic=0 in default sysctl.conf(5) could 
 
 |  And it doesn't prevent the message from being printed for a custom,
 |  no-DDB kernel.
 
 This is a very stupid patch that implements ?=
 It will make things that do foo='???' fail, but I don't think that there
 are any ?'s in sysctl name or values.
 
 christos
 
 Index: sysctl.c
 ===================================================================
 RCS file: /cvsroot/src/sbin/sysctl/sysctl.c,v
 retrieving revision 1.128
 diff -u -u -r1.128 sysctl.c
 --- sysctl.c   20 Mar 2009 13:18:50 -0000      1.128
 +++ sysctl.c   1 Apr 2009 15:07:01 -0000
 @@ -788,9 +788,14 @@
        u_int namelen, type;
        char *key, *value, *dot;
        size_t sz;
 +      bool optional = false;
  
        req = 1;
        key = l;
 +      if ((value = strchr(l, '?')) != NULL) {
 +              *value = '\0';
 +              optional = true;
 +      }
        value = strchr(l, '=');
        if (value != NULL)
                *value++ = '\0';
 @@ -836,6 +841,8 @@
  
        if (sysctlgetmibinfo(key, &name[0], &namelen, gsname, &sz, &node,
                             SYSCTL_VERSION) == -1) {
 +              if (optional)
 +                      return;
                sysctlparseerror(namelen, l);
                EXIT(1);
        }
 


Home | Main Index | Thread Index | Old Index