Subject: Re: -current config(8) + files.opencrypto == cryptographic roulette?
To: Jonathan Stone <jonathan@DSG.Stanford.EDU>
From: Rafal Boni <rafal@pobox.com>
List: tech-kern
Date: 11/24/2003 14:13:18
In message <200311230334.TAA03027@Pescadero.DSG.Stanford.EDU>, you write: 

-> In message <200311221541.hAMFfjvZ010998@fearless-vampire-killer.waterside.ne
-> t>Rafal Boni writes
-> >In message <200311220412.UAA29613@Pescadero.DSG.Stanford.EDU>, you write: 
-> 
-> >-> Can you send me a copy of your kernel-config file so I can try it out?
-> >
-> >See below.
-> [...]
-> 
-> I ran /usr/sbin/config over that config on an i386. It compiled
-> and linked cleanly.
-> 
-> I do still have somewhat dated config tools (pre-gcc3.3, around late
-> July, IIRC). How new is your /usr/sbin/config? Your toolchain?

From  a bit of poking around it looks like struct nvlist's nv_flags
member never gets initialized to a sane value, leading config(8) to
believe that it has already added some attributes into the selected
list (via NV_DEPENDED) when it in fact hadn't.  

This strikes me as odd in the "how did this ever work?" sense, but
the following patch does make my config(8) behave sanely -- at least
as far as nv_flags is concerned; I'm not sure whether initializing
the nv_ifunit member to 0 is a good thing or not but doing so does
not change the output of my config(8) runs, so I thought I'd toss
it in there as well (maybe it should be -1, since 0 is a valid unit
number?).

Patch below,
--rafal

Index: util.c
===================================================================
RCS file: /cvsroot/src/usr.sbin/config/util.c,v
retrieving revision 1.18
diff -u -p -r1.18 util.c
--- util.c	19 Sep 2003 06:19:56 -0000	1.18
+++ util.c	24 Nov 2003 18:30:55 -0000
@@ -200,6 +200,8 @@ newnv(const char *name, const char *str,
 		nv->nv_ptr = ptr;
 	}
 	nv->nv_int = i;
+	nv->nv_flags = 0;
+	nv->nv_ifunit = 0;
 	return (nv);
 }
 
----
Rafal Boni                                                     rafal@pobox.com
  We are all worms.  But I do believe I am a glowworm.  -- Winston Churchill