tweaks to sysctl integer value parsing (report any problems)

From: Robert Watson <rwatson_at_FreeBSD.org>
Date: Sun, 15 Jun 2003 12:47:13 -0400 (EDT)
Last night, I committed some tweaks to how sysctl integer value parsing
occurs.  The motivation for these changes was the outcome of finding the
following in my sysctl.conf:

   kern.maxfiles="4000"

Which, to my great sadness, occurred on a box without DDB or remote power. 
For the uninitiated, until my recent commit, the "4000" would converted to
0, resulting in severely degraded operation (your kernel now exists solely
to report that it is out of files after a reboot).  Now, sysctl will
reject poorly formatted values that will be converted to integers, as well
as empty strings in the integer conversion.  This means that the following
will now generate an error: 

   kern.maxfiles=		# previously: 0
   kern.maxfiles=5"		# previously: 5

I'm not convinced my changes are 100% ideal, so I'm going to be on the
lookout for posts saying "my sysctl.conf no longer works!", and perhaps we
can refine the approach a bit.  On the other hand, I now have only one
working foot after my recent foot-shooting exercise, so I'm fairly
convinced that some change, even if not this precise change, is necessary
:-).

Robert N M Watson             FreeBSD Core Team, TrustedBSD Projects
robert_at_fledge.watson.org      Network Associates Laboratories
Received on Sun Jun 15 2003 - 07:48:53 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:12 UTC