Bug 10742 - samba-tool dns add 172.31.9.161 s4xdom.base . NS mydns.org. => NO_MEMORY
Summary: samba-tool dns add 172.31.9.161 s4xdom.base . NS mydns.org. => NO_MEMORY
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: DNS server (internal) (show other bugs)
Version: 4.1.4
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks: 10077
  Show dependency treegraph
 
Reported: 2014-07-24 14:25 UTC by Stefan Metzmacher
Modified: 2014-09-01 19:20 UTC (History)
1 user (show)

See Also:


Attachments
Code fix (1.23 KB, patch)
2014-07-29 07:43 UTC, Amitay Isaacs
amitay: review? (metze)
Details
New test (2.90 KB, patch)
2014-07-29 07:43 UTC, Amitay Isaacs
amitay: review? (metze)
Details
Patches for v4-1-test (4.49 KB, patch)
2014-07-29 18:03 UTC, Stefan Metzmacher
amitay: review+
Details
Patches for v4-0-test (4.49 KB, patch)
2014-07-29 18:03 UTC, Stefan Metzmacher
amitay: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Metzmacher 2014-07-24 14:25:12 UTC
samba-tool dns add 172.31.9.161 s4xdom.base . NS mydns.org.
gives a no memory error, while
samba-tool dns add 172.31.9.161 s4xdom.base @ NS mydns.org.
works fine.

A Windows server allows both.

dns_split_node_name() return NULL for node_name == '.'
called from dnsserver_update_record()


        /* If node_name is @ or zone name, dns record is @ */
        if (strcmp(node_name, "@") == 0 || strcasecmp(node_name, z->name) == 0) {
                name = talloc_strdup(tmp_ctx, "@");
        } else {
                name = dns_split_node_name(tmp_ctx, node_name, z->name);
        }
        W_ERROR_HAVE_NO_MEMORY_AND_FREE(name, tmp_ctx);

Maybe we should have an additional strcmp(node_name, '.') == 0
for the name = talloc_strdup(tmp_ctx, "@") case.
Comment 1 Amitay Isaacs 2014-07-28 02:58:32 UTC
Yes, that's the correct fix.  I will add the patches for fix and new test.
Comment 2 Amitay Isaacs 2014-07-29 07:43:19 UTC
Created attachment 10155 [details]
Code fix
Comment 3 Amitay Isaacs 2014-07-29 07:43:49 UTC
Created attachment 10156 [details]
New test
Comment 4 Amitay Isaacs 2014-07-29 07:45:58 UTC
Added two patches -- code fix and new test.
Comment 5 Stefan Metzmacher 2014-07-29 18:03:26 UTC
Created attachment 10157 [details]
Patches for v4-1-test
Comment 6 Stefan Metzmacher 2014-07-29 18:03:48 UTC
Created attachment 10158 [details]
Patches for v4-0-test
Comment 7 Karolin Seeger 2014-08-03 18:46:19 UTC
Pushed to autobuild-v4-[0|1]-test.
Comment 8 Karolin Seeger 2014-09-01 19:20:24 UTC
(In reply to comment #7)
> Pushed to autobuild-v4-[0|1]-test.

Pushed to both branches.
Closing out bug report.

Thanks!