The various install-*-hook targets are of the form shown here for traceroute:

install-traceroute-hook:
        -@$(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:

        -@$(INSTALL_PROGRAM) $(SUIDMODE) $(AM_INSTALL_PROGRAM_FLAGS) traceroute 
$(DESTDIR)$(bindir)/`echo traceroute|sed '$(transform)'`



-- 
Bill Cole
[email protected] or [email protected]
(AKA @grumpybozo and many *@billmail.scconsult.com addresses)
Currently Seeking Steadier Work: https://linkedin.com/in/billcole

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to