summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/librpc/idl/srvsvc.idl5
-rw-r--r--source4/rpc_server/srvsvc/dcesrv_srvsvc.c22
-rw-r--r--source4/torture/rpc/srvsvc.c28
3 files changed, 34 insertions, 21 deletions
diff --git a/source4/librpc/idl/srvsvc.idl b/source4/librpc/idl/srvsvc.idl
index e3b1833e92..b8808325bc 100644
--- a/source4/librpc/idl/srvsvc.idl
+++ b/source4/librpc/idl/srvsvc.idl
@@ -214,10 +214,9 @@ import "security.idl", "svcctl.idl";
WERROR srvsvc_NetConnEnum(
[in,unique] [string,charset(UTF16)] uint16 *server_unc,
[in,unique] [string,charset(UTF16)] uint16 *path,
- [in,out] uint32 level,
- [in,out,switch_is(level)] srvsvc_NetConnCtr ctr,
+ [in,out,ref] srvsvc_NetConnInfoCtr *info_ctr,
[in] uint32 max_buffer,
- [out] uint32 totalentries,
+ [out,ref] uint32 *totalentries,
[in,out,unique] uint32 *resume_handle
);
diff --git a/source4/rpc_server/srvsvc/dcesrv_srvsvc.c b/source4/rpc_server/srvsvc/dcesrv_srvsvc.c
index 5acddbc8ba..103efa5f23 100644
--- a/source4/rpc_server/srvsvc/dcesrv_srvsvc.c
+++ b/source4/rpc_server/srvsvc/dcesrv_srvsvc.c
@@ -226,28 +226,26 @@ static WERROR dcesrv_srvsvc_NetCharDevQPurgeSelf(struct dcesrv_call_state *dce_c
static WERROR dcesrv_srvsvc_NetConnEnum(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
struct srvsvc_NetConnEnum *r)
{
- r->out.level = r->in.level;
- r->out.totalentries = 0;
- r->out.resume_handle = NULL;
+ *r->out.totalentries = 0;
- switch (r->in.level) {
+ switch (r->in.info_ctr->level) {
case 0:
{
- r->out.ctr.ctr0 = talloc(mem_ctx, struct srvsvc_NetConnCtr0);
- W_ERROR_HAVE_NO_MEMORY(r->out.ctr.ctr0);
+ r->out.info_ctr->ctr.ctr0 = talloc(mem_ctx, struct srvsvc_NetConnCtr0);
+ W_ERROR_HAVE_NO_MEMORY(r->out.info_ctr->ctr.ctr0);
- r->out.ctr.ctr0->count = 0;
- r->out.ctr.ctr0->array = NULL;
+ r->out.info_ctr->ctr.ctr0->count = 0;
+ r->out.info_ctr->ctr.ctr0->array = NULL;
return WERR_NOT_SUPPORTED;
}
case 1:
{
- r->out.ctr.ctr1 = talloc(mem_ctx, struct srvsvc_NetConnCtr1);
- W_ERROR_HAVE_NO_MEMORY(r->out.ctr.ctr1);
+ r->out.info_ctr->ctr.ctr1 = talloc(mem_ctx, struct srvsvc_NetConnCtr1);
+ W_ERROR_HAVE_NO_MEMORY(r->out.info_ctr->ctr.ctr1);
- r->out.ctr.ctr1->count = 0;
- r->out.ctr.ctr1->array = NULL;
+ r->out.info_ctr->ctr.ctr1->count = 0;
+ r->out.info_ctr->ctr.ctr1->array = NULL;
return WERR_NOT_SUPPORTED;
}
diff --git a/source4/torture/rpc/srvsvc.c b/source4/torture/rpc/srvsvc.c
index cda2d44e71..b6f2f8a49e 100644
--- a/source4/torture/rpc/srvsvc.c
+++ b/source4/torture/rpc/srvsvc.c
@@ -291,22 +291,38 @@ static bool test_NetConnEnum(struct torture_context *tctx,
{
NTSTATUS status;
struct srvsvc_NetConnEnum r;
+ struct srvsvc_NetConnInfoCtr info_ctr;
struct srvsvc_NetConnCtr0 c0;
+ struct srvsvc_NetConnCtr1 c1;
+ uint32_t totalentries = 0;
uint32_t levels[] = {0, 1};
int i;
+ ZERO_STRUCT(info_ctr);
+
r.in.server_unc = talloc_asprintf(tctx,"\\\\%s",dcerpc_server_name(p));
r.in.path = talloc_asprintf(tctx,"%s","ADMIN$");
- r.in.ctr.ctr0 = &c0;
- r.in.ctr.ctr0->count = 0;
- r.in.ctr.ctr0->array = NULL;
+ r.in.info_ctr = &info_ctr;
r.in.max_buffer = (uint32_t)-1;
r.in.resume_handle = NULL;
+ r.out.totalentries = &totalentries;
+ r.out.info_ctr = &info_ctr;
for (i=0;i<ARRAY_SIZE(levels);i++) {
- ZERO_STRUCT(r.out);
- r.in.level = levels[i];
- torture_comment(tctx, "testing NetConnEnum level %u\n", r.in.level);
+ info_ctr.level = levels[i];
+
+ switch (info_ctr.level) {
+ case 0:
+ ZERO_STRUCT(c0);
+ info_ctr.ctr.ctr0 = &c0;
+ break;
+ case 1:
+ ZERO_STRUCT(c1);
+ info_ctr.ctr.ctr1 = &c1;
+ break;
+ }
+
+ torture_comment(tctx, "testing NetConnEnum level %u\n", info_ctr.level);
status = dcerpc_srvsvc_NetConnEnum(p, tctx, &r);
torture_assert_ntstatus_ok(tctx, status, "NetConnEnum failed");
if (!W_ERROR_IS_OK(r.out.result)) {