bin/140151: Fix potential setlocale(3) in hexdump / od
gcooper at FreeBSD.org
Mon Nov 2 01:10:03 UTC 2009
The following reply was made to PR bin/140151; it has been noted by GNATS.
From: Garrett Cooper <gcooper at FreeBSD.org>
To: Jilles Tjoelker <jilles at stack.nl>
Cc: bug-followup at freebsd.org
Subject: Re: bin/140151: Fix potential setlocale(3) in hexdump / od
Date: Sun, 1 Nov 2009 17:39:05 -0700
We discussed this earlier over IRC, but just to reiterate some points...
On Sat, Oct 31, 2009 at 3:55 PM, Jilles Tjoelker <jilles at stack.nl> wrote:
> General policy across /bin and /usr/bin seems to ignore setlocale()
> failures (usually caused by invalid/unsupported language settings).
> I guess that's sensible, and in any case changing it for hexdump/od only
> seems wrong.
It's fine if hexdump is a start's this trend and core agrees,
because it's been widely ported to other packages outside of FreeBSD,
like util-linux-ng, etc. So, I'm just taking all of the issues and
resolving them so that hexdump, et all has higher quality than it
currently does, because QA in hexdump has been neglected in the past
and it's a handy tool that should be more robust. Plus, it looks like
a bad mark on the project when a piece of software has so many issues
with segfaults, et all.
If warnx(3) is appropriate for now until the rest of the commands
in /bin and /usr/bin conform to the new standard (if that's the way we
want to go longterm), I'll gladly change the patch to warnx(3).
> There seems little wrong with the current way of determining hexdump vs
> od either, which is to treat anything ending in 'od' as od.
This is done because hd / od are hardlinks created when make
install is run for hexdump, and they share a TON of common code (only
the values set by the different usages differ -- the rest of the logic
More information about the freebsd-bugs