[Top][All Lists]

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

Re: Optimization for install-sh

From: Pavel Roskin
Subject: Re: Optimization for install-sh
Date: Thu, 9 Nov 2000 15:32:31 -0500 (EST)

Hello, Alexandre!

> > : + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else :;fi &&
> > Shouldn't all these be rewritten as "if test ...;" instead?

Better portability of "test" compared to "[" is probably one of the "urban
legends". Whenever "[" is not allowed on the filesystem the shell has the
"[" builtin.

I would feel better with "test" too, but only after adding tests for
install-sh into the Autoconf testuite.

> Or, even better (IMHO):
> { test "x$...cmd" = x || $doit $...cmd $arg ; }

That's not quite the same. If the command (e.g. strip) is not defined we
don't want to ignore the consequtive commands. But if it fails we do want
to bail out, since running "chmod 4755 foo" after failed "chown r00t foo"
would be _very_ bad.

By the way, if any "strip" can change the owner of the file (which is not
unlikely, although it doesn't happen with GNU Binutils) we have a security
hole in install-sh.

Pavel Roskin

reply via email to

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