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

Re: mandb wrapper scripts

On Tue, Feb 08, 2000 at 03:45:03AM -0900, Ethan Benson wrote:

> sorry but I have to add one more patch ;-) if we use man with no
> arguments we get su usage that would probably trigger a `wtf' fix
> below:

bleah /me screwed up this time the real fix is this:

#!/bin/sh -e
pgm=`basename $0`
cmd="${edir}/${pgm} ${1+$@}"
[ `id -u` = 0 ] || exec "${cmd}"
su nobody -c "/bin/true" && exec su nobody -c "$cmd"
su -s /bin/true 2>/dev/null && exec su -s /bin/sh nobody -c "$cmd"
exec su man -c "$cmd"

you want just quoted "$cmd" not all the stuff adding arguments since
that is done earlier.

Ethan Benson

Reply to: