Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Mar 1999 15:18:36 -0800
From:      randyk <randyk@ccsales.com>
To:        questions@freebsd.org
Cc:        randyk@ccsales.com
Subject:   A Perl/Socket question
Message-ID:  <19990311151836.13691@ccsales.com>

next in thread | raw e-mail | index | archive | help
Hi,

I'm a little confused:

What makes this HAVE TO run as root?

        $self->{"proto_num"} = (getprotobyname('icmp'))[2] ||
                    croak("Can't get icmp protocol by name");
        $self->{"pid"} = $$ & 0xffff;           # Save lower 16 bits of pid
        $self->{"fh"} = FileHandle->new();
        socket($self->{"fh"}, &PF_INET(), &SOCK_RAW(), $self->{"proto_num"}) ||
            croak("icmp socket error - $!");

This is called from Ping.pm in the Net::Ping module which obviously makes a call to
the Socket.pm module and I've looked in there and do not understand why this returns
an "Operation not permitted Ping icmp" when not run by superuser (root).

It seems to use the same call as ping does...and I need to move the restriction from the other
user...or code an exception...so my web based utility will work with it...

Thank you,
Randy Katz


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990311151836.13691>