bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: Unpriviledged DESTDIR install of su


From: Bernd Jendrissek
Subject: Re: Unpriviledged DESTDIR install of su
Date: Wed, 30 Oct 2002 12:10:31 +0200

On Tue, Oct 29, 2002 at 02:07:02PM -0500, Paul Jarc wrote:
> Bernd Jendrissek <address@hidden> wrote:
> > --- coreutils-4.5.3/src/Makefile.am     Fri Oct 25 20:58:45 2002
> > +++ coreutils-4.5.3/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)
> 
> I don't think it should be made setuid if chown fails.

Right, of course.  And then maybe change the use of $INSTALL_SU to
$INSTALL_SU || true, so that "make install" doesn't fail?  Not sure if
that's necessary though.

How would we do this right?  Maybe like this:

--- coreutils-4.5.3/src/Makefile.am     Fri Oct 25 20:58:45 2002
+++ coreutils-4.5.3/src/Makefile.am.orig        Sun Sep 22 00:40:35 2002
@@ -95,6 +95,4 @@
   echo " $(INSTALL_PROGRAM) $$p $(installed_su)"; \
   $(INSTALL_PROGRAM) $$p $(installed_su); \
+  echo " chown root $(installed_su) && chmod $(setuid_root_mode) 
$(installed_su)"; \
-  echo " chown root $(installed_su)"; \
+  chown root $(installed_su) && chmod $(setuid_root_mode) $(installed_su) || 
true
-  chown root $(installed_su); \
-  echo " chmod $(setuid_root_mode) $(installed_su)"; \
-  chmod $(setuid_root_mode) $(installed_su)

Hmm, that seems to work.

bernd




reply via email to

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