The Samba-Bugzilla – Attachment 11910 Details for
Bug 11780
mkdir can return ACCESS_DENIED incorrectly on create race.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
git-am fix for 4.4.0, 4.3.next, 4.2.next.
0001-smbd-Only-check-dev-inode-in-open_directory-not-the-.patch (text/plain), 1.93 KB, created by
Jeremy Allison
on 2016-03-12 16:14:54 UTC
(
hide
)
Description:
git-am fix for 4.4.0, 4.3.next, 4.2.next.
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2016-03-12 16:14:54 UTC
Size:
1.93 KB
patch
obsolete
>From 391083cb728dc5f88adb16a99b29960f58d0e5ca Mon Sep 17 00:00:00 2001 >From: Andrew Bartlett <abartlet@samba.org> >Date: Fri, 11 Mar 2016 14:27:53 +1300 >Subject: [PATCH] smbd: Only check dev/inode in open_directory, not the full > stat() > >This is needed because the smb2.create.mkdir-dup test creates a race, >and against an AD DC this can cause a flapping test if the lstat() and >stat() calls are made either side of the chown() due to creation of a >file by administrator. > >Fix based on original patches by myself, by Douglas Bagnall ><douglas.bagnall@catalyst.net.nz>. and Jeremy Allison <jra@samba.org> > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=11780 > >Signed-off-by: Andrew Bartlett <abartlet@samba.org> >Reviewed-by: Jeremy Allison <jra@samba.org> > >Autobuild-User(master): Jeremy Allison <jra@samba.org> >Autobuild-Date(master): Sat Mar 12 09:43:21 CET 2016 on sn-devel-144 > >(cherry picked from commit 5fc6d2dabdf2aeef74fdefaa67eae0348bbf7a44) >--- > source3/smbd/open.c | 14 ++++++++++++-- > 1 file changed, 12 insertions(+), 2 deletions(-) > >diff --git a/source3/smbd/open.c b/source3/smbd/open.c >index fa817e4..0d90c99 100644 >--- a/source3/smbd/open.c >+++ b/source3/smbd/open.c >@@ -3624,8 +3624,18 @@ static NTSTATUS open_directory(connection_struct *conn, > return status; > } > >- /* Ensure there was no race condition. */ >- if (!check_same_stat(&smb_dname->st, &fsp->fsp_name->st)) { >+ if(!S_ISDIR(fsp->fsp_name->st.st_ex_mode)) { >+ DEBUG(5,("open_directory: %s is not a directory !\n", >+ smb_fname_str_dbg(smb_dname))); >+ fd_close(fsp); >+ file_free(req, fsp); >+ return NT_STATUS_NOT_A_DIRECTORY; >+ } >+ >+ /* Ensure there was no race condition. We need to check >+ * dev/inode but not permissions, as these can change >+ * legitimately */ >+ if (!check_same_dev_ino(&smb_dname->st, &fsp->fsp_name->st)) { > DEBUG(5,("open_directory: stat struct differs for " > "directory %s.\n", > smb_fname_str_dbg(smb_dname))); >-- >2.5.0 >
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
Flags:
jra
:
review?
(
abartlet
)
uri
:
review+
Actions:
View
Attachments on
bug 11780
:
11907
|
11908
| 11910