From owner-freebsd-questions Thu Mar 11 15:18:57 1999 Delivered-To: freebsd-questions@freebsd.org Received: from ccsales.com (ccsales.com [216.0.22.30]) by hub.freebsd.org (Postfix) with ESMTP id 48BBA152FA for ; Thu, 11 Mar 1999 15:18:04 -0800 (PST) (envelope-from randyk@ccsales.com) Received: (from randyk@localhost) by ccsales.com (8.9.1/8.9.0) id PAA06140; Thu, 11 Mar 1999 15:18:36 -0800 (PST) Message-ID: <19990311151836.13691@ccsales.com> Date: Thu, 11 Mar 1999 15:18:36 -0800 From: randyk To: questions@freebsd.org Cc: randyk@ccsales.com Subject: A Perl/Socket question Reply-To: randyk@ccsales.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.89i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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