Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 05 Oct 2013 21:55:15 +0200
From:      =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no>
To:        Alfred Perlstein <bright@mu.org>
Cc:        arch@freebsd.org
Subject:   Re: Userland patch level
Message-ID:  <86siwfqyqk.fsf@nine.des.no>
In-Reply-To: <52506076.2090803@mu.org> (Alfred Perlstein's message of "Sat, 05 Oct 2013 11:54:46 -0700")
References:  <8661tbsi40.fsf@nine.des.no> <52506076.2090803@mu.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Alfred Perlstein <bright@mu.org> writes:
> 1) Can we add it as a uname option as well?

It was intentionally done as a shell script so it can be run from e.g. a
live CD without having to worry about binary compatibility.

> 2) FreeNAS uses /etc/version as just a file, any point in doing that
> instead?

No, /etc belongs to the user, and we can't trust that's it up to date;
freebsd-update would update it, but make installworld probably wouldn't,
and expecting the user to run mergemaster or etcupdate adds one more
point of failure.

> 3) This article has an example of a script that works on many flavors
> of linux, any way to make it so that it works on FreeBSD as well?
> http://unix.stackexchange.com/questions/6345/how-can-i-get-distribution-n=
ame-and-version-number-in-a-simple-shell-script

Same reason as above.  Plus, I'm pretty sure this does not work;
/etc/lsb-release on a RHEL 6 desktop looks like this:

LSB_VERSION=3Dbase-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch=
:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noa=
rch

which is nothing like what that script expects.

BTW, this grew out of a discussion in the security workgroup at the
DevSummit (cf. https://wiki.freebsd.org/201309DevSummit/Security) during
which we touched upon roughly the same points as you raised.

This was initially meant to be little more than "echo X.Y-RELEASE-pZ"
and to be used only by portaudit / pkg audit / what have you, which is
why it's hidden away in /libexec, but considering how much it's grown
from inception to implementation, it might make more sense to put it in
a more accessible location.

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no



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