mirror of
https://github.com/samba-team/samba.git
synced 2024-12-27 03:21:53 +03:00
RAW-OPLOCK: be more strict with share modes against windows and samba4
But still allow samba3 behavior. metze
This commit is contained in:
parent
e3a9ad303f
commit
a0decdf63e
@ -298,6 +298,7 @@ static bool test_raw_oplock_exclusive3(struct torture_context *tctx, struct smbc
|
||||
union smb_open io;
|
||||
union smb_setfileinfo sfi;
|
||||
uint16_t fnum=0;
|
||||
bool s3 = torture_setting_bool(tctx, "samba3", false);
|
||||
|
||||
if (!torture_setup_dir(cli1, BASEDIR)) {
|
||||
return false;
|
||||
@ -323,13 +324,15 @@ static bool test_raw_oplock_exclusive3(struct torture_context *tctx, struct smbc
|
||||
io.ntcreatex.in.security_flags = 0;
|
||||
io.ntcreatex.in.fname = fname;
|
||||
|
||||
/* we should use no share mode, when samba3 passes this */
|
||||
torture_comment(tctx, "open a file with an exclusive oplock (share mode: all)\n");
|
||||
torture_comment(tctx, "open a file with an exclusive oplock (share mode: %s)\n",
|
||||
s3?"all":"none");
|
||||
ZERO_STRUCT(break_info);
|
||||
io.ntcreatex.in.flags = NTCREATEX_FLAGS_EXTENDED | NTCREATEX_FLAGS_REQUEST_OPLOCK;
|
||||
io.ntcreatex.in.share_access = NTCREATEX_SHARE_ACCESS_READ|
|
||||
NTCREATEX_SHARE_ACCESS_WRITE|
|
||||
NTCREATEX_SHARE_ACCESS_DELETE;
|
||||
if (s3) {
|
||||
io.ntcreatex.in.share_access = NTCREATEX_SHARE_ACCESS_READ|
|
||||
NTCREATEX_SHARE_ACCESS_WRITE|
|
||||
NTCREATEX_SHARE_ACCESS_DELETE;
|
||||
}
|
||||
|
||||
status = smb_raw_open(cli1->tree, tctx, &io);
|
||||
CHECK_STATUS(tctx, status, NT_STATUS_OK);
|
||||
@ -502,6 +505,7 @@ static bool test_raw_oplock_exclusive6(struct torture_context *tctx, struct smbc
|
||||
union smb_open io;
|
||||
union smb_rename rn;
|
||||
uint16_t fnum=0;
|
||||
bool s3 = torture_setting_bool(tctx, "samba3", false);
|
||||
|
||||
if (!torture_setup_dir(cli1, BASEDIR)) {
|
||||
return false;
|
||||
@ -529,12 +533,15 @@ static bool test_raw_oplock_exclusive6(struct torture_context *tctx, struct smbc
|
||||
io.ntcreatex.in.fname = fname1;
|
||||
|
||||
/* we should use no share mode, when samba3 passes this */
|
||||
torture_comment(tctx, "open a file with an exclusive oplock (share mode: all)\n");
|
||||
torture_comment(tctx, "open a file with an exclusive oplock (share mode: %s)\n",
|
||||
s3?"all":"none");
|
||||
ZERO_STRUCT(break_info);
|
||||
io.ntcreatex.in.flags = NTCREATEX_FLAGS_EXTENDED | NTCREATEX_FLAGS_REQUEST_OPLOCK;
|
||||
io.ntcreatex.in.share_access = NTCREATEX_SHARE_ACCESS_READ|
|
||||
NTCREATEX_SHARE_ACCESS_WRITE|
|
||||
NTCREATEX_SHARE_ACCESS_DELETE;
|
||||
if (s3) {
|
||||
io.ntcreatex.in.share_access = NTCREATEX_SHARE_ACCESS_READ|
|
||||
NTCREATEX_SHARE_ACCESS_WRITE|
|
||||
NTCREATEX_SHARE_ACCESS_DELETE;
|
||||
}
|
||||
|
||||
status = smb_raw_open(cli1->tree, tctx, &io);
|
||||
CHECK_STATUS(tctx, status, NT_STATUS_OK);
|
||||
@ -1815,6 +1822,7 @@ static bool test_raw_oplock_batch17(struct torture_context *tctx, struct smbcli_
|
||||
union smb_open io;
|
||||
union smb_rename rn;
|
||||
uint16_t fnum=0;
|
||||
bool s3 = torture_setting_bool(tctx, "samba3", false);
|
||||
|
||||
if (!torture_setup_dir(cli1, BASEDIR)) {
|
||||
return false;
|
||||
@ -1842,14 +1850,17 @@ static bool test_raw_oplock_batch17(struct torture_context *tctx, struct smbcli_
|
||||
io.ntcreatex.in.fname = fname1;
|
||||
|
||||
/* we should use no share mode, when samba3 passes this */
|
||||
torture_comment(tctx, "open a file with an batch oplock (share mode: all)\n");
|
||||
torture_comment(tctx, "open a file with an batch oplock (share mode: %s)\n",
|
||||
s3?"all":"none");
|
||||
ZERO_STRUCT(break_info);
|
||||
io.ntcreatex.in.flags = NTCREATEX_FLAGS_EXTENDED |
|
||||
NTCREATEX_FLAGS_REQUEST_OPLOCK |
|
||||
NTCREATEX_FLAGS_REQUEST_BATCH_OPLOCK;
|
||||
io.ntcreatex.in.share_access = NTCREATEX_SHARE_ACCESS_READ|
|
||||
NTCREATEX_SHARE_ACCESS_WRITE|
|
||||
NTCREATEX_SHARE_ACCESS_DELETE;
|
||||
if (s3) {
|
||||
io.ntcreatex.in.share_access = NTCREATEX_SHARE_ACCESS_READ|
|
||||
NTCREATEX_SHARE_ACCESS_WRITE|
|
||||
NTCREATEX_SHARE_ACCESS_DELETE;
|
||||
}
|
||||
|
||||
status = smb_raw_open(cli1->tree, tctx, &io);
|
||||
CHECK_STATUS(tctx, status, NT_STATUS_OK);
|
||||
@ -1889,6 +1900,7 @@ static bool test_raw_oplock_batch18(struct torture_context *tctx, struct smbcli_
|
||||
union smb_open io;
|
||||
union smb_rename rn;
|
||||
uint16_t fnum=0;
|
||||
bool s3 = torture_setting_bool(tctx, "samba3", false);
|
||||
|
||||
if (!torture_setup_dir(cli1, BASEDIR)) {
|
||||
return false;
|
||||
@ -1916,14 +1928,17 @@ static bool test_raw_oplock_batch18(struct torture_context *tctx, struct smbcli_
|
||||
io.ntcreatex.in.fname = fname1;
|
||||
|
||||
/* we should use no share mode, when samba3 passes this */
|
||||
torture_comment(tctx, "open a file with an batch oplock (share mode: all)\n");
|
||||
torture_comment(tctx, "open a file with an batch oplock (share mode: %s)\n",
|
||||
s3?"all":"none");
|
||||
ZERO_STRUCT(break_info);
|
||||
io.ntcreatex.in.flags = NTCREATEX_FLAGS_EXTENDED |
|
||||
NTCREATEX_FLAGS_REQUEST_OPLOCK |
|
||||
NTCREATEX_FLAGS_REQUEST_BATCH_OPLOCK;
|
||||
io.ntcreatex.in.share_access = NTCREATEX_SHARE_ACCESS_READ|
|
||||
NTCREATEX_SHARE_ACCESS_WRITE|
|
||||
NTCREATEX_SHARE_ACCESS_DELETE;
|
||||
if (s3) {
|
||||
io.ntcreatex.in.share_access = NTCREATEX_SHARE_ACCESS_READ|
|
||||
NTCREATEX_SHARE_ACCESS_WRITE|
|
||||
NTCREATEX_SHARE_ACCESS_DELETE;
|
||||
}
|
||||
|
||||
status = smb_raw_open(cli1->tree, tctx, &io);
|
||||
CHECK_STATUS(tctx, status, NT_STATUS_OK);
|
||||
@ -1996,7 +2011,6 @@ static bool test_raw_oplock_batch19(struct torture_context *tctx, struct smbcli_
|
||||
io.ntcreatex.in.security_flags = 0;
|
||||
io.ntcreatex.in.fname = fname1;
|
||||
|
||||
/* we should use no share mode, when samba3 passes this */
|
||||
torture_comment(tctx, "open a file with an batch oplock (share mode: none)\n");
|
||||
ZERO_STRUCT(break_info);
|
||||
io.ntcreatex.in.flags = NTCREATEX_FLAGS_EXTENDED |
|
||||
@ -2099,7 +2113,6 @@ static bool test_raw_oplock_batch20(struct torture_context *tctx, struct smbcli_
|
||||
io.ntcreatex.in.security_flags = 0;
|
||||
io.ntcreatex.in.fname = fname1;
|
||||
|
||||
/* we should use no share mode, when samba3 passes this */
|
||||
torture_comment(tctx, "open a file with an batch oplock (share mode: all)\n");
|
||||
ZERO_STRUCT(break_info);
|
||||
io.ntcreatex.in.flags = NTCREATEX_FLAGS_EXTENDED |
|
||||
|
Loading…
Reference in New Issue
Block a user