From: Joe Guo Date: Wed, 8 May 2019 05:21:27 +0000 (+1200) Subject: samba_dnsupdate: flush dns update cache file after write X-Git-Tag: tdb-1.4.1~86 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=165025a56e14eca51f3db366300fe625d1f521b5;p=thirdparty%2Fsamba.git samba_dnsupdate: flush dns update cache file after write While running samba python tests with `coverage.py`, `make test` failed to start ad_dc env since dns_update_cache stays empty. Flush the file after write fix the issue. Signed-off-by: Joe Guo Signed-off-by: Andrew Bartlett Reviewed-by: Gary Lockyer --- diff --git a/source4/scripting/bin/samba_dnsupdate b/source4/scripting/bin/samba_dnsupdate index 2ecb2ce9f1d..9d45de59fd6 100755 --- a/source4/scripting/bin/samba_dnsupdate +++ b/source4/scripting/bin/samba_dnsupdate @@ -940,6 +940,7 @@ if rebuild_cache: if opts.verbose: print("Adding %s to %s" % (str(d), file_name)) wfile.write(str(d)+"\n") + wfile.flush() os.rename(tmpfile, dns_update_cache) fcntl.lockf(cfile, fcntl.LOCK_UN)