summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2008-03-11 13:27:33 -0700
committerJeremy Allison <jra@samba.org>2008-03-11 13:27:33 -0700
commitbac7b5b19e1c9a21a8de6b7b09cd4b06faf43f09 (patch)
treef94bd095ac7358c28c33dafd419924e3de8e068a /source3/smbd
parent380fcfa60047e0f886ce9fdf35f304427891a7d8 (diff)
downloadsamba-bac7b5b19e1c9a21a8de6b7b09cd4b06faf43f09.tar.gz
samba-bac7b5b19e1c9a21a8de6b7b09cd4b06faf43f09.tar.bz2
samba-bac7b5b19e1c9a21a8de6b7b09cd4b06faf43f09.zip
Try and fix bug #5315, as well as S4 torture tests RAW-OPLOCK BATCH19,
BATCH20 and RAW-RENAME. Jeremy. (This used to be commit 9065792d4bc42522f12f9732de3c0ad82c72a2d3)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/nttrans.c5
-rw-r--r--source3/smbd/reply.c15
-rw-r--r--source3/smbd/trans2.c3
3 files changed, 13 insertions, 10 deletions
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index 5293ca5347..f67ddd3b31 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/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/source3/smbd/reply.c b/source3/smbd/reply.c
index 818ff319e4..d3b5dfac64 100644
--- a/source3/smbd/reply.c
+++ b/source3/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/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 716f94f661..85a7cdb613 100644
--- a/source3/smbd/trans2.c
+++ b/source3/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;