NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
PR/58577 CVS commit: src/usr.bin/xinstall
The following reply was made to PR bin/58577; it has been noted by GNATS.
From: "Robert Elz" <kre%netbsd.org@localhost>
To: gnats-bugs%gnats.NetBSD.org@localhost
Cc:
Subject: PR/58577 CVS commit: src/usr.bin/xinstall
Date: Fri, 10 Jul 2026 07:55:51 +0000
Module Name: src
Committed By: kre
Date: Fri Jul 10 07:55:50 UTC 2026
Modified Files:
src/usr.bin/xinstall: xinstall.c
Log Message:
PR bin/58577 - install(1) -d issues
Fix issues where "install -d" (with no directory) simply
exit(0)s. That one is kind of marginal, installing nothing
when nothing is needed could be treated as OK, but the man
page does indicate in the SYNOPSIS that with -d, at least
one directory is needed (it says nothing at all about that
in the text).
Second, after creating a directory, if a later operation
(chown, chmod) fails, that is not success, a warning was
issued (good), a bad metalog was being created (bad).
That is clearly a bug (though probably doesn't happen
very often).
And third, when install -d fails, and issues an error,
(warn()) the exit status from install(1) should not be zero.
This only applies after the (rare, I'd assume) errors
from the 2nd fix (which were not previously regarded as
errors). The more common failure cases were before, and
still are, handled by an immediate err() exit.
Patch from the PR (from RVP) installed, plus a couple of
changes from me.
The method in the patch of just "or"ing the status from
the install_dir() would work if install_dir() had been made
to return 0 (success) and 1 (failure), but it wasn't, it
was made to return EXIT_SUCCESS and EXIT_FAILURE instead.
It is wrong to assume those are necessarily 0 and 1.
They are for us (and other unix like systems), but not
guaranteed. So I modified that code to eliminate that
coding technique (I think when creating directories, we
can afford one more "if" in the code!)
I also added sets of {} around a few large blocks of a single
statement that just looked weird (not incorrect) as they were.
This thing still needs some KNF surgery however (including, but
not limited to, whitespace issues).
XXX pullup -11 (probably -10 as well)
To generate a diff of this commit:
cvs rdiff -u -r1.130 -r1.131 src/usr.bin/xinstall/xinstall.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Home |
Main Index |
Thread Index |
Old Index