php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #41795 checkdnsrr does not support DNS_TXT type
Submitted: 2007-06-25 08:59 UTC Modified: 2007-06-26 11:05 UTC
From: lucas at facebook dot com Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 5CVS-2007-06-25 (CVS) OS: fedora fc5
Private report: No CVE-ID: None
 [2007-06-25 08:59 UTC] lucas at facebook dot com
Description:
------------
Although you can use dns_get_record to get the contents of the TXT record you cannot use checkdnsrr or dns_check_record to see if the record exists. This could be useful for checking against a DNSBL


Reproduce code:
---------------
checkdnsrr('1.1.168.192.my.abusebl.net', "TXT");

Expected result:
----------------
E_WARNING: checkdnsrr(): Type 'TXT' not supported


Actual result:
--------------
1

The following patch enables the TXT_TYPE:

Index: dns.c
===================================================================
RCS file: /repository/php-src/ext/standard/dns.c,v
retrieving revision 1.70.2.7.2.4
diff -u -r1.70.2.7.2.4 dns.c
--- dns.c 14 May 2007 11:33:34 -0000  1.70.2.7.2.4
+++ dns.c 25 Jun 2007 08:52:59 -0000
@@ -290,6 +290,7 @@
      else if (!strcasecmp("ANY",   Z_STRVAL_PP(arg2))) type = DNS_T_ANY;
      else if (!strcasecmp("SOA",   Z_STRVAL_PP(arg2))) type = DNS_T_SOA;
      else if (!strcasecmp("CNAME", Z_STRVAL_PP(arg2))) type = DNS_T_CNAME;
+     else if (!strcasecmp("TXT",   Z_STRVAL_PP(arg2))) type = DNS_T_TXT;
      else if (!strcasecmp("AAAA",  Z_STRVAL_PP(arg2))) type = DNS_T_AAAA;
      else if (!strcasecmp("SRV",   Z_STRVAL_PP(arg2))) type = DNS_T_SRV;
      else if (!strcasecmp("NAPTR", Z_STRVAL_PP(arg2))) type = DNS_T_NAPTR;

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-06-25 09:00 UTC] lucas at facebook dot com
Sorry, swapped expected and actual result :)
 [2007-06-26 11:05 UTC] tony2001@php.net
This bug has been fixed in CVS.

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/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 08:01:29 2024 UTC