Directory ApacheDS
  1. Directory ApacheDS
  2. DIRSERVER-1093

the ResourceRecordEncoder and QuestionRecordEncoder have bug for empty domainName:(

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.1
    • Fix Version/s: 2.0.0-M7
    • Component/s: dns
    • Labels:
      None
    • Environment:
      Windows XP , apacheds-protocol-dns-1.5.1.jar

      Description

      When I use dig trace for Test the apache dns server. the QuestionRecord and ResourceRecord not encoded right for the empty Domain Name.

      my Test command is:

      E:\bind>dig @10.108.20.126 618119.com +trace

      Then found this bug is caeused by the method "encodeDomainName" in QuestionRecordEncoder.java and "putDomainName" in ResourceRecordEncoder.java.

      follow code can be test to get "labels.length == 1";

      [code]
      String s = "";
      String[] labels = new String[0];
      labels = s.split("
      .");
      System.out.println("labels.length == " + labels.length);
      [/code]

      so i fix this bug by follow change :

      [code]
      String[] labels = domainName.split( "
      ." );
      [/code]

      change to:

      [code]
      String[] labels = new String[0];
      if (domainName != null && domainName.length() > 0)

      { labels = domainName.split("\\."); }

      [/code]

      Please fix the bug

      1. correct4trace.jpg
        173 kB
        lizongbo
      2. error4trace.jpg
        182 kB
        lizongbo
      3. testcommand.jpg
        86 kB
        lizongbo

        Activity

        Hide
        Emmanuel Lecharny added a comment -

        Applied the suggested corrections with http://svn.apache.org/viewvc?rev=1294444&view=rev

        Show
        Emmanuel Lecharny added a comment - Applied the suggested corrections with http://svn.apache.org/viewvc?rev=1294444&view=rev
        Hide
        Kiran Ayyagari added a comment -

        Bulk change on these DNS issues didn't work, editing again to set the fix version to 2.0

        Show
        Kiran Ayyagari added a comment - Bulk change on these DNS issues didn't work, editing again to set the fix version to 2.0
        Hide
        Kiran Ayyagari added a comment -

        Moving to 2.0, currently DNS server is not activated

        Show
        Kiran Ayyagari added a comment - Moving to 2.0, currently DNS server is not activated
        Hide
        Emmanuel Lecharny added a comment -

        Moved back to 2.0.0-RC1

        Show
        Emmanuel Lecharny added a comment - Moved back to 2.0.0-RC1
        Hide
        Alex Karasulu added a comment -

        postponed until 2.0 if someone steps up on this.

        Show
        Alex Karasulu added a comment - postponed until 2.0 if someone steps up on this.
        Hide
        Emmanuel Lecharny added a comment -

        Postponed

        Show
        Emmanuel Lecharny added a comment - Postponed
        Hide
        lizongbo added a comment -

        correct dns msg

        Show
        lizongbo added a comment - correct dns msg
        Hide
        lizongbo added a comment -

        error msg

        Show
        lizongbo added a comment - error msg
        Hide
        lizongbo added a comment -

        The test Comman

        Show
        lizongbo added a comment - The test Comman

          People

          • Assignee:
            Enrique Rodriguez
            Reporter:
            lizongbo
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development