lib/util: change file_save_mode() to use O_EXCL
authorAndrew Bartlett <abartlet@samba.org>
Mon, 11 Nov 2019 00:52:22 +0000 (13:52 +1300)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 15 Nov 2019 17:21:32 +0000 (17:21 +0000)
commit5e63e54f589b25af550f0d4e28e3c28e0a337c0d
treee754adb3651f2c390351ad1b6cc87fdce61648e0
parent55b2cb47a9701376aa9e844390c8c4ee2d7fa6e9
lib/util: change file_save_mode() to use O_EXCL

Almost all the callers are debug tools or developer debugging aids
and these callers clearly expect to create a new file.

Unchanged in behaviour is:
 - TLS certificate creation.  This already confirms the files do no exist
   prior to generation.

These will now no longer overwrite the given filename
 - net ads pac save
 - net eventlog export

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
WHATSNEW.txt
lib/util/util_file.c