From 2cf97c403f73946693bb147daa6a618af6fdb526 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 11 Feb 2010 20:49:29 +1100 Subject: 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 --- source4/dsdb/dns/dns_update.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source4') 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; } -- cgit