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

RE: Man gets to be su?



> is your man package fully up to date?  (ie version 2.3.10-71) 
> 
> your /usr/bin/man should look like this:
> 
> [eb@plato eb]$ cat `which man`
> #!/bin/sh -e
> pgm=`basename $0`
> edir=/usr/lib/man-db
> 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"
> [eb@plato eb]$
> 
> if it does, then there is something still wrong with this wrapper
> script, but i don't see what it is... (this script avoids man being
> run as root in response to a security concern)

No, I have:
---
eof@burrken:~$ cat `which man`
#!/bin/sh -e
pgm=`basename $0`
edir=/usr/lib/man-db
cmd="${edir}/${pgm} ${1+$@}"
test -w /root && exec su nobody -c ${1+"$cmd"}
exec ${cmd}
---

Does that mean that an empty manpage would get empty su??  (I'm not that
good at bash-scripting)

Regards, EOF


Reply to: