Date: Fri, 12 Mar 1999 09:20:41 -0500 From: SERVICE Jim -TS+NP DVLPMT <Jim.Service@oht.hydro.on.ca> To: "'randyk@ccsales.com'" <randyk@ccsales.com> Cc: questions@FreeBSD.ORG Subject: RE: A Perl/Socket question Message-ID: <ACFC07E2E0DAD111A55F00600894C8C752B605@KEX2.RD.Hydro.ON.CA>
next in thread | raw e-mail | index | archive | help
Mere mortals can't open socket port numbers < 1024. --Jim OHT Inc. mailto:jim.service@oht.hydro.on.ca > 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... 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?ACFC07E2E0DAD111A55F00600894C8C752B605>