bug-fileutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Unpriviledged DESTDIR install of su


From: Bernd Jendrissek
Subject: Unpriviledged DESTDIR install of su
Date: Fri, 25 Oct 2002 21:08:21 +0200

Hello all

I just noticed that an sh-utils RPM I built didn't have su.  It appears
coreutils-4.5.2 would have the same problem.  I want to do staged installs
as an unpriviledged user.  (Downloading 4.5.3 now; ignore me if it's fixed.)

Here's a patch.

Watch out for the whitespace - I cut&pasted!

--- coreutils-4.5.2/src/Makefile.am     Fri Oct 25 20:58:45 2002
+++ coreutils-4.5.2/src/Makefile.am.orig        Sun Sep 22 00:40:35 2002
@@ -95,9 +95,9 @@
   echo " $(INSTALL_PROGRAM) $$p $(installed_su)"; \
   $(INSTALL_PROGRAM) $$p $(installed_su); \
   echo " chown root $(installed_su)"; \
-  chown root $(installed_su) || true; \
+  chown root $(installed_su); \
   echo " chmod $(setuid_root_mode) $(installed_su)"; \
-  chmod $(setuid_root_mode) $(installed_su) || true
+  chmod $(setuid_root_mode) $(installed_su)
 
 install-root: su
        @$(INSTALL_SU)
@@ -113,11 +113,12 @@
          && chmod $(setuid_root_mode) $$TMPFILE > /dev/null 2>&1 \
          && can_create_suid_root_executable=yes; \
        rm -f $$TMPFILE; \
-       if test $$can_create_suid_root_executable != yes; then \
-         echo "WARNING: insufficient access; su is not installed properly"; \
+       if test $$can_create_suid_root_executable = yes; then \
+         $(INSTALL_SU); \
+       else \
+         echo "WARNING: insufficient access; not installing su"; \
          echo "NOTE: to install su, run 'make install-root' as root"; \
-       fi; \
-       $(INSTALL_SU)
+       fi
 
 uninstall-local:
 # Remove su only if it's one we installed.

bernd




reply via email to

[Prev in Thread] Current Thread [Next in Thread]