On Sun, Apr 4, 2010 at 7:43 PM, Rick Ashton <expiation / devils.com> wrote:
> Hi
>
> From most documentation I see that $SAFE is automatically set to 1 if
> you run ruby as root.
>
> However, this causes pcap that I'm using not to function (it throwsecurityError).
>
> I need $SAFE=0 for pcap to function, however I also need to run it with
> root privileges for it to function, but as soon as setuid is used, $SAFE
> changes to 1.
>
> Is there a way to have the safety level be overridden to 0 with setuid
> active? Otherwise I don't see how a library like pcap can be used.

ruby -e 'p [Process.uid, $SAFE]'
[0, 0]

I don't see what's hindering you.

> Thanks

-- 
Michael Fellinger
CTO, The Rubyists, LLC