summaryrefslogtreecommitdiff
path: root/source4/torture/raw
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-11-18 01:41:43 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:05:57 -0500
commit012be92f0a771d8437f783dc8ed14f38c669893c (patch)
tree13a87d0d0fdec7bf691a1767151915831d89f7d8 /source4/torture/raw
parentbbf009b46f75f292a625b853b9331b5d5e0da7c2 (diff)
downloadsamba-012be92f0a771d8437f783dc8ed14f38c669893c.tar.gz
samba-012be92f0a771d8437f783dc8ed14f38c669893c.tar.bz2
samba-012be92f0a771d8437f783dc8ed14f38c669893c.zip
r3830: unified the query/set security descriptor code with the rest of the
queryfileinfo/setfileinfo logic, so querying/setting a security descriptor is treated as just another file query/set operation. This will allow NTVFS backends to see the query/set security descriptor operations as RAW_FILEINFO_SEC_DESC and RAW_SFILEINFO_SEC_DESC operations. (This used to be commit f68a6b6b915c37e48c42390c1e74c2d1c2636fa9)
Diffstat (limited to 'source4/torture/raw')
-rw-r--r--source4/torture/raw/acls.c38
1 files changed, 20 insertions, 18 deletions
diff --git a/source4/torture/raw/acls.c b/source4/torture/raw/acls.c
index 1562af55ca..6c88b60855 100644
--- a/source4/torture/raw/acls.c
+++ b/source4/torture/raw/acls.c
@@ -42,8 +42,8 @@ static BOOL test_sd(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
const char *fname = BASEDIR "\\sd.txt";
BOOL ret = True;
int fnum;
- struct smb_query_secdesc q;
- struct smb_set_secdesc set;
+ union smb_fileinfo q;
+ union smb_setfileinfo set;
struct security_ace ace;
struct security_descriptor *sd;
struct dom_sid *test_sid;
@@ -67,15 +67,16 @@ static BOOL test_sd(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
status = smb_raw_open(cli->tree, mem_ctx, &io);
CHECK_STATUS(status, NT_STATUS_OK);
fnum = io.ntcreatex.out.fnum;
-
- q.in.fnum = fnum;
- q.in.secinfo_flags =
+
+ q.query_secdesc.level = RAW_FILEINFO_SEC_DESC;
+ q.query_secdesc.in.fnum = fnum;
+ q.query_secdesc.in.secinfo_flags =
OWNER_SECURITY_INFORMATION |
GROUP_SECURITY_INFORMATION |
DACL_SECURITY_INFORMATION;
- status = smb_raw_query_secdesc(cli->tree, mem_ctx, &q);
+ status = smb_raw_fileinfo(cli->tree, mem_ctx, &q);
CHECK_STATUS(status, NT_STATUS_OK);
- sd = q.out.sd;
+ sd = q.query_secdesc.out.sd;
printf("add a new ACE to the DACL\n");
@@ -89,20 +90,21 @@ static BOOL test_sd(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
status = security_descriptor_dacl_add(sd, &ace);
CHECK_STATUS(status, NT_STATUS_OK);
- set.in.fnum = fnum;
- set.in.secinfo_flags = q.in.secinfo_flags;
- set.in.sd = sd;
+ set.set_secdesc.level = RAW_SFILEINFO_SEC_DESC;
+ set.set_secdesc.file.fnum = fnum;
+ set.set_secdesc.in.secinfo_flags = q.query_secdesc.in.secinfo_flags;
+ set.set_secdesc.in.sd = sd;
- status = smb_raw_set_secdesc(cli->tree, &set);
+ status = smb_raw_setfileinfo(cli->tree, &set);
CHECK_STATUS(status, NT_STATUS_OK);
- status = smb_raw_query_secdesc(cli->tree, mem_ctx, &q);
+ status = smb_raw_fileinfo(cli->tree, mem_ctx, &q);
CHECK_STATUS(status, NT_STATUS_OK);
- if (!security_descriptor_equal(q.out.sd, sd)) {
+ if (!security_descriptor_equal(q.query_secdesc.out.sd, sd)) {
printf("security descriptors don't match!\n");
printf("got:\n");
- NDR_PRINT_DEBUG(security_descriptor, q.out.sd);
+ NDR_PRINT_DEBUG(security_descriptor, q.query_secdesc.out.sd);
printf("expected:\n");
NDR_PRINT_DEBUG(security_descriptor, sd);
}
@@ -112,16 +114,16 @@ static BOOL test_sd(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
status = security_descriptor_dacl_del(sd, test_sid);
CHECK_STATUS(status, NT_STATUS_OK);
- status = smb_raw_set_secdesc(cli->tree, &set);
+ status = smb_raw_setfileinfo(cli->tree, &set);
CHECK_STATUS(status, NT_STATUS_OK);
- status = smb_raw_query_secdesc(cli->tree, mem_ctx, &q);
+ status = smb_raw_fileinfo(cli->tree, mem_ctx, &q);
CHECK_STATUS(status, NT_STATUS_OK);
- if (!security_descriptor_equal(q.out.sd, sd)) {
+ if (!security_descriptor_equal(q.query_secdesc.out.sd, sd)) {
printf("security descriptors don't match!\n");
printf("got:\n");
- NDR_PRINT_DEBUG(security_descriptor, q.out.sd);
+ NDR_PRINT_DEBUG(security_descriptor, q.query_secdesc.out.sd);
printf("expected:\n");
NDR_PRINT_DEBUG(security_descriptor, sd);
}