coreutils
coreutils copied to clipboard
install(1) compatibility: autotools+audit-userspace `make install` failure (multiple `-m` arguments)
Hello,
during some tests I noticed audit-userspace is not able to install on a uutils based system. After lots of debugging I tracked it down to:
audisp/plugins/af_unix/Makefile.am
install-data-hook:
mkdir -p -m 0750 ${DESTDIR}${plugin_confdir}
for i in $(CONF_FILES); do \
$(INSTALL_DATA) -D -m 640 ${srcdir}/"$$i" \
${DESTDIR}${plugin_confdir}; \
done
which combined with an autotools internal library:
/usr/share/autoconf/autoconf/programs.m4
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
AC_SUBST(INSTALL_DATA)dnl
])# AC_PROG_INSTALL
Results in this code being executed:
mkdir -p -m 0750 /build/audit/pkg/audit/etc/audit/plugins.d
for i in af_unix.conf; do \
/usr/bin/install -c -m 644 -D -m 640 ./"$i" \
/build/audit/pkg/audit/etc/audit/plugins.d; \
done
This is valid with gnu/coreutils and busybox:
/ # install -m 644 -m 640 /etc/issue i
/ # stat -c%a i
640
/ #
But is rejected as invalid by uutils:
% uu-install -m 644 -m 640 /etc/issue i
error: the argument '--mode <MODE>' cannot be used multiple times
Usage: uu-install [OPTION]... [FILE]...
For more information, try '--help'.
I'm not sure who exactly is in the wrong in this situation, the most pragmatic way would be changing uutils to only consider the .last() instance of -m.
As a workaround it's possible to do this:
make DESTDIR="$pkgdir" INSTALL_DATA="install" install