]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Remove just-installed su, if unable to make it set-UID root.
authorJim Meyering <meyering@redhat.com>
Sun, 2 Dec 2007 15:19:04 +0000 (16:19 +0100)
committerJim Meyering <meyering@redhat.com>
Sun, 2 Dec 2007 15:19:04 +0000 (16:19 +0100)
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.

ChangeLog
src/Makefile.am

index e7c2a226c45a4d6100c58675afbed71bf5e8d897..52938d360dd4723427206eb18437b658f8c5a597 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2007-12-02  Jim Meyering  <meyering@redhat.com>
+
+       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.
+
 2007-12-01  Bob Proulx  <bob@proulx.com>
 
        Make existing-perm-race executable.
index 49979fd084a370ca10ce6f96e549babeb04acd45..2f40a04b6197c7b69a7e5ec1797a76b7e1611c2e 100644 (file)
@@ -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