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>
applies.
+"net ads kerberos pac save" and "net eventlog export"
+-----------------------------------------------------
+
+The "net ads kerberos pac save" and "net eventlog export" tools will
+no longer silently overwrite an existing file during data export. If
+the filename given exits, an error will be shown.
+
REMOVED FEATURES
================
{
ssize_t num_written;
int fd;
- fd = open(fname, O_WRONLY|O_CREAT|O_TRUNC, mode);
+ fd = open(fname, O_WRONLY|O_CREAT|O_EXCL, mode);
if (fd == -1) {
return false;
}