#23161 [Opn->Csd]: Net_Portscan::checkPort doesn't close socket
| From: | mj@php.net | Date: | Tue, 22 Apr 2003 12:16:06 +0000 |
| Subject: | #23161 [Opn->Csd]: Net_Portscan::checkPort doesn't close socket | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-15321@lists.php.net to get a copy of this message | ||
ID: 23161
Updated by: mj@php.net
Reported By: hasegawa at neo dot nectec dot or dot th
-Status: Open
+Status: Closed
Bug Type: PEAR related
Operating System: W2K
PHP Version: 4.3.0
New Comment:
This bug has been fixed. You can grab the latest version (1.0.2) at
http://pear.php.net/Net_Portscan.
Previous Comments:
------------------------------------------------------------------------
[2003-04-11 03:56:45] hasegawa at neo dot nectec dot or dot th
Followings are the source code of Net_Portscan::checkPort.
[[Copy from
http://cvs.php.net/co.php/pear/Net_Portscan/Portscan.php?login=2&r=1.3]]
------------------
function checkPort($host, $port, $timeout = 30)
$socket = @fsockopen($host, $port, $errorNumber, $errorString,
$timeout);
if (!$socket) {
return NET_PORTSCAN_NO_SERVICE;
}
return NET_PORTSCAN_SERVICE_FOUND;
}
------------------
When fsockopen successfuly connect the host/port, it returns resource
for socket. But above code doesn't close socket.
When fsockopen returns resource of socket, the socket should be closed
with fclose function.
//Hasegawa
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=23161&edit=1