summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2007-12-02 16:19:04 +0100
committerJim Meyering <meyering@redhat.com>2007-12-02 16:19:04 +0100
commit6bbbf0314e80427c3d58fbd3f4cec0cf727813d9 (patch)
treea73100b453f590b254c5cce906f2a4f6244131aa /src
parent5891814f343695b5de6a858a154ad142516b56b5 (diff)
downloadcoreutils-6bbbf0314e80427c3d58fbd3f4cec0cf727813d9.tar.xz
Remove just-installed su, if unable to make it set-UID root.
Normally, su isn't even installed. However, if you configure with --enable-install-program=su, and then install with insufficient privileges, we now make sure to remove the just-installed binary. * src/Makefile.am (install-exec-hook): Rename from install-exec-local, so that this rule is guaranteed to be run *after* installation. If unable to chown and chmod the installed "su" program, remove it. Reported by Greg Schaefer.
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 49979fd08..2f40a04b6 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -178,7 +178,7 @@ install_su = \
install-root: su$(EXEEXT)
@$(install_su)
-install-exec-local: su$(EXEEXT)
+install-exec-hook: su$(EXEEXT)
@if test "$(INSTALL_SU)" = yes; then \
TMPFILE=$(DESTDIR)$(bindir)/.su-$$$$; \
rm -f $$TMPFILE; \
@@ -195,6 +195,7 @@ install-exec-local: su$(EXEEXT)
else \
echo "WARNING: insufficient access; not installing su"; \
echo "NOTE: to install su, run 'make install-root' as root"; \
+ rm -f $(installed_su); \
fi; \
else :; \
fi