/******************/
/* Function: 0x03 */
- NTSTATUS samr_QuerySecurity ();
+ NTSTATUS samr_QuerySecurity (
+ [in,ref] policy_handle *handle,
+ [in] uint32 sec_info,
+ [out] uint32 *length,
+ [out,subcontext] security_descriptor *sd
+ );
/******************/
/* Function: 0x04 */
NTSTATUS ndr_push_samr_QuerySecurity(struct ndr_push *ndr, struct samr_QuerySecurity *r)
{
+ NDR_CHECK(ndr_push_policy_handle(ndr, r->in.handle));
+ NDR_CHECK(ndr_push_uint32(ndr, r->in.sec_info));
return NT_STATUS_OK;
}
NTSTATUS ndr_pull_samr_QuerySecurity(struct ndr_pull *ndr, struct samr_QuerySecurity *r)
{
+ uint32 _ptr_length;
+ uint32 _ptr_sd;
+ NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_length));
+ if (_ptr_length) {
+ NDR_ALLOC(ndr, r->out.length);
+ } else {
+ r->out.length = NULL;
+ }
+ if (r->out.length) {
+ NDR_CHECK(ndr_pull_uint32(ndr, r->out.length));
+ }
+ NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_sd));
+ if (_ptr_sd) {
+ NDR_ALLOC(ndr, r->out.sd);
+ } else {
+ r->out.sd = NULL;
+ }
+ if (r->out.sd) {
+ NDR_CHECK(ndr_pull_subcontext_flags_fn(ndr, r->out.sd, (ndr_pull_flags_fn_t) ndr_pull_security_descriptor));
+ }
NDR_CHECK(ndr_pull_NTSTATUS(ndr, &r->out.result));
return NT_STATUS_OK;
if (flags & NDR_IN) {
ndr_print_struct(ndr, "in", "samr_QuerySecurity");
ndr->depth++;
+ ndr_print_ptr(ndr, "handle", r->in.handle);
+ ndr->depth++;
+ ndr_print_policy_handle(ndr, "handle", r->in.handle);
+ ndr->depth--;
+ ndr_print_uint32(ndr, "sec_info", r->in.sec_info);
ndr->depth--;
}
if (flags & NDR_OUT) {
ndr_print_struct(ndr, "out", "samr_QuerySecurity");
ndr->depth++;
+ ndr_print_ptr(ndr, "length", r->out.length);
+ ndr->depth++;
+ if (r->out.length) {
+ ndr_print_uint32(ndr, "length", *r->out.length);
+ }
+ ndr->depth--;
+ ndr_print_ptr(ndr, "sd", r->out.sd);
+ ndr->depth++;
+ if (r->out.sd) {
+ ndr_print_security_descriptor(ndr, "sd", r->out.sd);
+ }
+ ndr->depth--;
ndr_print_NTSTATUS(ndr, "result", &r->out.result);
ndr->depth--;
}
struct samr_QuerySecurity {
struct {
+ struct policy_handle *handle;
+ uint32 sec_info;
} in;
struct {
+ uint32 *length;
+ struct security_descriptor *sd;
NTSTATUS result;
} out;
}
+static BOOL test_QuerySecurity(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
+ struct policy_handle *handle)
+{
+ NTSTATUS status;
+ struct samr_QuerySecurity r;
+
+ r.in.handle = handle;
+ r.in.sec_info = 7;
+
+ status = dcerpc_samr_QuerySecurity(p, mem_ctx, &r);
+ if (!NT_STATUS_IS_OK(status)) {
+ printf("QuerySecurity failed - %s\n", nt_errstr(status));
+ return False;
+ }
+
+ return True;
+}
+
static BOOL test_QueryAliasInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
struct policy_handle *handle)
return False;
}
+ if (!test_QuerySecurity(p, mem_ctx, &acct_handle)) {
+ ret = False;
+ }
+
if (!test_QueryUserInfo(p, mem_ctx, &acct_handle)) {
ret = False;
}
return False;
}
+ if (!test_QuerySecurity(p, mem_ctx, &acct_handle)) {
+ ret = False;
+ }
+
if (!test_QueryGroupInfo(p, mem_ctx, &acct_handle)) {
ret = False;
}
return False;
}
+ if (!test_QuerySecurity(p, mem_ctx, &acct_handle)) {
+ ret = False;
+ }
+
if (!test_QueryAliasInfo(p, mem_ctx, &acct_handle)) {
ret = False;
}
return False;
}
+ if (!test_QuerySecurity(p, mem_ctx, &domain_handle)) {
+ ret = False;
+ }
+
if (!test_QueryDomainInfo(p, mem_ctx, &domain_handle)) {
ret = False;
}
ret = False;
}
+ if (!test_QuerySecurity(p, mem_ctx, &handle)) {
+ ret = False;
+ }
+
if (!test_EnumDomains(p, mem_ctx, &handle)) {
ret = False;
}