summaryrefslogtreecommitdiff
path: root/source4/torture/basic
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-11-30 04:33:27 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:06:13 -0500
commitfdc9f417d89fdf9dd6afbc22843d70585e195c9d (patch)
treeca74e9c5b19771d7aecff06df93ebfaa3115c7da /source4/torture/basic
parent2ed4ff13d509218785d9941dc17219958ab04223 (diff)
downloadsamba-fdc9f417d89fdf9dd6afbc22843d70585e195c9d.tar.gz
samba-fdc9f417d89fdf9dd6afbc22843d70585e195c9d.tar.bz2
samba-fdc9f417d89fdf9dd6afbc22843d70585e195c9d.zip
r4011: get rid of rpc_secdes.h and replace it with a single sane set of
definitions for security access masks, in security.idl The previous definitions were inconsistently named, and contained many duplicate and misleading entries. I kept finding myself tripping up while using them. (This used to be commit 01c0fa722f80ceeb3f81f01987de95f365a2ed3d)
Diffstat (limited to 'source4/torture/basic')
-rw-r--r--source4/torture/basic/attr.c14
-rw-r--r--source4/torture/basic/charset.c3
-rw-r--r--source4/torture/basic/delete.c93
-rw-r--r--source4/torture/basic/denytest.c51
-rw-r--r--source4/torture/basic/dir.c8
-rw-r--r--source4/torture/basic/disconnect.c3
-rw-r--r--source4/torture/basic/rename.c7
-rw-r--r--source4/torture/basic/scanner.c11
-rw-r--r--source4/torture/basic/unlink.c3
-rw-r--r--source4/torture/basic/utable.c11
10 files changed, 123 insertions, 81 deletions
diff --git a/source4/torture/basic/attr.c b/source4/torture/basic/attr.c
index 5cd05d9647..07a36ea950 100644
--- a/source4/torture/basic/attr.c
+++ b/source4/torture/basic/attr.c
@@ -21,6 +21,7 @@
*/
#include "includes.h"
+#include "librpc/gen_ndr/ndr_security.h"
extern int torture_failures;
@@ -103,7 +104,9 @@ BOOL torture_openattrtest(void)
for (k = 0, i = 0; i < sizeof(open_attrs_table)/sizeof(uint32_t); i++) {
smbcli_setatr(cli1->tree, fname, 0, 0);
smbcli_unlink(cli1->tree, fname);
- fnum1 = smbcli_nt_create_full(cli1->tree, fname, 0, SA_RIGHT_FILE_WRITE_DATA, open_attrs_table[i],
+ fnum1 = smbcli_nt_create_full(cli1->tree, fname, 0,
+ SEC_FILE_WRITE_DATA,
+ open_attrs_table[i],
NTCREATEX_SHARE_ACCESS_NONE, NTCREATEX_DISP_OVERWRITE_IF, 0, 0);
if (fnum1 == -1) {
@@ -118,10 +121,11 @@ BOOL torture_openattrtest(void)
for (j = 0; j < ARRAY_SIZE(open_attrs_table); j++) {
fnum1 = smbcli_nt_create_full(cli1->tree, fname, 0,
- SA_RIGHT_FILE_READ_DATA|SA_RIGHT_FILE_WRITE_DATA,
- open_attrs_table[j],
- NTCREATEX_SHARE_ACCESS_NONE,
- NTCREATEX_DISP_OVERWRITE, 0, 0);
+ SEC_FILE_READ_DATA|
+ SEC_FILE_WRITE_DATA,
+ open_attrs_table[j],
+ NTCREATEX_SHARE_ACCESS_NONE,
+ NTCREATEX_DISP_OVERWRITE, 0, 0);
if (fnum1 == -1) {
for (l = 0; l < ARRAY_SIZE(attr_results); l++) {
diff --git a/source4/torture/basic/charset.c b/source4/torture/basic/charset.c
index 4f57eba64a..1024c1cd26 100644
--- a/source4/torture/basic/charset.c
+++ b/source4/torture/basic/charset.c
@@ -21,6 +21,7 @@
*/
#include "includes.h"
+#include "librpc/gen_ndr/ndr_security.h"
#define BASEDIR "\\chartest\\"
@@ -67,7 +68,7 @@ static NTSTATUS unicode_open(struct smbcli_tree *tree,
io.generic.level = RAW_OPEN_NTCREATEX;
io.ntcreatex.in.flags = NTCREATEX_FLAGS_EXTENDED;
io.ntcreatex.in.root_fid = 0;
- io.ntcreatex.in.access_mask = GENERIC_RIGHTS_FILE_ALL_ACCESS;
+ io.ntcreatex.in.access_mask = SEC_RIGHTS_FULL_CONTROL;
io.ntcreatex.in.alloc_size = 0;
io.ntcreatex.in.file_attr = FILE_ATTRIBUTE_NORMAL;
io.ntcreatex.in.share_access = NTCREATEX_SHARE_ACCESS_NONE;
diff --git a/source4/torture/basic/delete.c b/source4/torture/basic/delete.c
index 742a51bcaa..99be602de9 100644
--- a/source4/torture/basic/delete.c
+++ b/source4/torture/basic/delete.c
@@ -21,6 +21,7 @@
*/
#include "includes.h"
+#include "librpc/gen_ndr/ndr_security.h"
/*
@@ -47,9 +48,11 @@ BOOL torture_test_delete(void)
smbcli_setatr(cli1->tree, fname, 0, 0);
smbcli_unlink(cli1->tree, fname);
- fnum1 = smbcli_nt_create_full(cli1->tree, fname, 0, GENERIC_RIGHTS_FILE_ALL_ACCESS, FILE_ATTRIBUTE_NORMAL,
- NTCREATEX_SHARE_ACCESS_DELETE, NTCREATEX_DISP_OVERWRITE_IF,
- NTCREATEX_OPTIONS_DELETE_ON_CLOSE, 0);
+ fnum1 = smbcli_nt_create_full(cli1->tree, fname, 0,
+ SEC_RIGHTS_FULL_CONTROL,
+ FILE_ATTRIBUTE_NORMAL,
+ NTCREATEX_SHARE_ACCESS_DELETE, NTCREATEX_DISP_OVERWRITE_IF,
+ NTCREATEX_OPTIONS_DELETE_ON_CLOSE, 0);
if (fnum1 == -1) {
printf("(%s) open of %s failed (%s)\n",
@@ -80,9 +83,10 @@ BOOL torture_test_delete(void)
smbcli_setatr(cli1->tree, fname, 0, 0);
smbcli_unlink(cli1->tree, fname);
- fnum1 = smbcli_nt_create_full(cli1->tree, fname, 0, GENERIC_RIGHTS_FILE_ALL_ACCESS,
- FILE_ATTRIBUTE_NORMAL, NTCREATEX_SHARE_ACCESS_NONE,
- NTCREATEX_DISP_OVERWRITE_IF, 0, 0);
+ fnum1 = smbcli_nt_create_full(cli1->tree, fname, 0,
+ SEC_RIGHTS_FULL_CONTROL,
+ FILE_ATTRIBUTE_NORMAL, NTCREATEX_SHARE_ACCESS_NONE,
+ NTCREATEX_DISP_OVERWRITE_IF, 0, 0);
if (fnum1 == -1) {
printf("(%s) open of %s failed (%s)\n",
@@ -124,7 +128,7 @@ BOOL torture_test_delete(void)
smbcli_unlink(cli1->tree, fname);
fnum1 = smbcli_nt_create_full(cli1->tree, fname, 0,
- GENERIC_RIGHTS_FILE_ALL_ACCESS,
+ SEC_RIGHTS_FULL_CONTROL,
FILE_ATTRIBUTE_NORMAL,
NTCREATEX_SHARE_ACCESS_READ|NTCREATEX_SHARE_ACCESS_WRITE,
NTCREATEX_DISP_OVERWRITE_IF, 0, 0);
@@ -140,7 +144,7 @@ BOOL torture_test_delete(void)
with SHARE_DELETE. */
fnum2 = smbcli_nt_create_full(cli1->tree, fname, 0,
- GENERIC_RIGHTS_FILE_READ,
+ SEC_RIGHTS_FILE_READ,
FILE_ATTRIBUTE_NORMAL,
NTCREATEX_SHARE_ACCESS_READ|NTCREATEX_SHARE_ACCESS_WRITE,
NTCREATEX_DISP_OPEN, 0, 0);
@@ -154,8 +158,11 @@ BOOL torture_test_delete(void)
/* This should succeed. */
- fnum2 = smbcli_nt_create_full(cli1->tree, fname, 0, GENERIC_RIGHTS_FILE_READ, FILE_ATTRIBUTE_NORMAL,
- NTCREATEX_SHARE_ACCESS_READ|NTCREATEX_SHARE_ACCESS_WRITE|NTCREATEX_SHARE_ACCESS_DELETE, NTCREATEX_DISP_OPEN, 0, 0);
+ fnum2 = smbcli_nt_create_full(cli1->tree, fname, 0,
+ SEC_RIGHTS_FILE_READ,
+ FILE_ATTRIBUTE_NORMAL,
+ NTCREATEX_SHARE_ACCESS_READ|NTCREATEX_SHARE_ACCESS_WRITE|NTCREATEX_SHARE_ACCESS_DELETE,
+ NTCREATEX_DISP_OPEN, 0, 0);
if (fnum2 == -1) {
printf("(%s) open - 2 of %s failed (%s)\n",
@@ -211,12 +218,12 @@ BOOL torture_test_delete(void)
}
fnum1 = smbcli_nt_create_full(cli1->tree, fname, 0,
- SA_RIGHT_FILE_READ_DATA |
- SA_RIGHT_FILE_WRITE_DATA |
- STD_RIGHT_DELETE_ACCESS,
- FILE_ATTRIBUTE_NORMAL,
- NTCREATEX_SHARE_ACCESS_READ|NTCREATEX_SHARE_ACCESS_WRITE,
- NTCREATEX_DISP_OVERWRITE_IF, 0, 0);
+ SEC_FILE_READ_DATA |
+ SEC_FILE_WRITE_DATA |
+ SEC_STD_DELETE,
+ FILE_ATTRIBUTE_NORMAL,
+ NTCREATEX_SHARE_ACCESS_READ|NTCREATEX_SHARE_ACCESS_WRITE,
+ NTCREATEX_DISP_OVERWRITE_IF, 0, 0);
if (fnum1 == -1) {
printf("(%s) open of %s failed (%s)\n",
@@ -226,7 +233,8 @@ BOOL torture_test_delete(void)
}
/* This should succeed. */
- fnum2 = smbcli_nt_create_full(cli1->tree, fname, 0, GENERIC_RIGHTS_FILE_READ,
+ fnum2 = smbcli_nt_create_full(cli1->tree, fname, 0,
+ SEC_RIGHTS_FILE_READ,
FILE_ATTRIBUTE_NORMAL,
NTCREATEX_SHARE_ACCESS_READ |
NTCREATEX_SHARE_ACCESS_WRITE |
@@ -255,7 +263,7 @@ BOOL torture_test_delete(void)
/* This should fail - no more opens once delete on close set. */
fnum2 = smbcli_nt_create_full(cli1->tree, fname, 0,
- GENERIC_RIGHTS_FILE_READ,
+ SEC_RIGHTS_FILE_READ,
FILE_ATTRIBUTE_NORMAL,
NTCREATEX_SHARE_ACCESS_READ|NTCREATEX_SHARE_ACCESS_WRITE|NTCREATEX_SHARE_ACCESS_DELETE,
NTCREATEX_DISP_OPEN, 0, 0);
@@ -309,7 +317,7 @@ BOOL torture_test_delete(void)
smbcli_unlink(cli1->tree, fname);
fnum1 = smbcli_nt_create_full(cli1->tree, fname, 0,
- SA_RIGHT_FILE_READ_DATA | SA_RIGHT_FILE_WRITE_DATA,
+ SEC_FILE_READ_DATA | SEC_FILE_WRITE_DATA,
FILE_ATTRIBUTE_NORMAL,
NTCREATEX_SHARE_ACCESS_READ |
NTCREATEX_SHARE_ACCESS_WRITE |
@@ -346,10 +354,11 @@ BOOL torture_test_delete(void)
smbcli_unlink(cli1->tree, fname);
fnum1 = smbcli_nt_create_full(cli1->tree, fname, 0,
- SA_RIGHT_FILE_READ_DATA |
- SA_RIGHT_FILE_WRITE_DATA |
- STD_RIGHT_DELETE_ACCESS,
- FILE_ATTRIBUTE_NORMAL, 0, NTCREATEX_DISP_OVERWRITE_IF, 0, 0);
+ SEC_FILE_READ_DATA |
+ SEC_FILE_WRITE_DATA |
+ SEC_STD_DELETE,
+ FILE_ATTRIBUTE_NORMAL, 0,
+ NTCREATEX_DISP_OVERWRITE_IF, 0, 0);
if (fnum1 == -1) {
printf("(%s) open of %s failed (%s)\n",
@@ -409,9 +418,13 @@ BOOL torture_test_delete(void)
goto fail;
}
- fnum1 = smbcli_nt_create_full(cli1->tree, fname, 0, SA_RIGHT_FILE_READ_DATA|SA_RIGHT_FILE_WRITE_DATA|STD_RIGHT_DELETE_ACCESS,
- FILE_ATTRIBUTE_NORMAL, NTCREATEX_SHARE_ACCESS_READ|NTCREATEX_SHARE_ACCESS_WRITE|NTCREATEX_SHARE_ACCESS_DELETE,
- NTCREATEX_DISP_OVERWRITE_IF, 0, 0);
+ fnum1 = smbcli_nt_create_full(cli1->tree, fname, 0,
+ SEC_FILE_READ_DATA|
+ SEC_FILE_WRITE_DATA|
+ SEC_STD_DELETE,
+ FILE_ATTRIBUTE_NORMAL,
+ NTCREATEX_SHARE_ACCESS_READ|NTCREATEX_SHARE_ACCESS_WRITE|NTCREATEX_SHARE_ACCESS_DELETE,
+ NTCREATEX_DISP_OVERWRITE_IF, 0, 0);
if (fnum1 == -1) {
printf("(%s) open of %s failed (%s)\n",
@@ -420,9 +433,13 @@ BOOL torture_test_delete(void)
goto fail;
}
- fnum2 = smbcli_nt_create_full(cli2->tree, fname, 0, SA_RIGHT_FILE_READ_DATA|SA_RIGHT_FILE_WRITE_DATA|STD_RIGHT_DELETE_ACCESS,
- FILE_ATTRIBUTE_NORMAL, NTCREATEX_SHARE_ACCESS_READ|NTCREATEX_SHARE_ACCESS_WRITE|NTCREATEX_SHARE_ACCESS_DELETE,
- NTCREATEX_DISP_OPEN, 0, 0);
+ fnum2 = smbcli_nt_create_full(cli2->tree, fname, 0,
+ SEC_FILE_READ_DATA|
+ SEC_FILE_WRITE_DATA|
+ SEC_STD_DELETE,
+ FILE_ATTRIBUTE_NORMAL,
+ NTCREATEX_SHARE_ACCESS_READ|NTCREATEX_SHARE_ACCESS_WRITE|NTCREATEX_SHARE_ACCESS_DELETE,
+ NTCREATEX_DISP_OPEN, 0, 0);
if (fnum2 == -1) {
printf("(%s) open of %s failed (%s)\n",
@@ -464,7 +481,7 @@ BOOL torture_test_delete(void)
/* This should fail - we need to set DELETE_ACCESS. */
fnum1 = smbcli_nt_create_full(cli1->tree, fname, 0,
- SA_RIGHT_FILE_READ_DATA|SA_RIGHT_FILE_WRITE_DATA,
+ SEC_FILE_READ_DATA|SEC_FILE_WRITE_DATA,
FILE_ATTRIBUTE_NORMAL,
NTCREATEX_SHARE_ACCESS_NONE,
NTCREATEX_DISP_OVERWRITE_IF,
@@ -480,7 +497,9 @@ BOOL torture_test_delete(void)
printf("ninth delete on close test succeeded.\n");
fnum1 = smbcli_nt_create_full(cli1->tree, fname, 0,
- SA_RIGHT_FILE_READ_DATA|SA_RIGHT_FILE_WRITE_DATA|STD_RIGHT_DELETE_ACCESS,
+ SEC_FILE_READ_DATA|
+ SEC_FILE_WRITE_DATA|
+ SEC_STD_DELETE,
FILE_ATTRIBUTE_NORMAL,
NTCREATEX_SHARE_ACCESS_NONE,
NTCREATEX_DISP_OVERWRITE_IF,
@@ -514,9 +533,9 @@ BOOL torture_test_delete(void)
smbcli_setatr(cli1->tree, fname, 0, 0);
smbcli_unlink(cli1->tree, fname);
-
+
fnum1 = smbcli_nt_create_full(cli1->tree, fname, 0,
- GENERIC_RIGHTS_FILE_ALL_ACCESS,
+ SEC_RIGHTS_FULL_CONTROL,
FILE_ATTRIBUTE_READONLY,
NTCREATEX_SHARE_ACCESS_NONE,
NTCREATEX_DISP_OVERWRITE_IF, 0, 0);
@@ -551,9 +570,11 @@ BOOL torture_test_delete(void)
/* test 12 - does having read only attribute still allow delete on close at time of open. */
- fnum1 = smbcli_nt_create_full(cli1->tree, fname, 0, GENERIC_RIGHTS_FILE_ALL_ACCESS, FILE_ATTRIBUTE_READONLY,
- NTCREATEX_SHARE_ACCESS_DELETE, NTCREATEX_DISP_OVERWRITE_IF,
- NTCREATEX_OPTIONS_DELETE_ON_CLOSE, 0);
+ fnum1 = smbcli_nt_create_full(cli1->tree, fname, 0,
+ SEC_RIGHTS_FULL_CONTROL,
+ FILE_ATTRIBUTE_READONLY,
+ NTCREATEX_SHARE_ACCESS_DELETE, NTCREATEX_DISP_OVERWRITE_IF,
+ NTCREATEX_OPTIONS_DELETE_ON_CLOSE, 0);
if (fnum1 != -1) {
printf("(%s) open of %s succeeded. Should fail with NT_STATUS_CANNOT_DELETE.\n",
diff --git a/source4/torture/basic/denytest.c b/source4/torture/basic/denytest.c
index 8373e786fe..70d7a2b2a1 100644
--- a/source4/torture/basic/denytest.c
+++ b/source4/torture/basic/denytest.c
@@ -20,6 +20,7 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
+#include "librpc/gen_ndr/ndr_security.h"
extern BOOL torture_showall;
extern int torture_failures;
@@ -1699,49 +1700,53 @@ static NTSTATUS predict_share_conflict(uint32_t sa1, uint32_t am1, uint32_t sa2,
}} while (0)
*res = A_0;
- if (am2 & SA_RIGHT_FILE_WRITE_APPEND) {
+ if (am2 & (SEC_FILE_WRITE_DATA | SEC_FILE_APPEND_DATA)) {
*res += A_W;
}
- if (am2 & SA_RIGHT_FILE_READ_DATA) {
+ if (am2 & SEC_FILE_READ_DATA) {
*res += A_R;
- } else if ((am2 & SA_RIGHT_FILE_EXECUTE) &&
+ } else if ((am2 & SEC_FILE_EXECUTE) &&
(flags2 & FLAGS2_READ_PERMIT_EXECUTE)) {
*res += A_R;
}
/* if either open involves no read.write or delete access then
it can't conflict */
- if (!(am1 & (SA_RIGHT_FILE_WRITE_APPEND |
- SA_RIGHT_FILE_READ_EXEC |
- STD_RIGHT_DELETE_ACCESS))) {
+ if (!(am1 & (SEC_FILE_WRITE_DATA |
+ SEC_FILE_APPEND_DATA |
+ SEC_FILE_READ_DATA |
+ SEC_FILE_EXECUTE |
+ SEC_STD_DELETE))) {
return NT_STATUS_OK;
}
- if (!(am2 & (SA_RIGHT_FILE_WRITE_APPEND |
- SA_RIGHT_FILE_READ_EXEC |
- STD_RIGHT_DELETE_ACCESS))) {
+ if (!(am2 & (SEC_FILE_WRITE_DATA |
+ SEC_FILE_APPEND_DATA |
+ SEC_FILE_READ_DATA |
+ SEC_FILE_EXECUTE |
+ SEC_STD_DELETE))) {
return NT_STATUS_OK;
}
/* check the basic share access */
CHECK_MASK(am1, sa2,
- SA_RIGHT_FILE_WRITE_APPEND,
+ SEC_FILE_WRITE_DATA | SEC_FILE_APPEND_DATA,
NTCREATEX_SHARE_ACCESS_WRITE);
CHECK_MASK(am2, sa1,
- SA_RIGHT_FILE_WRITE_APPEND,
+ SEC_FILE_WRITE_DATA | SEC_FILE_APPEND_DATA,
NTCREATEX_SHARE_ACCESS_WRITE);
CHECK_MASK(am1, sa2,
- SA_RIGHT_FILE_READ_EXEC,
+ SEC_FILE_READ_DATA | SEC_FILE_EXECUTE,
NTCREATEX_SHARE_ACCESS_READ);
CHECK_MASK(am2, sa1,
- SA_RIGHT_FILE_READ_EXEC,
+ SEC_FILE_READ_DATA | SEC_FILE_EXECUTE,
NTCREATEX_SHARE_ACCESS_READ);
CHECK_MASK(am1, sa2,
- STD_RIGHT_DELETE_ACCESS,
+ SEC_STD_DELETE,
NTCREATEX_SHARE_ACCESS_DELETE);
CHECK_MASK(am2, sa1,
- STD_RIGHT_DELETE_ACCESS,
+ SEC_STD_DELETE,
NTCREATEX_SHARE_ACCESS_DELETE);
return NT_STATUS_OK;
@@ -1758,14 +1763,14 @@ static BOOL torture_ntdenytest(struct smbcli_state *cli1, struct smbcli_state *c
{ NTCREATEX_SHARE_ACCESS_DELETE, "S_D" }
};
const struct bit_value access_mask_bits[] = {
- { SA_RIGHT_FILE_READ_DATA, "R_DATA" },
- { SA_RIGHT_FILE_WRITE_DATA, "W_DATA" },
- { SA_RIGHT_FILE_READ_ATTRIBUTES, "R_ATTR" },
- { SA_RIGHT_FILE_WRITE_ATTRIBUTES, "W_ATTR" },
- { SA_RIGHT_FILE_READ_EA, "R_EAS " },
- { SA_RIGHT_FILE_WRITE_EA, "W_EAS " },
- { SA_RIGHT_FILE_APPEND_DATA, "A_DATA" },
- { SA_RIGHT_FILE_EXECUTE, "EXEC " }
+ { SEC_FILE_READ_DATA, "R_DATA" },
+ { SEC_FILE_WRITE_DATA, "W_DATA" },
+ { SEC_FILE_READ_ATTRIBUTE, "R_ATTR" },
+ { SEC_FILE_WRITE_ATTRIBUTE, "W_ATTR" },
+ { SEC_FILE_READ_EA, "R_EAS " },
+ { SEC_FILE_WRITE_EA, "W_EAS " },
+ { SEC_FILE_APPEND_DATA, "A_DATA" },
+ { SEC_FILE_EXECUTE, "EXEC " }
};
int fnum1;
int i;
diff --git a/source4/torture/basic/dir.c b/source4/torture/basic/dir.c
index 6e2e21fc08..0f962e6cf1 100644
--- a/source4/torture/basic/dir.c
+++ b/source4/torture/basic/dir.c
@@ -21,6 +21,7 @@
*/
#include "includes.h"
+#include "librpc/gen_ndr/ndr_security.h"
static void list_fn(struct file_info *finfo, const char *name, void *state)
{
@@ -109,8 +110,11 @@ BOOL torture_dirtest2(void)
for (i=0;i<torture_entries;i++) {
char *fname;
asprintf(&fname, "\\LISTDIR\\f%d", i);
- fnum = smbcli_nt_create_full(cli->tree, fname, 0, GENERIC_RIGHTS_FILE_ALL_ACCESS, FILE_ATTRIBUTE_ARCHIVE,
- NTCREATEX_SHARE_ACCESS_READ|NTCREATEX_SHARE_ACCESS_WRITE, NTCREATEX_DISP_OVERWRITE_IF, 0, 0);
+ fnum = smbcli_nt_create_full(cli->tree, fname, 0,
+ SEC_RIGHTS_FULL_CONTROL,
+ FILE_ATTRIBUTE_ARCHIVE,
+ NTCREATEX_SHARE_ACCESS_READ|NTCREATEX_SHARE_ACCESS_WRITE,
+ NTCREATEX_DISP_OVERWRITE_IF, 0, 0);
if (fnum == -1) {
fprintf(stderr,"(%s) Failed to open %s, error=%s\n",
__location__, fname, smbcli_errstr(cli->tree));
diff --git a/source4/torture/basic/disconnect.c b/source4/torture/basic/disconnect.c
index a225178b96..898fc41b4e 100644
--- a/source4/torture/basic/disconnect.c
+++ b/source4/torture/basic/disconnect.c
@@ -22,6 +22,7 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
+#include "librpc/gen_ndr/ndr_security.h"
#define BASEDIR "\\test_disconnect"
@@ -47,7 +48,7 @@ static BOOL test_disconnect_open(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
io.generic.level = RAW_OPEN_NTCREATEX;
io.ntcreatex.in.root_fid = 0;
io.ntcreatex.in.flags = 0;
- io.ntcreatex.in.access_mask = SA_RIGHT_FILE_READ_DATA;
+ io.ntcreatex.in.access_mask = SEC_FILE_READ_DATA;
io.ntcreatex.in.create_options = 0;
io.ntcreatex.in.file_attr = FILE_ATTRIBUTE_NORMAL;
io.ntcreatex.in.share_access = NTCREATEX_SHARE_ACCESS_READ;
diff --git a/source4/torture/basic/rename.c b/source4/torture/basic/rename.c
index e26c85b5df..3f7be04a8e 100644
--- a/source4/torture/basic/rename.c
+++ b/source4/torture/basic/rename.c
@@ -21,6 +21,7 @@
*/
#include "includes.h"
+#include "librpc/gen_ndr/ndr_security.h"
/*
Test rename on files open with share delete and no share delete.
@@ -42,7 +43,7 @@ BOOL torture_test_rename(void)
smbcli_unlink(cli1->tree, fname);
smbcli_unlink(cli1->tree, fname1);
fnum1 = smbcli_nt_create_full(cli1->tree, fname, 0,
- GENERIC_RIGHTS_FILE_READ,
+ SEC_RIGHTS_FILE_READ,
FILE_ATTRIBUTE_NORMAL,
NTCREATEX_SHARE_ACCESS_READ,
NTCREATEX_DISP_OVERWRITE_IF, 0, 0);
@@ -69,7 +70,7 @@ BOOL torture_test_rename(void)
smbcli_unlink(cli1->tree, fname);
smbcli_unlink(cli1->tree, fname1);
fnum1 = smbcli_nt_create_full(cli1->tree, fname, 0,
- GENERIC_RIGHTS_FILE_READ,
+ SEC_RIGHTS_FILE_READ,
FILE_ATTRIBUTE_NORMAL,
NTCREATEX_SHARE_ACCESS_DELETE|NTCREATEX_SHARE_ACCESS_READ,
NTCREATEX_DISP_OVERWRITE_IF, 0, 0);
@@ -97,7 +98,7 @@ BOOL torture_test_rename(void)
smbcli_unlink(cli1->tree, fname1);
fnum1 = smbcli_nt_create_full(cli1->tree, fname, 0,
- STD_RIGHT_READ_CONTROL_ACCESS,
+ SEC_STD_READ_CONTROL,
FILE_ATTRIBUTE_NORMAL,
NTCREATEX_SHARE_ACCESS_NONE,
NTCREATEX_DISP_OVERWRITE_IF, 0, 0);
diff --git a/source4/torture/basic/scanner.c b/source4/torture/basic/scanner.c
index ad4220b9ad..08a870334d 100644
--- a/source4/torture/basic/scanner.c
+++ b/source4/torture/basic/scanner.c
@@ -20,6 +20,7 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
+#include "librpc/gen_ndr/ndr_security.h"
#define VERBOSE 0
#define OP_MIN 0
@@ -255,10 +256,12 @@ BOOL torture_trans2_scan(void)
printf("file open failed - %s\n", smbcli_errstr(cli->tree));
}
dnum = smbcli_nt_create_full(cli->tree, "\\",
- 0, GENERIC_RIGHTS_FILE_READ, FILE_ATTRIBUTE_NORMAL,
- NTCREATEX_SHARE_ACCESS_READ | NTCREATEX_SHARE_ACCESS_WRITE,
- NTCREATEX_DISP_OPEN,
- NTCREATEX_OPTIONS_DIRECTORY, 0);
+ 0,
+ SEC_RIGHTS_FILE_READ,
+ FILE_ATTRIBUTE_NORMAL,
+ NTCREATEX_SHARE_ACCESS_READ | NTCREATEX_SHARE_ACCESS_WRITE,
+ NTCREATEX_DISP_OPEN,
+ NTCREATEX_OPTIONS_DIRECTORY, 0);
if (dnum == -1) {
printf("directory open failed - %s\n", smbcli_errstr(cli->tree));
}
diff --git a/source4/torture/basic/unlink.c b/source4/torture/basic/unlink.c
index dd2ff5a5c5..3fe0ea8f28 100644
--- a/source4/torture/basic/unlink.c
+++ b/source4/torture/basic/unlink.c
@@ -22,6 +22,7 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
+#include "librpc/gen_ndr/ndr_security.h"
/*
This test checks that
@@ -81,7 +82,7 @@ BOOL torture_unlinktest(void)
io.ntcreatex.in.security_flags = 0;
io.ntcreatex.in.fname = fname;
io.ntcreatex.in.share_access = NTCREATEX_SHARE_ACCESS_DELETE;
- io.ntcreatex.in.access_mask = GENERIC_RIGHTS_FILE_ALL_ACCESS;
+ io.ntcreatex.in.access_mask = SEC_RIGHTS_FULL_CONTROL;
status = smb_raw_open(cli->tree, cli, &io);
if (!NT_STATUS_IS_OK(status)) {
diff --git a/source4/torture/basic/utable.c b/source4/torture/basic/utable.c
index 30d389dd92..dcd00b9fbb 100644
--- a/source4/torture/basic/utable.c
+++ b/source4/torture/basic/utable.c
@@ -20,6 +20,7 @@
#include "includes.h"
#include "system/iconv.h"
+#include "librpc/gen_ndr/ndr_security.h"
BOOL torture_utable(void)
{
@@ -148,13 +149,13 @@ BOOL torture_casetable(void)
fname = form_name(c);
fnum = smbcli_nt_create_full(cli->tree, fname, 0,
#if 0
- SEC_RIGHT_MAXIMUM_ALLOWED,
+ SEC_RIGHT_MAXIMUM_ALLOWED,
#else
- GENERIC_RIGHTS_FILE_ALL_ACCESS,
+ SEC_RIGHTS_FULL_CONTROL,
#endif
- FILE_ATTRIBUTE_NORMAL,
- NTCREATEX_SHARE_ACCESS_NONE,
- NTCREATEX_DISP_OPEN_IF, 0, 0);
+ FILE_ATTRIBUTE_NORMAL,
+ NTCREATEX_SHARE_ACCESS_NONE,
+ NTCREATEX_DISP_OPEN_IF, 0, 0);
if (fnum == -1) {
printf("Failed to create file with char %04x\n", c);