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.c27
3 files changed, 33 insertions, 21 deletions
diff --git a/source4/librpc/idl/srvsvc.idl b/source4/librpc/idl/srvsvc.idl
index b8808325bc..a3b46c218a 100644
--- a/source4/librpc/idl/srvsvc.idl
+++ b/source4/librpc/idl/srvsvc.idl
@@ -268,10 +268,9 @@ import "security.idl", "svcctl.idl";
[in,unique] [string,charset(UTF16)] uint16 *server_unc,
[in,unique] [string,charset(UTF16)] uint16 *path,
[in,unique] [string,charset(UTF16)] uint16 *user,
- [in,out] uint32 level,
- [in,out,switch_is(level)] srvsvc_NetFileCtr ctr,
+ [in,out,ref] srvsvc_NetFileInfoCtr *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 103efa5f23..5827193a3f 100644
--- a/source4/rpc_server/srvsvc/dcesrv_srvsvc.c
+++ b/source4/rpc_server/srvsvc/dcesrv_srvsvc.c
@@ -263,28 +263,26 @@ static WERROR dcesrv_srvsvc_NetConnEnum(struct dcesrv_call_state *dce_call, TALL
static WERROR dcesrv_srvsvc_NetFileEnum(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
struct srvsvc_NetFileEnum *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 2:
{
- r->out.ctr.ctr2 = talloc(mem_ctx, struct srvsvc_NetFileCtr2);
- W_ERROR_HAVE_NO_MEMORY(r->out.ctr.ctr2);
+ r->out.info_ctr->ctr.ctr2 = talloc(mem_ctx, struct srvsvc_NetFileCtr2);
+ W_ERROR_HAVE_NO_MEMORY(r->out.info_ctr->ctr.ctr2);
- r->out.ctr.ctr2->count = 0;
- r->out.ctr.ctr2->array = NULL;
+ r->out.info_ctr->ctr.ctr2->count = 0;
+ r->out.info_ctr->ctr.ctr2->array = NULL;
return WERR_NOT_SUPPORTED;
}
case 3:
{
- r->out.ctr.ctr3 = talloc(mem_ctx, struct srvsvc_NetFileCtr3);
- W_ERROR_HAVE_NO_MEMORY(r->out.ctr.ctr3);
+ r->out.info_ctr->ctr.ctr3 = talloc(mem_ctx, struct srvsvc_NetFileCtr3);
+ W_ERROR_HAVE_NO_MEMORY(r->out.info_ctr->ctr.ctr3);
- r->out.ctr.ctr3->count = 0;
- r->out.ctr.ctr3->array = NULL;
+ r->out.info_ctr->ctr.ctr3->count = 0;
+ r->out.info_ctr->ctr.ctr3->array = NULL;
return WERR_NOT_SUPPORTED;
}
diff --git a/source4/torture/rpc/srvsvc.c b/source4/torture/rpc/srvsvc.c
index b6f2f8a49e..c3dd5b0e6f 100644
--- a/source4/torture/rpc/srvsvc.c
+++ b/source4/torture/rpc/srvsvc.c
@@ -341,23 +341,38 @@ static bool test_NetFileEnum(struct torture_context *tctx,
{
NTSTATUS status;
struct srvsvc_NetFileEnum r;
+ struct srvsvc_NetFileInfoCtr info_ctr;
+ struct srvsvc_NetFileCtr2 c2;
struct srvsvc_NetFileCtr3 c3;
+ uint32_t totalentries = 0;
uint32_t levels[] = {2, 3};
int i;
+ ZERO_STRUCT(info_ctr);
+
r.in.server_unc = talloc_asprintf(tctx,"\\\\%s",dcerpc_server_name(p));
r.in.path = NULL;
r.in.user = NULL;
- r.in.ctr.ctr3 = &c3;
- r.in.ctr.ctr3->count = 0;
- r.in.ctr.ctr3->array = NULL;
+ r.in.info_ctr = &info_ctr;
r.in.max_buffer = (uint32_t)4096;
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 NetFileEnum level %u\n", r.in.level);
+ info_ctr.level = levels[i];
+
+ switch (info_ctr.level) {
+ case 2:
+ ZERO_STRUCT(c2);
+ info_ctr.ctr.ctr2 = &c2;
+ break;
+ case 3:
+ ZERO_STRUCT(c3);
+ info_ctr.ctr.ctr3 = &c3;
+ break;
+ }
+ torture_comment(tctx, "testing NetFileEnum level %u\n", info_ctr.level);
status = dcerpc_srvsvc_NetFileEnum(p, tctx, &r);
torture_assert_ntstatus_ok(tctx, status, "NetFileEnum failed");
if (!W_ERROR_IS_OK(r.out.result)) {