The Samba-Bugzilla – Attachment 10648 Details for
Bug 11065
Renaming directories with open files
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Possible implementation to allow POSIX dir renames
posix_rename.patch (text/plain), 2.58 KB, created by
Ralph Böhme
on 2015-01-22 09:11:29 UTC
(
hide
)
Description:
Possible implementation to allow POSIX dir renames
Filename:
MIME Type:
Creator:
Ralph Böhme
Created:
2015-01-22 09:11:29 UTC
Size:
2.58 KB
patch
obsolete
>From ffcc94d429acb79b5739f7ade02aa77a906bbda6 Mon Sep 17 00:00:00 2001 >From: Ralph Boehme <slow@samba.org> >Date: Thu, 22 Jan 2015 10:00:15 +0100 >Subject: [PATCH 1/2] s3:smbd: allow POSIX directory rename semantics > >Add flag "posix_dir_rename" to files_struct allowing for POSIX directory >rename behaviour, ie allow a rename when there are open files in the >directory. > >Bug: https://bugzilla.samba.org/show_bug.cgi?id=11065 > >Signed-off-by: Ralph Boehme <slow@samba.org> >--- > source3/include/vfs.h | 1 + > source3/smbd/reply.c | 2 +- > 2 files changed, 2 insertions(+), 1 deletion(-) > >diff --git a/source3/include/vfs.h b/source3/include/vfs.h >index 321c48c..a83adbd 100644 >--- a/source3/include/vfs.h >+++ b/source3/include/vfs.h >@@ -250,6 +250,7 @@ typedef struct files_struct { > bool initial_delete_on_close; /* Only set at NTCreateX if file was created. */ > bool delete_on_close; > bool posix_open; >+ bool posix_dir_rename; > bool is_sparse; > bool backup_intent; /* Handle was successfully opened with backup intent > and opener has privilege to do so. */ >diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c >index 0b6c102..ddebacc 100644 >--- a/source3/smbd/reply.c >+++ b/source3/smbd/reply.c >@@ -2649,7 +2649,7 @@ static NTSTATUS can_rename(connection_struct *conn, files_struct *fsp, > } > > if (S_ISDIR(fsp->fsp_name->st.st_ex_mode)) { >- if (fsp->posix_open) { >+ if (fsp->posix_open || fsp->posix_dir_rename) { > return NT_STATUS_OK; > } > >-- >1.9.3 > > >From 7ac4fc472494481fa35546d0c9b428e6426928b3 Mon Sep 17 00:00:00 2001 >From: Ralph Boehme <slow@samba.org> >Date: Thu, 22 Jan 2015 10:07:56 +0100 >Subject: [PATCH 2/2] vfs:fruit: enable POSIX directory rename semantics > >Bug: https://bugzilla.samba.org/show_bug.cgi?id=11065 > >Signed-off-by: Ralph Boehme <slow@samba.org> >--- > source3/modules/vfs_fruit.c | 15 ++++++++++++--- > 1 file changed, 12 insertions(+), 3 deletions(-) > >diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c >index 4eace1e..30736db 100644 >--- a/source3/modules/vfs_fruit.c >+++ b/source3/modules/vfs_fruit.c >@@ -3163,9 +3163,18 @@ static NTSTATUS fruit_create_file(vfs_handle_struct *handle, > return status; > } > >- if (is_ntfs_stream_smb_fname(smb_fname) >- || (*result == NULL) >- || ((*result)->is_directory)) { >+ if ((*result)->is_directory) { >+ /* >+ * Implement POSIX directory rename behaviour: in an >+ * SMB2 connection with AAPL extension change >+ * behaviour from preventing directory renames to >+ * allowing it. >+ */ >+ (*result)->posix_dir_rename = true; >+ return status; >+ } >+ >+ if (is_ntfs_stream_smb_fname(smb_fname)) { > return status; > } > >-- >1.9.3 >
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 11065
:
10646
|
10647
| 10648 |
10652
|
11616
|
11668
|
11669
|
12186