The Samba-Bugzilla – Attachment 10282 Details for
Bug 10809
smbd: race condition in file creation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
git-am fix for master.
0001-s3-smbd-open-logic-fix.patch (text/plain), 1.35 KB, created by
Jeremy Allison
on 2014-09-11 17:08:53 UTC
(
hide
)
Description:
git-am fix for master.
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2014-09-11 17:08:53 UTC
Size:
1.35 KB
patch
obsolete
>From 34a1b047ce01713d9c3e521177cde3162d9c56c3 Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Thu, 11 Sep 2014 10:03:01 -0700 >Subject: [PATCH] s3: smbd - open logic fix. > >As we atomically create using O_CREAT|O_EXCL, >then if new_file_created is true, then >file_existed *MUST* have been false (even >if the file was previously detected as being >there. > >We use the variable file_existed again in logic >below this statement, so we must set file_existed = false, >if new_file_created returns are true from open_file(). > >Based on a fix from Michael Adam. > >Signed-off-by: Jeremy Allison <jra@samba.org> >--- > source3/smbd/open.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) > >diff --git a/source3/smbd/open.c b/source3/smbd/open.c >index 6261a449..f077210 100644 >--- a/source3/smbd/open.c >+++ b/source3/smbd/open.c >@@ -2489,6 +2489,17 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn, > return fsp_open; > } > >+ if (new_file_created) { >+ /* >+ * As we atomically create using O_CREAT|O_EXCL, >+ * then if new_file_created is true, then >+ * file_existed *MUST* have been false (even >+ * if the file was previously detected as being >+ * there). >+ */ >+ file_existed = false; >+ } >+ > if (file_existed && !check_same_dev_ino(&saved_stat, &smb_fname->st)) { > /* > * The file did exist, but some other (local or NFS) >-- >2.1.0.rc2.206.gedb03e5 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 10809
:
10281
|
10282
|
10286
|
10298