summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2010-09-20 17:41:18 -0700
committerGünther Deschner <gd@samba.org>2010-09-20 17:41:18 -0700
commitc201e494c476e3245f887c4491a909126d1c3333 (patch)
treef484812c2d6bfbb73e40c945fb07cbd7b3e02e4a /source4/torture
parent1585c4df68a66569524a41def95488666dd827dd (diff)
downloadsamba-c201e494c476e3245f887c4491a909126d1c3333.tar.gz
samba-c201e494c476e3245f887c4491a909126d1c3333.tar.bz2
samba-c201e494c476e3245f887c4491a909126d1c3333.zip
s4-smbtorture: print SVCCTL security descriptor in test_QueryServiceObjectSecurity().
Guenther
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/rpc/svcctl.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/source4/torture/rpc/svcctl.c b/source4/torture/rpc/svcctl.c
index 5ad678fe0e..5c4f803e05 100644
--- a/source4/torture/rpc/svcctl.c
+++ b/source4/torture/rpc/svcctl.c
@@ -22,6 +22,7 @@
#include "includes.h"
#include "librpc/gen_ndr/ndr_svcctl_c.h"
#include "librpc/gen_ndr/ndr_svcctl.h"
+#include "librpc/gen_ndr/ndr_security.h"
#include "torture/rpc/torture_rpc.h"
#include "param/param.h"
@@ -280,6 +281,10 @@ static bool test_QueryServiceObjectSecurity(struct torture_context *tctx,
uint8_t *buffer;
uint32_t needed;
+ enum ndr_err_code ndr_err;
+ struct security_descriptor sd;
+ DATA_BLOB blob;
+
if (!test_OpenSCManager(b, tctx, &h))
return false;
@@ -315,6 +320,18 @@ static bool test_QueryServiceObjectSecurity(struct torture_context *tctx,
torture_assert_werr_ok(tctx, r.out.result, "QueryServiceObjectSecurity failed!");
+ blob = data_blob_const(buffer, needed);
+
+ ndr_err = ndr_pull_struct_blob(&blob, tctx, &sd,
+ (ndr_pull_flags_fn_t)ndr_pull_security_descriptor);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 1) {
+ NDR_PRINT_DEBUG(security_descriptor, &sd);
+ }
+
if (!test_CloseServiceHandle(b, tctx, &s))
return false;