Bug #80077 [Asn->Csd]: getmxrr test bug
| From: | nikic@php.net | Date: | Tue, 08 Sep 2020 08:01:43 +0000 |
| Subject: | Bug #80077 [Asn->Csd]: getmxrr test bug | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-228938@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=80077&edit=1
ID: 80077
Updated by: nikic@php.net
Reported by: rainer dot jung at kippdata dot de
Summary: getmxrr test bug
-Status: Assigned
+Status: Closed
Type: Bug
Package: *Network Functions
Operating System: Any
PHP Version: 7.4.10
Assigned To: nikic
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of nikita.ppv@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=07cb665515190be8319e77fa86d8f338c04e2c6b
Log: Fixed bug #80077
Previous Comments:
------------------------------------------------------------------------
[2020-09-08 07:54:30] rainer dot jung at kippdata dot de
Description:
------------
Test file ext/standard/tests/network/getmxrr.phpt was improved recently to also contain negative
tests. See
https://github.com/php/php-src/commit/a06eed0c0ec03bdbb0f97aede393b5c687041d88
for the change in the main branch.
The domain names passed to getmxrr() do not contain a trailing dot. DNS lookups which do not find
records will (depending on the local resolver config) try again by adding the local domain to the
end of the searched host/domain. In many environments there's an mx record for any subdomain of
the local domain and the MX query will return a hit. But the test expects no hit. So the test fails
when checking that "qa.php.net" does not have an MX record in DNS. In our local
environment the resolver falls back to also check qa.php.net.kippdata.de which does have an MX
record. Using "qa.php.net." instead of "qa.php.net" should fix this for
everyone.
Suggested trivial change for test improvement:
--- ext/standard/tests/network/getmxrr.phpt 2020-09-01 11:45:05.000000000 +0000
+++ ext/standard/tests/network/getmxrr.phpt 2020-09-08 09:51:14.436750929 +0000
@@ -11,9 +11,9 @@
--FILE--
<?php
$domains = array(
- 'mx1.tests.php.net',
- 'mx2.tests.php.net',
- 'qa.php.net',
+ 'mx1.tests.php.net.',
+ 'mx2.tests.php.net.',
+ 'qa.php.net.',
);
foreach ($domains as $domain) {
$result = getmxrr($domain, $hosts, $weights);
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=80077&edit=1