Scott Cheloha <scottchel...@gmail.com> wrote:

> We're sorta-kinda circling around adding the missing (?) stdio error
> checking to other utilities in bin/ and usr.bin/, no?  I want to be
> sure I understand how to do the next patch, because if we do that it
> will probably be a bunch of programs all at once.


This specific program has not checked for this condition since at least
2 AT&T UNIX.

Your change does not just add a new warning.  It adds a new exit code
condition.

Some scripts using echo, which accepted the condition because echo would
exit 0 and not check for this condition, will now see this exit 1.  Some
scripts will abort, because they use "set -o errexit" or similar.

You are changing the exit code for a command which is used a lot.

POSIX does not require or specify exit 1 for this condition.  If you
disagree, please show where it says so.

So my question is:  What will be broken by this change?

Nothing isn't an answer.  I can write a 5 line shell script that will
observe the change in behaviour.  Many large shell scripts could break
from this.  I am thinking of fw_update and the installer, but it could
also be a problem in Makefiles.

> I want to be sure I understand how to do the next patch, because if we
> do that it will probably be a bunch of programs all at once.

If you cannot speak to the exit code command changing for this one
simple program, I think there is no case for adding to to hundreds of
other programs.  Unless POSIX specifies the requirement, I'd like to see
some justification.

There will always be situations that UNIX didn't anticipate or handle,
and then POSIX failed to specify.  Such things are now unhandled, probably
forever, and have become defacto standards.

On the balance, is your diff improving on some dangerous problem, or is
it introducing a vast number of dangerous new risks which cannot be
identified (and which would require an audit of every known script
calling echo).  Has such an audit been started?





Reply via email to