Re: mandb wrapper scripts
On Tue, Feb 08, 2000 at 12:14:01PM +0200 , Fabrizio Polacco wrote:
> #!/bin/sh -e
> pgm=`basename $0`
> edir=/usr/lib/man-db
> cmd="${edir}/${pgm} ${1+$@}"
> usrsw=" -s /bin/sh nobody"
> su -s /bin/true 2>/dev/null || usrsw=" man"
> test -w /root && exec su ${usrsw} -c ${1+"$cmd"}
^^^^^^^^^^^^^
this is evil. If you have /root rwxrwxr-x and a user is in group root, then
this will end in something like
merlin% man ls
Password:
which is bad. the test should look like
test `id -u` -eq 0 && exec su ${usrsw} -c ${1+"$cmd"}
iff we really want this wrapper. I'm thinking about adding an alias into
profile. I've sent a bug report about this yesterday, but didn't recieved
confirmation yet.
Petr Cech
--
Debian GNU/Linux maintainer - www.debian.{org,cz}
cech@atrey.karlin.mff.cuni.cz
Reply to: