From owner-freebsd-questions Fri Mar 12 6:24:43 1999 Delivered-To: freebsd-questions@freebsd.org Received: from torrent.hydro.on.ca (beck.Hydro.ON.CA [192.75.134.5]) by hub.freebsd.org (Postfix) with SMTP id C0F4814C29 for ; Fri, 12 Mar 1999 06:24:29 -0800 (PST) (envelope-from Jim.Service@oht.hydro.on.ca) Received: id JAA21420; Fri, 12 Mar 1999 09:25:23 -0500 Received: by gateway id JAA17437; Fri, 12 Mar 1999 09:20:03 -0500 (EST) Received: by gateway id JAA26925; Fri, 12 Mar 1999 09:20:01 -0500 Received: by gateway id ; Fri, 12 Mar 1999 09:20:52 -0500 Message-ID: From: SERVICE Jim -TS+NP DVLPMT To: "'randyk@ccsales.com'" Cc: questions@FreeBSD.ORG Subject: RE: A Perl/Socket question Date: Fri, 12 Mar 1999 09:20:41 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.1960.3) Content-Type: text/plain Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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