[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/standard/dns_win32.c trunk/ext/standard/dns_win32.c
pajoye Mon, 06 Sep 2010 10:57:42 + Revision: http://svn.php.net/viewvc?view=revision&revision=303069 Log: - fix bug #52260, catch all DNS not found error Bug: http://bugs.php.net/52260 (Assigned) Windows implementation of dns_get_record fails with non-existing domain Changed paths: U php/php-src/branches/PHP_5_3/NEWS U php/php-src/branches/PHP_5_3/ext/standard/dns_win32.c U php/php-src/trunk/ext/standard/dns_win32.c Modified: php/php-src/branches/PHP_5_3/NEWS === --- php/php-src/branches/PHP_5_3/NEWS 2010-09-06 10:39:26 UTC (rev 303068) +++ php/php-src/branches/PHP_5_3/NEWS 2010-09-06 10:57:42 UTC (rev 303069) @@ -67,6 +67,8 @@ - Fixed bug #50590 (IntlDateFormatter::parse result is limited to the integer range). (Stas) - Fixed bug #50481 (Storing many SPLFixedArray in an array crashes). (Felipe) +- Fixed bug #52260 (dns_get_record fails with non-existing domain on Windows). + (a_jelly_doughnut at phpbb dot com, Pierre) 22 Jul 2010, PHP 5.3.3 - Upgraded bundled sqlite to version 3.6.23.1. (Ilia) Modified: php/php-src/branches/PHP_5_3/ext/standard/dns_win32.c === --- php/php-src/branches/PHP_5_3/ext/standard/dns_win32.c 2010-09-06 10:39:26 UTC (rev 303068) +++ php/php-src/branches/PHP_5_3/ext/standard/dns_win32.c 2010-09-06 10:57:42 UTC (rev 303069) @@ -418,7 +418,7 @@ status = DnsQuery_A(hostname, type_to_fetch, DNS_QUERY_STANDARD, NULL, &pResult, NULL); if (status) { - if (status == DNS_INFO_NO_RECORDS) { + if (status == DNS_INFO_NO_RECORDS || status == DNS_ERROR_RCODE_NAME_ERROR) { continue; } else { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Dns Query failed"); Modified: php/php-src/trunk/ext/standard/dns_win32.c === --- php/php-src/trunk/ext/standard/dns_win32.c 2010-09-06 10:39:26 UTC (rev 303068) +++ php/php-src/trunk/ext/standard/dns_win32.c 2010-09-06 10:57:42 UTC (rev 303069) @@ -420,7 +420,7 @@ status = DnsQuery_A(hostname, type_to_fetch, DNS_QUERY_STANDARD, NULL, &pResult, NULL); if (status) { - if (status == DNS_INFO_NO_RECORDS) { + if (status == DNS_INFO_NO_RECORDS || status == DNS_ERROR_RCODE_NAME_ERROR) { continue; } else { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Dns Query failed"); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/standard/dns_win32.c trunk/ext/standard/dns_win32.c
pajoye Thu, 17 Jun 2010 09:26:29 + Revision: http://svn.php.net/viewvc?view=revision&revision=300510 Log: - Fix bug #52101, dns_get_record()garbage in 'ipv6' field Bug: http://bugs.php.net/52101 (error getting bug information) Changed paths: U php/php-src/branches/PHP_5_3/NEWS U php/php-src/branches/PHP_5_3/ext/standard/dns_win32.c U php/php-src/trunk/ext/standard/dns_win32.c Modified: php/php-src/branches/PHP_5_3/NEWS === --- php/php-src/branches/PHP_5_3/NEWS 2010-06-17 09:11:26 UTC (rev 300509) +++ php/php-src/branches/PHP_5_3/NEWS 2010-06-17 09:26:29 UTC (rev 300510) @@ -74,6 +74,8 @@ requests (Fixes CVE-2010-0397, bug #51288). (Raphael Geissert) - Fixed 64-bit integer overflow in mhash_keygen_s2k(). (Clément LECIGNE, Stas) +- Fixed bug #52101 (dns_get_record() garbage in 'ipv6' field on Windows). + (Pierre) - Fixed bug #52082 (character_set_client & character_set_connection reset after mysqli_change_user()). (Andrey) - Fixed bug #52043 (GD doesn't recognize latest libJPEG versions). Modified: php/php-src/branches/PHP_5_3/ext/standard/dns_win32.c === --- php/php-src/branches/PHP_5_3/ext/standard/dns_win32.c 2010-06-17 09:11:26 UTC (rev 300509) +++ php/php-src/branches/PHP_5_3/ext/standard/dns_win32.c 2010-06-17 09:26:29 UTC (rev 300510) @@ -274,6 +274,12 @@ } } + if (have_v6_break && in_v6_break) { + tp[0] = ':'; + tp++; + } + tp[0] = '\0'; + add_assoc_string(*subarray, "type", "", 1); add_assoc_string(*subarray, "ipv6", buf, 1); } Modified: php/php-src/trunk/ext/standard/dns_win32.c === --- php/php-src/trunk/ext/standard/dns_win32.c 2010-06-17 09:11:26 UTC (rev 300509) +++ php/php-src/trunk/ext/standard/dns_win32.c 2010-06-17 09:26:29 UTC (rev 300510) @@ -276,6 +276,12 @@ } } + if (have_v6_break && in_v6_break) { + tp[0] = ':'; + tp++; + } + tp[0] = '\0'; + add_assoc_string(*subarray, "type", "", 1); add_assoc_string(*subarray, "ipv6", buf, 1); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/standard/dns_win32.c trunk/ext/standard/dns_win32.c
pajoye Mon, 10 Aug 2009 08:05:11 + Revision: http://svn.php.net/viewvc?view=revision&revision=286990 Log: - fix and improve dns' support on windows Changed paths: U php/php-src/branches/PHP_5_3/NEWS U php/php-src/branches/PHP_5_3/ext/standard/dns_win32.c U php/php-src/trunk/ext/standard/dns_win32.c Modified: php/php-src/branches/PHP_5_3/NEWS === --- php/php-src/branches/PHP_5_3/NEWS 2009-08-10 07:23:14 UTC (rev 286989) +++ php/php-src/branches/PHP_5_3/NEWS 2009-08-10 08:05:11 UTC (rev 286990) @@ -1,6 +1,9 @@ PHPNEWS ||| ?? ??? 2009, PHP 5.3.1 +- Improve dns_get_record support on windows. Always available when IPv6 is + support is installed, format is now the same than on unix. (Pierre) + - Fixed spl_autoload_unregister/spl_autoload_functions wrt. Closures and Functors. (Christian Seiler) - Fixed open_basedir circumvention for mail.log. (Maksymilian Arciemowicz, Modified: php/php-src/branches/PHP_5_3/ext/standard/dns_win32.c === --- php/php-src/branches/PHP_5_3/ext/standard/dns_win32.c 2009-08-10 07:23:14 UTC (rev 286989) +++ php/php-src/branches/PHP_5_3/ext/standard/dns_win32.c 2009-08-10 08:05:11 UTC (rev 286990) @@ -132,7 +132,6 @@ } /* }}} */ -#if 1 /* {{{ php_parserr */ static void php_parserr(PDNS_RECORD pRec, int type_to_fetch, int store, zval **subarray) { @@ -237,20 +236,51 @@ } break; - case DNS_TYPE_: -#if _WIN32_WINNT >= 0x0600 { - LPSTR str[MAXHOSTNAMELEN]; DNS__DATA *data_ = &pRec->Data.; + char buf[sizeof(":::::::")]; + char *tp = buf; + int i; + unsigned short out[8]; + int have_v6_break = 0, in_v6_break = 0; + + for (i = 0; i < 4; ++i) { + DWORD chunk = data_->Ip6Address.IP6Dword[i]; + out[i * 2] = htons(LOWORD(chunk)); + out[i * 2 + 1] = htons(HIWORD(chunk)); + } + + for(i=0; i < 8; i++) { + if (out[i] != 0) { + if (tp > (u_char *)buf) { + in_v6_break = 0; + tp[0] = ':'; + tp++; + } + tp += sprintf((char*)tp,"%x", out[i]); + } else { + if (!have_v6_break) { + have_v6_break = 1; + in_v6_break = 1; + tp[0] = ':'; + tp++; + } else if (!in_v6_break) { + tp[0] = ':'; + tp++; + tp[0] = '0'; + tp++; + } + } + } + add_assoc_string(*subarray, "type", "", 1); - add_assoc_string(*subarray, "ipv6", RtlIpv6AddressToString(data_->Ip6Address, str), 1); + add_assoc_string(*subarray, "ipv6", buf, 1); } -#endif break; #if 0 - /* Not supported yet */ + /* Won't be implemented. A6 is deprecated. (Pierre) */ case DNS_TYPE_A6: break; #endif @@ -291,7 +321,6 @@ add_assoc_long(*subarray, "ttl", ttl); } /* }}} */ -#endif /* {{{ proto array|false dns_get_record(string hostname [, int type[, array authns, array addtl]]) Get any Resource Record corresponding to a given Internet host name */ Modified: php/php-src/trunk/ext/standard/dns_win32.c === --- php/php-src/trunk/ext/standard/dns_win32.c 2009-0
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/standard/dns_win32.c trunk/ext/standard/dns_win32.c
pajoye Fri, 07 Aug 2009 13:31:09 + Revision: http://svn.php.net/viewvc?view=revision&revision=286907 Log: - Fixed #49183, dns_get_record does not return NAPTR records Bug: http://bugs.php.net/49183 (Assigned) dns_get_record does not return NAPTR records when you query dot tel domains! Changed paths: U php/php-src/branches/PHP_5_3/NEWS U php/php-src/branches/PHP_5_3/ext/standard/dns_win32.c U php/php-src/trunk/ext/standard/dns_win32.c Modified: php/php-src/branches/PHP_5_3/NEWS === --- php/php-src/branches/PHP_5_3/NEWS 2009-08-07 09:48:57 UTC (rev 286906) +++ php/php-src/branches/PHP_5_3/NEWS 2009-08-07 13:31:09 UTC (rev 286907) @@ -8,6 +8,7 @@ - Fixed signature generation/validation for zip archives in ext/phar. (Greg) - Fixed memory leak in stream_is_local(). (Felipe, Tony) +- Fixed bug #49183 (dns_get_record does not return NAPTR records). (Pierre) - Fixed bug #49132 (posix_times returns false without error). (phpbugs at gunnu dot us) - Fixed bug #49125 (Error in dba_exists C code). (jdornan at stanford dot edu) Modified: php/php-src/branches/PHP_5_3/ext/standard/dns_win32.c === --- php/php-src/branches/PHP_5_3/ext/standard/dns_win32.c 2009-08-07 09:48:57 UTC (rev 286906) +++ php/php-src/branches/PHP_5_3/ext/standard/dns_win32.c 2009-08-07 13:31:09 UTC (rev 286907) @@ -269,7 +269,6 @@ case DNS_TYPE_NAPTR: { -#ifdef DNS_NAPTR_DATA DNS_NAPTR_DATA * data_naptr = &pRec->Data.Naptr; add_assoc_string(*subarray, "type", "NAPTR", 1); @@ -279,7 +278,6 @@ add_assoc_string(*subarray, "services", data_naptr->pService, 1); add_assoc_string(*subarray, "regex", data_naptr->pRegularExpression, 1); add_assoc_string(*subarray, "replacement", data_naptr->pReplacement, 1); -#endif } break; Modified: php/php-src/trunk/ext/standard/dns_win32.c === --- php/php-src/trunk/ext/standard/dns_win32.c 2009-08-07 09:48:57 UTC (rev 286906) +++ php/php-src/trunk/ext/standard/dns_win32.c 2009-08-07 13:31:09 UTC (rev 286907) @@ -269,7 +269,6 @@ case DNS_TYPE_NAPTR: { -#ifdef DNS_NAPTR_DATA DNS_NAPTR_DATA * data_naptr = &pRec->Data.Naptr; add_ascii_assoc_rt_string(*subarray, "type", "NAPTR", ZSTR_DUPLICATE); add_ascii_assoc_long(*subarray, "order", data_naptr->wOrder); @@ -278,7 +277,6 @@ add_ascii_assoc_rt_string(*subarray, "services", data_naptr->pService, ZSTR_DUPLICATE); add_ascii_assoc_rt_string(*subarray, "regex", data_naptr->pRegularExpression, ZSTR_DUPLICATE); add_ascii_assoc_rt_string(*subarray, "replacement", data_naptr->pReplacement, ZSTR_DUPLICATE); -#endif } break; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php