From 31739a0e1e32abfa7da166afbc5075aeab4124e6 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 16 Nov 1998 21:38:13 +0000 Subject: O_EXCL fixes for printing files & oplocks. Jeremy. (This used to be commit 4ca71c90985b1c88d92bdd0f9079a4afc263dc46) --- source3/smbd/open.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source3/smbd/open.c') diff --git a/source3/smbd/open.c b/source3/smbd/open.c index f9ddc969a8..c81334c8ae 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -312,7 +312,7 @@ static void open_file(files_struct *fsp,connection_struct *conn, /* this handles a bug in Win95 - it doesn't say to create the file when it should */ if (conn->printer) { - flags |= O_CREAT; + flags |= (O_CREAT|O_EXCL); } /* @@ -770,6 +770,9 @@ void open_file_shared(files_struct *fsp,connection_struct *conn,char *fname,int if (GET_FILE_OPEN_DISPOSITION(ofun) == FILE_EXISTS_TRUNCATE) flags2 |= O_TRUNC; + if (GET_FILE_OPEN_DISPOSITION(ofun) == FILE_EXISTS_FAIL) + flags2 |= O_EXCL; + /* note that we ignore the append flag as append does not mean the same thing under dos and unix */ -- cgit