access_mask needed for rename
Jeremy Allison
jra at samba.org
Wed Nov 2 22:15:46 UTC 2016
On Wed, Nov 02, 2016 at 02:42:41PM -0700, Jeremy Allison wrote:
> On Wed, Nov 02, 2016 at 02:31:52PM -0700, Kenny Dinh wrote:
> > Thank again for the tips, Jeremy!
> >
> > I was going to make that change locally since SMB2 is more prevalent than
> > SMB1 but one never knows.
>
> I'm checking again which of the tests depends on this, but
> even if I can't figure out how to fix it for SMB1 it's
> probably a good idea to propose that fix for smb2.
Yep - the following change:
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 6999b2d..9042fcb 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -7044,7 +7044,7 @@ static NTSTATUS smb_file_rename_information(connection_struct *conn,
status = rename_internals(ctx, conn, req, smb_fname_src,
smb_fname_dst, 0, overwrite, false,
dest_has_wcard,
- FILE_WRITE_ATTRIBUTES);
+ DELETE_ACCESS);
}
out:
TALLOC_FREE(smb_fname_dst);
breaks:
samba3.raw.oplock and samba3.raw.rename.
UNEXPECTED(failure): samba3.raw.oplock.exclusive7(ad_dc)
REASON: Exception: Exception: ../source4/torture/raw/oplock.c:789: Incorrect status NT_STATUS_SHARING_VIOLATION - should be NT_STATUS_OK
BATCH19: open a file with an batch oplock (share mode: none)
setpathinfo rename info should trigger a break to none
Acking to level II [0x01] in oplock handler
UNEXPECTED(failure): samba3.raw.oplock.batch19(ad_dc)
REASON: Exception: Exception: ../source4/torture/raw/oplock.c:2765: Incorrect status NT_STATUS_SHARING_VIOLATION - should be NT_STATUS_OK
BATCH20: open a file with an batch oplock (share mode: all)
Acking to level II [0x01] in oplock handler
UNEXPECTED(failure): samba3.raw.oplock.batch20(ad_dc)
REASON: Exception: Exception: ../source4/torture/raw/oplock.c:3128: Incorrect status NT_STATUS_SHARING_VIOLATION - should be NT_STATUS_OK
UNEXPECTED(failure): samba3.raw.rename.trans2rename(nt4_dc)
REASON: Exception: Exception: ../source4/torture/raw/oplock.c:2901: Incorrect status NT_STATUS_SHARING_VIOLATION - should be NT_STATUS_OK
These are tests over SMB1. The question is - do they also
break over SMB2 ?
I suggest you check that before making and deploying the
change - this could break real life apps.
Jeremy.
More information about the samba-technical
mailing list