The Samba-Bugzilla – Attachment 3172 Details for
Bug 5315
Rename fails on an open file with ShareMode=0
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Second patch for 3.2
look (text/plain), 3.27 KB, created by
Jeremy Allison
on 2008-03-11 15:27:03 UTC
(
hide
)
Description:
Second patch for 3.2
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2008-03-11 15:27:03 UTC
Size:
3.27 KB
patch
obsolete
>diff --git a/source/smbd/nttrans.c b/source/smbd/nttrans.c >index 5293ca5..f67ddd3 100644 >--- a/source/smbd/nttrans.c >+++ b/source/smbd/nttrans.c >@@ -1353,7 +1353,7 @@ void reply_ntrename(struct smb_request *req) > case RENAME_FLAG_RENAME: > status = rename_internals(ctx, conn, req, oldname, > newname, attrs, False, src_has_wcard, >- dest_has_wcard); >+ dest_has_wcard, DELETE_ACCESS); > break; > case RENAME_FLAG_HARD_LINK: > if (src_has_wcard || dest_has_wcard) { >@@ -1549,7 +1549,8 @@ static void call_nt_transact_rename(connection_struct *conn, > 0, > replace_if_exists, > False, >- dest_has_wcard); >+ dest_has_wcard, >+ DELETE_ACCESS); > > if (!NT_STATUS_IS_OK(status)) { > if (open_was_deferred(req->mid)) { >diff --git a/source/smbd/reply.c b/source/smbd/reply.c >index 818ff31..d3b5dfa 100644 >--- a/source/smbd/reply.c >+++ b/source/smbd/reply.c >@@ -2184,7 +2184,7 @@ static NTSTATUS can_rename(connection_struct *conn, files_struct *fsp, > return NT_STATUS_OK; > } > >- if (fsp->access_mask & DELETE_ACCESS) { >+ if (fsp->access_mask & (DELETE_ACCESS|FILE_WRITE_ATTRIBUTES)) { > return NT_STATUS_OK; > } > >@@ -5585,7 +5585,8 @@ NTSTATUS rename_internals(TALLOC_CTX *ctx, > uint32 attrs, > bool replace_if_exists, > bool src_has_wild, >- bool dest_has_wild) >+ bool dest_has_wild, >+ uint32_t access_mask) > { > char *directory = NULL; > char *mask = NULL; >@@ -5715,12 +5716,12 @@ NTSTATUS rename_internals(TALLOC_CTX *ctx, > > status = S_ISDIR(sbuf1.st_mode) ? > open_directory(conn, req, directory, &sbuf1, >- DELETE_ACCESS, >+ access_mask, > FILE_SHARE_READ|FILE_SHARE_WRITE, > FILE_OPEN, 0, 0, NULL, > &fsp) > : open_file_ntcreate(conn, req, directory, &sbuf1, >- DELETE_ACCESS, >+ access_mask, > FILE_SHARE_READ|FILE_SHARE_WRITE, > FILE_OPEN, 0, 0, 0, NULL, > &fsp); >@@ -5819,12 +5820,12 @@ NTSTATUS rename_internals(TALLOC_CTX *ctx, > > status = S_ISDIR(sbuf1.st_mode) ? > open_directory(conn, req, fname, &sbuf1, >- DELETE_ACCESS, >+ access_mask, > FILE_SHARE_READ|FILE_SHARE_WRITE, > FILE_OPEN, 0, 0, NULL, > &fsp) > : open_file_ntcreate(conn, req, fname, &sbuf1, >- DELETE_ACCESS, >+ access_mask, > FILE_SHARE_READ|FILE_SHARE_WRITE, > FILE_OPEN, 0, 0, 0, NULL, > &fsp); >@@ -5947,7 +5948,7 @@ void reply_mv(struct smb_request *req) > DEBUG(3,("reply_mv : %s -> %s\n",name,newname)); > > status = rename_internals(ctx, conn, req, name, newname, attrs, False, >- src_has_wcard, dest_has_wcard); >+ src_has_wcard, dest_has_wcard, DELETE_ACCESS); > if (!NT_STATUS_IS_OK(status)) { > if (open_was_deferred(req->mid)) { > /* We have re-scheduled this call. */ >diff --git a/source/smbd/trans2.c b/source/smbd/trans2.c >index 716f94f..85a7cdb 100644 >--- a/source/smbd/trans2.c >+++ b/source/smbd/trans2.c >@@ -5322,7 +5322,8 @@ static NTSTATUS smb_file_rename_information(connection_struct *conn, > DEBUG(10,("smb_file_rename_information: SMB_FILE_RENAME_INFORMATION %s -> %s\n", > fname, base_name )); > status = rename_internals(ctx, conn, req, fname, base_name, 0, >- overwrite, False, dest_has_wcard); >+ overwrite, False, dest_has_wcard, >+ FILE_WRITE_ATTRIBUTES); > } > > return status;
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 5315
:
3171
| 3172