php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24491 Net_ping Operation not permitted
Submitted: 2003-07-03 22:37 UTC Modified: 2003-07-06 12:10 UTC
From: ad1 at poorman dot org Assigned:
Status: Closed Package: PEAR related
PHP Version: 4.3.1 OS: FreeBSD 4.8Rc1
Private report: No CVE-ID: None
 [2003-07-03 22:37 UTC] ad1 at poorman dot org
Description:
------------
PEAR/Net_Ping don't implement right argument.

<?php
require_once 'Net/Ping.php' ;
$ping = new Net_Ping;
var_dump($ping->ping("168.95.1.1"));
?>
when I run in FreeBSD 4.8. user ROOT it return 
"
ping: illegal option -- w
usage: ping [-AQRadfnqrv] [-c count] [-i wait] [-l preload] [-m ttl]
            [-p pattern] [-P policy] [-s packetsize] [-S src_addr] [-t timeout]
            [host | [-L] [-I iface] [-T ttl] mcast-group]
string(14) "HOST_NOT_FOUND"
"

when I run use user account , it return
"
ping: -s flag: Operation not permitted
string(14) "HOST_NOT_FOUND"
"


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-07-04 21:50 UTC] ohill@php.net
This seems to be a problem with the ping utility that comes with FreeBSD.

This ping requires a different set of arguments. The -w option is replaced by a -t one for defining a "timeout" to wait.

As for the permissions, FreeBSD seems to prohibit a custom packet size from normal users. A quick fix would be to replace this line:

$cmd = $this->ping_path." $q -c $counts -s $packet_size -w $maxwait $host";

With this one in the package:

$cmd = $this->ping_path." $q -c $counts -t $maxwait $host";

Note that this will work only while using FreeBSD!

Oliver
 [2003-07-06 12:10 UTC] ohill@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.

The correct OS detection is now present in the CVS version.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Dec 01 01:03:34 2021 UTC