[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-inetutils] Portability bug in inetutils src/Makefile
From: |
Bill Cole |
Subject: |
[bug-inetutils] Portability bug in inetutils src/Makefile |
Date: |
Sat, 14 Jul 2018 13:58:40 -0400 |
The various install-*-hook targets are of the form shown here for traceroute:
install-traceroute-hook:
address@hidden(INSTALL_PROGRAM) traceroute $(SUIDMODE)
$(AM_INSTALL_PROGRAM_FLAGS) $(DESTDIR)$(bindir)/`echo traceroute|sed
'$(transform)'` ; \
if test $$? -ne 0; then \
echo "WARNING: insufficient access; not installing traceroute"; \
echo "NOTE: To install traceroute run 'make install' as root"; \
fi
This has 2 significant flaws:
1. The error warning assumes that the only failure mode is insufficient access.
This is an incorrect assumption. Most obviously, incorrect invocations are
possible. While the GNU 'install' appears to use '1' as the exit code for all
failures, others (e.g. BSD install) provide useful distinctions in their exit
codes which could be exposed to the user rather than assuming that all failures
are identical.
2. GNU 'install' tolerates the idiosyncratic argument ordering used in the
Makefile (putting options between the source and target) but this is
undocumented behavior and is NOT consistent with BSD 'install' which fails with
an exit code 64 (EX_USAGE) when given that syntax. This could in principle be
addressed at configure time by testing the install binary or simply by making
GNU install a dependency, but the simplest approach would be to use the
compatible documented calling order, like this:
address@hidden(INSTALL_PROGRAM) $(SUIDMODE) $(AM_INSTALL_PROGRAM_FLAGS)
traceroute $(DESTDIR)$(bindir)/`echo traceroute|sed '$(transform)'`
--
Bill Cole
address@hidden or address@hidden
(AKA @grumpybozo and many address@hidden addresses)
Currently Seeking Steadier Work: https://linkedin.com/in/billcole
signature.asc
Description: OpenPGP digital signature
- [bug-inetutils] Portability bug in inetutils src/Makefile,
Bill Cole <=