From owner-freebsd-questions Fri Mar 12 11:15: 0 1999 Delivered-To: freebsd-questions@freebsd.org Received: from sonic.digital-web.net (sonic.digital-web.net [216.65.27.2]) by hub.freebsd.org (Postfix) with ESMTP id EC30314E6F for ; Fri, 12 Mar 1999 11:14:58 -0800 (PST) (envelope-from joseph@randomnetworks.com) Received: from localhost (jmscott@localhost) by sonic.digital-web.net (8.9.3/8.9.3) with ESMTP id OAA08427; Fri, 12 Mar 1999 14:11:12 -0500 (EST) Date: Fri, 12 Mar 1999 14:11:11 -0500 (EST) From: Joseph Scott X-Sender: jmscott@sonic.digital-web.net Reply-To: Joseph Scott To: randyk Cc: questions@FreeBSD.ORG Subject: Re: A Perl/Socket question In-Reply-To: <19990311151836.13691@ccsales.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, 11 Mar 1999, randyk wrote: > Hi, Howdy. > I'm a little confused: Well with any luck it won't last for long :-) > > 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 - $!"); Right off the top of my head I would say that it has to run as root because of it's use of icmp. > > 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). I haven't played with this specifically, but ok. > > 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... Take a look a the ping program on your freebsd box : prompt>which ping /sbin/ping prompt>ls -lga /sbin/ping -r-sr-xr-x 1 root wheel 144376 Feb 15 02:43 /sbin/ping ^ The sbit set to run as root no matter which user is actually running the program. > > Thank you, > Randy Katz You may be able to get more info from a perl specific group. Joseph Scott joseph@randomnetworks.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message