summaryrefslogtreecommitdiff
path: root/source4/dsdb/dns
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-02-11 20:49:29 +1100
committerAndrew Tridgell <tridge@samba.org>2010-02-11 21:04:16 +1100
commit2cf97c403f73946693bb147daa6a618af6fdb526 (patch)
tree5f88754f493b82c49c47021310f4c85133295f7c /source4/dsdb/dns
parent1e1b081189a7dafa0717e3e3deb4a46e079b146e (diff)
downloadsamba-2cf97c403f73946693bb147daa6a618af6fdb526.tar.gz
samba-2cf97c403f73946693bb147daa6a618af6fdb526.tar.bz2
samba-2cf97c403f73946693bb147daa6a618af6fdb526.zip
s4-dns: don't leave behind a tmp file
If the dns update file doesn't need updating we need to delete the tmp file
Diffstat (limited to 'source4/dsdb/dns')
-rw-r--r--source4/dsdb/dns/dns_update.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/source4/dsdb/dns/dns_update.c b/source4/dsdb/dns/dns_update.c
index 90ada8810e..13f37e3c6b 100644
--- a/source4/dsdb/dns/dns_update.c
+++ b/source4/dsdb/dns/dns_update.c
@@ -82,6 +82,7 @@ static void dnsupdate_rebuild(struct dnsupdate_service *service)
return;
}
+ unlink(tmp_path);
fd = open(tmp_path, O_CREAT|O_TRUNC|O_WRONLY, 0444);
if (fd == -1) {
DEBUG(1,(__location__ ": Unable to open %s - %s\n", tmp_path, strerror(errno)));
@@ -106,6 +107,7 @@ static void dnsupdate_rebuild(struct dnsupdate_service *service)
close(fd);
if (file_compare(tmp_path, path) == true) {
+ unlink(tmp_path);
talloc_free(tmp_ctx);
return;
}