The Samba-Bugzilla – Attachment 4527 Details for
Bug 6620
Renames of directories can incorrectly return NT_STATUS_ACCESS_DENIED
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Fix
0002-s3-Fix-a-bug-in-renames-of-directories.patch (text/plain), 1.90 KB, created by
Tim Prouty
on 2009-08-07 12:25:02 UTC
(
hide
)
Description:
Fix
Filename:
MIME Type:
Creator:
Tim Prouty
Created:
2009-08-07 12:25:02 UTC
Size:
1.90 KB
patch
obsolete
>From 2be9b1b1d9aa5a61706cce7276c54760e9c16bd1 Mon Sep 17 00:00:00 2001 >From: Tim Prouty <tprouty@samba.org> >Date: Thu, 6 Aug 2009 15:53:33 -0700 >Subject: [PATCH 2/2] s3: Fix a bug in renames of directories > >Recently code was added to match windows semantics of denying the >rename of a directory if there are open files underneath it. This >does partly match windows semantics, but it turns out the rename >should be allowed if the open file handle is for the directory being >renamed, or for a stream on the directory being renamed. This patch >refines the check to better follow these rename semantics. >--- > source3/smbd/files.c | 24 ++++++++++++++++++------ > 1 files changed, 18 insertions(+), 6 deletions(-) > >diff --git a/source3/smbd/files.c b/source3/smbd/files.c >index a2200fc..54c4c73 100644 >--- a/source3/smbd/files.c >+++ b/source3/smbd/files.c >@@ -385,13 +385,13 @@ bool file_find_subpath(files_struct *dir_fsp) > { > files_struct *fsp; > size_t dlen; >+ bool ret = false; > char *d_fullname = talloc_asprintf(talloc_tos(), > "%s/%s", > dir_fsp->conn->connectpath, > dir_fsp->fsp_name); >- > if (!d_fullname) { >- return false; >+ goto out; > } > > dlen = strlen(d_fullname); >@@ -409,15 +409,27 @@ bool file_find_subpath(files_struct *dir_fsp) > fsp->fsp_name); > > if (strnequal(d_fullname, d1_fullname, dlen)) { >- TALLOC_FREE(d_fullname); >+ int d1_len = strlen(d1_fullname); >+ >+ /* >+ * If the open file is a second file handle to the >+ * same name or is a stream on the original file, then >+ * don't return true. >+ */ >+ if (d1_len == dlen || d1_fullname[dlen] == ':') { >+ TALLOC_FREE(d1_fullname); >+ continue; >+ } >+ > TALLOC_FREE(d1_fullname); >- return true; >+ ret = true; >+ goto out; > } > TALLOC_FREE(d1_fullname); > } >- >+ out: > TALLOC_FREE(d_fullname); >- return false; >+ return ret; > } > > /**************************************************************************** >-- >1.6.4 >
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 6620
:
4526
| 4527