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

sh and file permissions



1) I started to write a sh script for a couple of things i would like to
automate, and i've discovered a strange thing. a command like

host www.foo.bar | sed -e "s/.*\ \([0-9\.]*\)$/\1/"

works perfectly in linux, but does not give the desired result in
openbsd. however if i do:

xx=host www.foo.bar
echo $xx | sed -e "s/.*\ \([0-9\.]*\)$/\1/"`

it works perfectly (i can use the backtick too, but I don't know how to
write a backtick under windows ;)

that seems really strange to me, and i wonder if someone has an answer...

2) I got my first "daily insecurity" mail and it had a long list with a
lot of files with the setuid/setgid bit set, e.g.

Checking setuid/setgid files and devices:
Setuid additions:
[...]
-r-sr-xr-x  1  root    bin   [...] /sbin/ping

I've always known that setuid/setgid bits are dangerous and should be
used only when really necessary, so why ping should be setuid root?!?!
I really can't understand that... I've used just linux until now, and
this is my first experience with a *bsd unix, so this maybe due to the
way bsd works, but that really seems strange to me... what's the need to
give ping root privileges?

well... this can even be a list of files that should have that bit
removed, but the afterboot manpage talks only about the
"Checking special files and directories." list. I don't know what's the
purpose of the prior list...

-- 

    Shiva

  "Better true to yourself
Than a perfect shadow
       Of somebody else
     An empty shell"

(MrBig, My new religion)


Visit your host, monkey.org