Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 May 2008 11:16:48 -0700
From:      David Wolfskill <david@catwhisker.org>
To:        hackers@freebsd.org
Subject:   Re: [Patch] Using sysctl(8) to acquire info from different systems
Message-ID:  <20080518181648.GA7468@bunrab.catwhisker.org>
In-Reply-To: <20080518170936.GB1797@roadrunner.spoerlein.net>
References:  <20080512200901.GL66703@bunrab.catwhisker.org> <20080518170936.GB1797@roadrunner.spoerlein.net>

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

--KLINyTCByxgMLuN/
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sun, May 18, 2008 at 07:09:36PM +0200, Ulrich Spoerlein wrote:
> ...
> I find this functionality very useful, but the addition of another flag
> as problematic. First of all, old releases don't have it. Secondly, the
> behaviour you describe should be the default anyway (IMHO).

Thank you for your support of the idea.  I'll explain why I chose a
different approach in the implementation.

I agree that it would have been handy had it been the default behavior,
but it hasn't been and wishing isn't likely to change that.  Thus, if a
change is to be seen in the older releases, *some* change will need to
be made to the code for those releases.

By making the change the addition of a flag, we are able to preserve the
existing default behavior -- and thus avoid potentioal perception of a
POLA violation.

And I believe the change is easily merged from CURRENT to older
releases, if someone is willing to do the commit.

> So, when requesting OID a, b, and c, sysctl should print a, a warning
> that it cannot find OID b (to STDERR), then print c and exit with a
> return code !=3D 0.

Well, the warning should be emitted in the absence of the -q flag, I
expect, but in its presence, the warning should (IMO) be suppressed.

> At least, that's what I would code it to do.

I'd be happy for the default to be to (at least) "carry on" after
finding a request for an unknown OID.

I deliberately made my patch as non-invasive as I could to improve its
chances of actually getting committed -- as well as the above-cited
desire to avoid perception of a POLA violation.  :-}  And I'm hardly
claiming that the approach I took is optimal, let alone the "only" one:
it is an approach that I believe to be consistent with my requirements
and thus serves to more clearly illustrate those requirements.

BTW, I did file a PR -- it's bin/123644: Allow sysctl(8) to ignore
unknown OIDs.

Peace,
david
--=20
David H. Wolfskill				david@catwhisker.org
I submit that "conspiracy" would be an appropriate collective noun for cats.

See http://www.catwhisker.org/~david/publickey.gpg for my public key.

--KLINyTCByxgMLuN/
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (FreeBSD)

iEYEARECAAYFAkgwcpAACgkQmprOCmdXAD2T5ACfaFggw4NYBk9QpcxRuHXdnyEW
4ssAnjA6iEZcpfaIQA54d4WeYyBLRl3y
=aS/v
-----END PGP SIGNATURE-----

--KLINyTCByxgMLuN/--



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