Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.3.7

Bug #16383 getDetails() returns no results if 1 result
Submitted: 2009-06-26 23:48 UTC
From: scottp Assigned: nohn
Status: Closed Package: Net_DNSBL (version 1.3.3)
PHP Version: 5.2.5 OS: 2.6.28 (Ubuntu 9.04)
Roadmaps: 1.3.4    
Subscription  


 [2009-06-26 23:48 UTC] scottp (Scott Prive)
Description: ------------ getDetails can return no results/listings, when the dnsbl object's public variables clearly show there are listings. In my testing this seems to happen when querying multiple RBLs and that IP is not listed on all of them. If the IP is listed on all RBLs I get all results back from getDetails(). Not 100% sure but it seems to happen if the checked IP is only on 1 RBL and that RBL is Barracuda's. scott@int:~$ uname -a Linux int.scott.tzo.com 2.6.28-12-generic #43-Ubuntu SMP Fri May 1 19:27:06 UTC 2009 i686 GNU/Linux scott@int:~$ php --version PHP 5.2.6-3ubuntu4.1 with Suhosin-Patch 0.9.6.2 (cli) (built: Apr 23 2009 14:35:05) Test script: --------------- <?php require_once 'Net/DNSBL.php'; function get_dnsbl_array2($ip) { $dnsbl = new Net_DNSBL(); $rbls = array('bl.spamcop.net','b.barracudacentral.org'); $dnsbl->setBlacklists($rbls); if ($dnsbl->isListed($ip, TRUE)) { echo "\n IS LISTED \nThe object contains:" . print_r($dnsbl,TRUE)." [end object] (END)\n"; $result['details'] = $dnsbl->getDetails($ip); } return $result; } #happens if IP is on one blacklist only? echo "RESULT: " . print_r(get_dnsbl_array2("82.217.205.25"),TRUE); #echo "RESULT: " . print_r(get_dnsbl_array2("125.110.99.250"),TRUE); #echo "RESULT: " . print_r(get_dnsbl_array2("77.104.239.1"),TRUE); ?> Expected result: ---------------- Expecting getDetails() to be the same data (all data) from $dnsbl['results']. Actual result: -------------- IS LISTED The object contains:Net_DNSBL Object ( [blacklists] => Array ( [0] => bl.spamcop.net [1] => b.barracudacentral.org ) [results] => Array ( [82.217.205.25] => Array ( [b.barracudacentral.org] => Array ( [record] => Array ( [0] => 127.0.0.2 ) [txt] => Array ( [0] => http://www.barracudanetworks.com/reputation/?pr=1&ip=82.217.205.25 ) ) ) ) ) [end object] (END) RESULT: Array ( [details] => )

Comments

 [2009-06-27 00:13 UTC] scottp (Scott Prive)
If I change line 11 from: $result['details'] = $dnsbl->getDetails($ip); to: $result['details'] = $dnsbl->results; I get the expected results set. That is to say, I alternated between the above two line 11's, and getDetails would return nothing, but $dnsbl->$results returned correct.
 [2009-06-27 15:40 UTC] nohn (Sebastian Nohn)
-Status: Open +Status: Feedback
Sorry, I can't reproduce that. Please provide a test case that shows clearly what fails in which condition and what is your expected result in that condition. With your example, I get [exec] array(2) { [exec] ["bl.spamcop.net"]=> [exec] array(2) { [exec] ["record"]=> [exec] array(1) { [exec] [0]=> [exec] string(9) "127.0.0.2" [exec] } [exec] ["txt"]=> [exec] array(1) { [exec] [0]=> [exec] string(59) "Blocked - see http://www.spamcop.net/bl.shtml?82.217.205.25" [exec] } [exec] } [exec] ["b.barracudacentral.org"]=> [exec] array(2) { [exec] ["record"]=> [exec] array(1) { [exec] [0]=> [exec] string(9) "127.0.0.2" [exec] } [exec] ["txt"]=> [exec] array(1) { [exec] [0]=> [exec] string(66) "http://www.barracudanetworks.com/reputation/?pr=1&ip=82.217.205.25" [exec] } [exec] } [exec] } Which is what I would expect.
 [2009-06-27 15:41 UTC] nohn (Sebastian Nohn)
-Assigned To: +Assigned To: nohn
 [2009-07-02 08:46 UTC] scottp (Scott Prive)
OK, here's the thing.. you had 2 results/RBL hits in there, so you got both back from getDetails. If you can confirm the IP is listed on one of these RBLs - not both - you will see it hopefully. Please note my 'host' pre-flight test, before I run the PHP script. This shows the IP was on Barracudda and not on Spamcop. If by the time you try this you find the IP is re-listed on SpamCop, do not bother running the test. Try one of the other IPs (test them manually first). If all 3 suffer dual-blacklisting, I can try to scrounge up some other IPs from some RBL's database (hit or miss until I find one listed on just 'one' RBL). If you have a safe way to inject the data as my object dump shows, that may be a lot easier to reproduce. My results, same code: scott@scott-laptop:~$ host 25.205.217.82.bl.spamcop.net Host 25.205.217.82.bl.spamcop.net not found: 3(NXDOMAIN) scott@scott-laptop:~$ host 25.205.217.82.b.barracudacentral.org 25.205.217.82.b.barracudacentral.org has address 127.0.0.2 scott@scott-laptop:~$ php ./test-dnsbl.php IS LISTED The object contains:Net_DNSBL Object ( [blacklists] => Array ( [0] => bl.spamcop.net [1] => b.barracudacentral.org ) [results] => Array ( [82.217.205.25] => Array ( [b.barracudacentral.org] => Array ( [record] => Array ( [0] => 127.0.0.2 ) [txt] => Array ( [0] => http://www.barracudanetworks.com/reputation/?pr=1&ip=82.217.205.25 ) ) ) ) ) [end object] (END) RESULT: Array ( [details] => <=== getDetails() showing nothing )
 [2009-07-26 15:08 UTC] nohn (Sebastian Nohn)
-Status: Feedback +Status: Open
 [2009-08-02 17:32 UTC] nohn (Sebastian Nohn)
-Status: Assigned +Status: Closed -Roadmap Versions: +Roadmap Versions: 1.3.4
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.