[PEAR-BUG] Bug #18660 [Opn]: Dynamic Updates produce broken requests

[email protected]
Newsgroups php.pear.bugs
Message-ID <[email protected]>
Edit report at http://pear.php.net/bugs/bug.php?id=18660&edit=1

 ID:               18660
 Updated by:       [email protected]
 Reported By:      alex at net-me dot net
 Summary:          Dynamic Updates produce broken requests
 Status:           Open
 Type:             Bug
 Package:          Net_DNS2
 Operating System: Ubuntu 11.04
 Package Version:  1.1.3
 PHP Version:      5.3.6
 Roadmap Versions: 
 New Comment:

Thanks for bringing this up Alexander,

I've been looking into it, and it looks like there is for sure an issue
with building the 
compressed dns names- something wrong with the compress() method.

In the mean time, as a work around, if you call update() once per RR, it
should 
work fine, as the compressed array() is reset on each update().

I'll post more once I have it resolved.

Mike


Previous Comments:
------------------------------------------------------------------------

[2011-07-12 13:38:20] sandman4

Description:
------------
Broken UDP requests produced when trying to perform dynamic update. 

So far it happened to me only when request contains 2 or more MX RRs.

Tested with latest BIND9.7.3

For me it's 100% reproducible with the attached script. See the produced
zone file 
(after 
"rndc freeze") and BIND log.

With different data in update it produces requests broken in different
ways, some result 
in 
exception: "NSupdate [30]: Failed to update alex.net-me.net, error <DNS
request failed: 
The 
name server was unable to interpret the query.>."

THANK YOU for this cool module,
Alexander Gurvitz

PHP version is actually PHP 5.3.5-1ubuntu7.2 with Suhosin-Patch (cli)
(built: May  2 
2011 
23:18:30) 


Test script:
---------------
#!/usr/bin/php
<?php

require_once "Net/DNS2.php";

$u = new Net_DNS2_Updater("testzone", array('nameservers' =>
array('127.0.0.1')));
$r = Net_DNS2_RR::fromString("test1.testzone MX 1 test.com");
$u->add($r);
$r = Net_DNS2_RR::fromString("test2.testzone MX 1 test.com");
$u->add($r);
$u->update();

?>


Expected result:
----------------
test1			MX	1 test.com.
test2			MX	1 test.com.


Actual result:
--------------
ZONE FILE:

test1			MX	1 test.com.
test2			MX	1 
\000\000\001\000\000\000\002\000\000\008testzone\000\000\006\000\001\005test1\19
2\012\000\015\000\001\000\001Q\128\000\012.

BIND9 LOG:

12-Jul-2011 14:16:07.255 general: warning: zone testzone/IN:
test2.testzone/MX: 
\000\000\001\000\000\000\002\000\000\008testzone\000\000\006\000\001\005test1\19
2\012\000\015\000\001\000\001Q\128\000\012: bad name (check-names) 
12-Jul-2011 14:16:07.255 update: info: client 127.0.0.1#53616: updating
zone 
'testzone/IN': adding an RR at 'test1.testzone' MX
12-Jul-2011 14:16:07.255 update: info: client 127.0.0.1#53616: updating
zone 
'testzone/IN': adding an RR at 'test2.testzone' MX

------------------------------------------------------------------------


-- 
Edit this bug report at http://pear.php.net/bugs/bug.php?id=18660&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.