summaryrefslogtreecommitdiff
path: root/source4/dns_server
diff options
context:
space:
mode:
authorKai Blin <kai@samba.org>2013-06-01 10:24:11 +0200
committerAndrew Bartlett <abartlet@samba.org>2013-06-01 18:48:11 +1000
commit8b24c43b382740106474e26dec59e1419ba77306 (patch)
treed6529b2dbc2ccfc8302a140157dce86cae59bfdd /source4/dns_server
parent553d63f0ead74ea101b2169bdad4af80caa16e2b (diff)
downloadsamba-8b24c43b382740106474e26dec59e1419ba77306.tar.gz
samba-8b24c43b382740106474e26dec59e1419ba77306.tar.bz2
samba-8b24c43b382740106474e26dec59e1419ba77306.zip
dns: Delete dnsNode objects when they are empty
If an update leaves the dnsNode without any entries, the dnsNode object should be deleted. Thanks to Günter Kukkukk for his excellent debugging work on this one. This should fix bug #9559 Signed-off-by: Kai Blin <kai@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/dns_server')
-rw-r--r--source4/dns_server/dns_utils.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source4/dns_server/dns_utils.c b/source4/dns_server/dns_utils.c
index 21c7f5a680..72782cf450 100644
--- a/source4/dns_server/dns_utils.c
+++ b/source4/dns_server/dns_utils.c
@@ -276,7 +276,13 @@ WERROR dns_replace_records(struct dns_server *dns,
if (needs_add) {
return WERR_OK;
}
- /* TODO: Delete object? */
+ /* No entries left, delete the dnsNode object */
+ ret = ldb_delete(dns->samdb, msg->dn);
+ if (ret != LDB_SUCCESS) {
+ DEBUG(0, ("Deleting record failed; %d\n", ret));
+ return DNS_ERR(SERVER_FAILURE);
+ }
+ return WERR_OK;
}
if (needs_add) {