From 0b95cb251ce0043e393139a22a0f3ac6121406c5 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 29 Oct 2008 21:04:31 +0100 Subject: s4-srvsvc: merge srvsvc_NetShareInfo502 from s3. Apparently both s3 and s4 are not entirely correct one this. metze is looking into hand-marshalling security descriptors so this will fix this finally. For now, just keep the two in sync. Guenther --- source4/torture/rpc/samba3rpc.c | 2 +- source4/torture/rpc/srvsvc.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'source4/torture/rpc') diff --git a/source4/torture/rpc/samba3rpc.c b/source4/torture/rpc/samba3rpc.c index c53c4b72c7..5aff213533 100644 --- a/source4/torture/rpc/samba3rpc.c +++ b/source4/torture/rpc/samba3rpc.c @@ -2153,7 +2153,7 @@ static struct security_descriptor *get_sharesec(TALLOC_CTX *mem_ctx, return NULL; } - result = talloc_steal(mem_ctx, r.out.info.info502->sd); + result = talloc_steal(mem_ctx, r.out.info.info502->sd_buf.sd); talloc_free(tmp_ctx); return result; } diff --git a/source4/torture/rpc/srvsvc.c b/source4/torture/rpc/srvsvc.c index 1fe1221b0d..9b475ab826 100644 --- a/source4/torture/rpc/srvsvc.c +++ b/source4/torture/rpc/srvsvc.c @@ -444,6 +444,7 @@ static bool test_NetShareAddSetDel(struct torture_context *tctx, struct srvsvc_NetShareSetInfo r; struct srvsvc_NetShareGetInfo q; struct srvsvc_NetShareDel d; + struct sec_desc_buf sd_buf; struct { uint32_t level; WERROR expected; @@ -524,6 +525,7 @@ static bool test_NetShareAddSetDel(struct torture_context *tctx, r.in.info.info501->csc_policy = 0; break; case 502: + ZERO_STRUCT(sd_buf); r.in.info.info502 = talloc(tctx, struct srvsvc_NetShareInfo502); r.in.info.info502->name = r.in.share_name; r.in.info.info502->type = STYPE_DISKTREE; @@ -533,8 +535,7 @@ static bool test_NetShareAddSetDel(struct torture_context *tctx, r.in.info.info502->current_users = 1; r.in.info.info502->path = talloc_strdup(tctx, "C:\\"); r.in.info.info502->password = NULL; - r.in.info.info502->unknown = 0; - r.in.info.info502->sd = NULL; + r.in.info.info502->sd_buf = sd_buf; break; case 1004: r.in.info.info1004 = talloc(tctx, struct srvsvc_NetShareInfo1004); -- cgit From 9fd82703d17b4dc524d2c7689438b92738c63d23 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 29 Oct 2008 14:01:04 +0100 Subject: s4-srvsvc: merge srvsvc_NetRemoteTOD from s3 idl. Guenther --- source4/torture/rpc/srvsvc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source4/torture/rpc') diff --git a/source4/torture/rpc/srvsvc.c b/source4/torture/rpc/srvsvc.c index 9b475ab826..4ddab75883 100644 --- a/source4/torture/rpc/srvsvc.c +++ b/source4/torture/rpc/srvsvc.c @@ -851,10 +851,11 @@ static bool test_NetRemoteTOD(struct torture_context *tctx, { NTSTATUS status; struct srvsvc_NetRemoteTOD r; + struct srvsvc_NetRemoteTODInfo *info = NULL; r.in.server_unc = talloc_asprintf(tctx,"\\\\%s",dcerpc_server_name(p)); + r.out.info = &info; - ZERO_STRUCT(r.out); torture_comment(tctx, "testing NetRemoteTOD\n"); status = dcerpc_srvsvc_NetRemoteTOD(p, tctx, &r); torture_assert_ntstatus_ok(tctx, status, "NetRemoteTOD failed"); -- cgit From 31b067a6dd8bd702801779755f24cc20ce0541f7 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 29 Oct 2008 14:19:14 +0100 Subject: s4-srvsvc: merge srvsvc_NetShareCheck from s3 idl. Guenther --- source4/torture/rpc/srvsvc.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source4/torture/rpc') diff --git a/source4/torture/rpc/srvsvc.c b/source4/torture/rpc/srvsvc.c index 4ddab75883..55352278e7 100644 --- a/source4/torture/rpc/srvsvc.c +++ b/source4/torture/rpc/srvsvc.c @@ -362,9 +362,11 @@ static bool test_NetShareCheck(struct dcerpc_pipe *p, struct torture_context *tc { NTSTATUS status; struct srvsvc_NetShareCheck r; + enum srvsvc_ShareType type; r.in.server_unc = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p)); r.in.device_name = device_name; + r.out.type = &type; torture_comment(tctx, "testing NetShareCheck on device '%s'\n", r.in.device_name); -- cgit From 3206f3552791f1806eec3a6d4bdc55857da4b264 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 29 Oct 2008 14:52:49 +0100 Subject: s4-srvsvc: merge srvsvc_NetShareAdd from s3 idl. Guenther --- source4/torture/rpc/srvsvc.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'source4/torture/rpc') diff --git a/source4/torture/rpc/srvsvc.c b/source4/torture/rpc/srvsvc.c index 55352278e7..b890f11ab8 100644 --- a/source4/torture/rpc/srvsvc.c +++ b/source4/torture/rpc/srvsvc.c @@ -447,6 +447,7 @@ static bool test_NetShareAddSetDel(struct torture_context *tctx, struct srvsvc_NetShareGetInfo q; struct srvsvc_NetShareDel d; struct sec_desc_buf sd_buf; + union srvsvc_NetShareInfo info; struct { uint32_t level; WERROR expected; @@ -468,17 +469,18 @@ static bool test_NetShareAddSetDel(struct torture_context *tctx, talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p)); r.in.share_name = talloc_strdup(tctx, "testshare"); + info.info2 = talloc(tctx, struct srvsvc_NetShareInfo2); + info.info2->name = r.in.share_name; + info.info2->type = STYPE_DISKTREE; + info.info2->comment = talloc_strdup(tctx, "test comment"); + info.info2->permissions = 123434566; + info.info2->max_users = -1; + info.info2->current_users = 0; + info.info2->path = talloc_strdup(tctx, "C:\\"); + info.info2->password = NULL; + + a.in.info = &info; a.in.level = 2; - a.in.info.info2 = talloc(tctx, struct srvsvc_NetShareInfo2); - a.in.info.info2->name = r.in.share_name; - a.in.info.info2->type = STYPE_DISKTREE; - a.in.info.info2->comment = talloc_strdup(tctx, "test comment"); - a.in.info.info2->permissions = 123434566; - a.in.info.info2->max_users = -1; - a.in.info.info2->current_users = 0; - a.in.info.info2->path = talloc_strdup(tctx, "C:\\"); - a.in.info.info2->password = NULL; - a.in.parm_error = NULL; status = dcerpc_srvsvc_NetShareAdd(p, tctx, &a); -- cgit From 523732ed2d33f61d35774aa3f771a890cb663035 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 29 Oct 2008 15:11:27 +0100 Subject: s4-srvsvc: merge srvsvc_NetShareSetInfo from s3 idl. Guenther --- source4/torture/rpc/samba3rpc.c | 4 +- source4/torture/rpc/srvsvc.c | 94 +++++++++++++++++++++-------------------- 2 files changed, 51 insertions(+), 47 deletions(-) (limited to 'source4/torture/rpc') diff --git a/source4/torture/rpc/samba3rpc.c b/source4/torture/rpc/samba3rpc.c index 5aff213533..e04400ef05 100644 --- a/source4/torture/rpc/samba3rpc.c +++ b/source4/torture/rpc/samba3rpc.c @@ -2170,6 +2170,7 @@ static NTSTATUS set_sharesec(TALLOC_CTX *mem_ctx, NTSTATUS status; struct sec_desc_buf i; struct srvsvc_NetShareSetInfo r; + union srvsvc_NetShareInfo info; uint32_t error = 0; if (!(tmp_ctx = talloc_new(mem_ctx))) { @@ -2201,7 +2202,8 @@ static NTSTATUS set_sharesec(TALLOC_CTX *mem_ctx, r.in.share_name = sharename; r.in.level = 1501; i.sd = sd; - r.in.info.info1501 = &i; + info.info1501 = &i; + r.in.info = &info; r.in.parm_error = &error; status = dcerpc_srvsvc_NetShareSetInfo(p, tmp_ctx, &r); diff --git a/source4/torture/rpc/srvsvc.c b/source4/torture/rpc/srvsvc.c index b890f11ab8..4a61ba5acd 100644 --- a/source4/torture/rpc/srvsvc.c +++ b/source4/torture/rpc/srvsvc.c @@ -501,69 +501,71 @@ static bool test_NetShareAddSetDel(struct torture_context *tctx, switch (levels[i].level) { case 0: - r.in.info.info0 = talloc(tctx, struct srvsvc_NetShareInfo0); - r.in.info.info0->name = r.in.share_name; + info.info0 = talloc(tctx, struct srvsvc_NetShareInfo0); + info.info0->name = r.in.share_name; break; case 1: - r.in.info.info1 = talloc(tctx, struct srvsvc_NetShareInfo1); - r.in.info.info1->name = r.in.share_name; - r.in.info.info1->type = STYPE_DISKTREE; - r.in.info.info1->comment = talloc_strdup(tctx, "test comment 1"); + info.info1 = talloc(tctx, struct srvsvc_NetShareInfo1); + info.info1->name = r.in.share_name; + info.info1->type = STYPE_DISKTREE; + info.info1->comment = talloc_strdup(tctx, "test comment 1"); break; case 2: - r.in.info.info2 = talloc(tctx, struct srvsvc_NetShareInfo2); - r.in.info.info2->name = r.in.share_name; - r.in.info.info2->type = STYPE_DISKTREE; - r.in.info.info2->comment = talloc_strdup(tctx, "test comment 2"); - r.in.info.info2->permissions = 0; - r.in.info.info2->max_users = 2; - r.in.info.info2->current_users = 1; - r.in.info.info2->path = talloc_strdup(tctx, "::BLaH::"); /* "C:\\"); */ - r.in.info.info2->password = NULL; + info.info2 = talloc(tctx, struct srvsvc_NetShareInfo2); + info.info2->name = r.in.share_name; + info.info2->type = STYPE_DISKTREE; + info.info2->comment = talloc_strdup(tctx, "test comment 2"); + info.info2->permissions = 0; + info.info2->max_users = 2; + info.info2->current_users = 1; + info.info2->path = talloc_strdup(tctx, "::BLaH::"); /* "C:\\"); */ + info.info2->password = NULL; break; case 501: - r.in.info.info501 = talloc(tctx, struct srvsvc_NetShareInfo501); - r.in.info.info501->name = r.in.share_name; - r.in.info.info501->type = STYPE_DISKTREE; - r.in.info.info501->comment = talloc_strdup(tctx, "test comment 501"); - r.in.info.info501->csc_policy = 0; + info.info501 = talloc(tctx, struct srvsvc_NetShareInfo501); + info.info501->name = r.in.share_name; + info.info501->type = STYPE_DISKTREE; + info.info501->comment = talloc_strdup(tctx, "test comment 501"); + info.info501->csc_policy = 0; break; case 502: ZERO_STRUCT(sd_buf); - r.in.info.info502 = talloc(tctx, struct srvsvc_NetShareInfo502); - r.in.info.info502->name = r.in.share_name; - r.in.info.info502->type = STYPE_DISKTREE; - r.in.info.info502->comment = talloc_strdup(tctx, "test comment 502"); - r.in.info.info502->permissions = 0; - r.in.info.info502->max_users = 502; - r.in.info.info502->current_users = 1; - r.in.info.info502->path = talloc_strdup(tctx, "C:\\"); - r.in.info.info502->password = NULL; - r.in.info.info502->sd_buf = sd_buf; + info.info502 = talloc(tctx, struct srvsvc_NetShareInfo502); + info.info502->name = r.in.share_name; + info.info502->type = STYPE_DISKTREE; + info.info502->comment = talloc_strdup(tctx, "test comment 502"); + info.info502->permissions = 0; + info.info502->max_users = 502; + info.info502->current_users = 1; + info.info502->path = talloc_strdup(tctx, "C:\\"); + info.info502->password = NULL; + info.info502->sd_buf = sd_buf; break; case 1004: - r.in.info.info1004 = talloc(tctx, struct srvsvc_NetShareInfo1004); - r.in.info.info1004->comment = talloc_strdup(tctx, "test comment 1004"); + info.info1004 = talloc(tctx, struct srvsvc_NetShareInfo1004); + info.info1004->comment = talloc_strdup(tctx, "test comment 1004"); break; case 1005: - r.in.info.info1005 = talloc(tctx, struct srvsvc_NetShareInfo1005); - r.in.info.info1005->dfs_flags = 0; + info.info1005 = talloc(tctx, struct srvsvc_NetShareInfo1005); + info.info1005->dfs_flags = 0; break; case 1006: - r.in.info.info1006 = talloc(tctx, struct srvsvc_NetShareInfo1006); - r.in.info.info1006->max_users = 1006; + info.info1006 = talloc(tctx, struct srvsvc_NetShareInfo1006); + info.info1006->max_users = 1006; break; /* case 1007: - r.in.info.info1007 = talloc(tctx, struct srvsvc_NetShareInfo1007); - r.in.info.info1007->flags = 0; - r.in.info.info1007->alternate_directory_name = talloc_strdup(tctx, "test"); + info.info1007 = talloc(tctx, struct srvsvc_NetShareInfo1007); + info.info1007->flags = 0; + info.info1007->alternate_directory_name = talloc_strdup(tctx, "test"); break; */ case 1501: - r.in.info.info1501 = talloc_zero(tctx, struct sec_desc_buf); + info.info1501 = talloc_zero(tctx, struct sec_desc_buf); break; } - + + r.in.info = &info; + status = dcerpc_srvsvc_NetShareSetInfo(p, tctx, &r); torture_assert_ntstatus_ok(tctx, status, "NetShareGetInfo failed"); torture_assert_werr_equal(tctx, r.out.result, levels[i].expected, "NetShareSetInfo failed"); @@ -584,7 +586,7 @@ static bool test_NetShareAddSetDel(struct torture_context *tctx, torture_assert_str_equal(tctx, q.out.info.info502->comment, "test comment 1", "comment"); break; case 2: - torture_assert_str_equal(tctx, q.out.info.info502->comment, "test comment 2", "comment"); + torture_assert_str_equal(tctx, q.out.info.info2->comment, "test comment 2", "comment"); torture_assert_int_equal(tctx, q.out.info.info2->max_users, 2, "max users"); torture_assert_str_equal(tctx, q.out.info.info2->path, "C:\\", "path"); break; @@ -593,17 +595,17 @@ static bool test_NetShareAddSetDel(struct torture_context *tctx, break; case 502: torture_assert_str_equal(tctx, q.out.info.info502->comment, "test comment 502", "comment"); - torture_assert_int_equal(tctx, q.out.info.info2->max_users, 502, "max users"); - torture_assert_str_equal(tctx, q.out.info.info2->path, "C:\\", "path"); + torture_assert_int_equal(tctx, q.out.info.info502->max_users, 502, "max users"); + torture_assert_str_equal(tctx, q.out.info.info502->path, "C:\\", "path"); break; case 1004: - torture_assert_str_equal(tctx, q.out.info.info502->comment, "test comment 1004", + torture_assert_str_equal(tctx, q.out.info.info1004->comment, "test comment 1004", "comment"); break; case 1005: break; case 1006: - torture_assert_int_equal(tctx, q.out.info.info2->max_users, 1006, "Max users"); + torture_assert_int_equal(tctx, q.out.info.info1006->max_users, 1006, "Max users"); break; /* case 1007: break; -- cgit From 227c6ed8ea366f6dc0559cd6bb21254e42d2b22c Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 29 Oct 2008 15:38:18 +0100 Subject: s4-srvsvc: merge srvsvc_NetShareGetInfo from s3 idl. Guenther --- source4/torture/rpc/samba3rpc.c | 18 +++++++++++------- source4/torture/rpc/srvsvc.c | 30 ++++++++++++++++-------------- 2 files changed, 27 insertions(+), 21 deletions(-) (limited to 'source4/torture/rpc') diff --git a/source4/torture/rpc/samba3rpc.c b/source4/torture/rpc/samba3rpc.c index e04400ef05..bd23327e70 100644 --- a/source4/torture/rpc/samba3rpc.c +++ b/source4/torture/rpc/samba3rpc.c @@ -1866,6 +1866,7 @@ static bool test_NetShareGetInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, { NTSTATUS status; struct srvsvc_NetShareGetInfo r; + union srvsvc_NetShareInfo info; uint32_t levels[] = { 0, 1, 2, 501, 502, 1004, 1005, 1006, 1007, 1501 }; int i; bool ret = true; @@ -1873,12 +1874,11 @@ static bool test_NetShareGetInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, r.in.server_unc = talloc_asprintf(mem_ctx, "\\\\%s", dcerpc_server_name(p)); r.in.share_name = sharename; + r.out.info = &info; for (i=0;isd_buf.sd); + result = talloc_steal(mem_ctx, info.info502->sd_buf.sd); talloc_free(tmp_ctx); return result; } @@ -2208,7 +2210,7 @@ static NTSTATUS set_sharesec(TALLOC_CTX *mem_ctx, status = dcerpc_srvsvc_NetShareSetInfo(p, tmp_ctx, &r); if (!NT_STATUS_IS_OK(status)) { - d_printf("srvsvc_NetShareGetInfo failed: %s\n", + d_printf("srvsvc_NetShareSetInfo failed: %s\n", nt_errstr(status)); } @@ -3105,11 +3107,12 @@ static NTSTATUS get_shareinfo(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx, struct smbcli_state *cli, const char *share, - struct srvsvc_NetShareInfo502 **info) + struct srvsvc_NetShareInfo502 **info502) { struct smbcli_tree *ipc; struct dcerpc_pipe *p; struct srvsvc_NetShareGetInfo r; + union srvsvc_NetShareInfo info; NTSTATUS status; if (!(p = dcerpc_pipe_init(cli, @@ -3142,15 +3145,16 @@ static NTSTATUS get_shareinfo(TALLOC_CTX *mem_ctx, dcerpc_server_name(p)); r.in.share_name = share; r.in.level = 502; + r.out.info = &info; status = dcerpc_srvsvc_NetShareGetInfo(p, p, &r); if (!NT_STATUS_IS_OK(status) || !W_ERROR_IS_OK(r.out.result)) { - d_printf("(%s) OpenHKLM failed: %s, %s\n", __location__, + d_printf("(%s) srvsvc_NetShareGetInfo failed: %s, %s\n", __location__, nt_errstr(status), win_errstr(r.out.result)); goto fail; } - *info = talloc_move(mem_ctx, &r.out.info.info502); + *info502 = talloc_move(mem_ctx, &info.info502); return NT_STATUS_OK; fail: diff --git a/source4/torture/rpc/srvsvc.c b/source4/torture/rpc/srvsvc.c index 4a61ba5acd..3e584aaba5 100644 --- a/source4/torture/rpc/srvsvc.c +++ b/source4/torture/rpc/srvsvc.c @@ -384,6 +384,7 @@ static bool test_NetShareGetInfo(struct torture_context *tctx, { NTSTATUS status; struct srvsvc_NetShareGetInfo r; + union srvsvc_NetShareInfo info; struct { uint32_t level; WERROR anon_status; @@ -400,6 +401,7 @@ static bool test_NetShareGetInfo(struct torture_context *tctx, r.in.server_unc = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p)); r.in.share_name = sharename; + r.out.info = &info; for (i=0;ipath) continue; - if (!test_NetShareCheck(p, tctx, r.out.info.info2->path)) { + if (!r.out.info->info2 || !r.out.info->info2->path) continue; + if (!test_NetShareCheck(p, tctx, r.out.info->info2->path)) { return false; } } @@ -571,41 +572,42 @@ static bool test_NetShareAddSetDel(struct torture_context *tctx, torture_assert_werr_equal(tctx, r.out.result, levels[i].expected, "NetShareSetInfo failed"); q.in.share_name = r.in.share_name; + q.out.info = &info; status = dcerpc_srvsvc_NetShareGetInfo(p, tctx, &q); torture_assert_ntstatus_ok(tctx, status, "NetShareGetInfo failed"); torture_assert_werr_ok(tctx, q.out.result, "NetShareGetInfo failed"); - torture_assert_str_equal(tctx, q.out.info.info502->name, r.in.share_name, + torture_assert_str_equal(tctx, q.out.info->info502->name, r.in.share_name, "share name invalid"); switch (levels[i].level) { case 0: break; case 1: - torture_assert_str_equal(tctx, q.out.info.info502->comment, "test comment 1", "comment"); + torture_assert_str_equal(tctx, q.out.info->info502->comment, "test comment 1", "comment"); break; case 2: - torture_assert_str_equal(tctx, q.out.info.info2->comment, "test comment 2", "comment"); - torture_assert_int_equal(tctx, q.out.info.info2->max_users, 2, "max users"); - torture_assert_str_equal(tctx, q.out.info.info2->path, "C:\\", "path"); + torture_assert_str_equal(tctx, q.out.info->info2->comment, "test comment 2", "comment"); + torture_assert_int_equal(tctx, q.out.info->info2->max_users, 2, "max users"); + torture_assert_str_equal(tctx, q.out.info->info2->path, "C:\\", "path"); break; case 501: - torture_assert_str_equal(tctx, q.out.info.info501->comment, "test comment 501", "comment"); + torture_assert_str_equal(tctx, q.out.info->info501->comment, "test comment 501", "comment"); break; case 502: - torture_assert_str_equal(tctx, q.out.info.info502->comment, "test comment 502", "comment"); - torture_assert_int_equal(tctx, q.out.info.info502->max_users, 502, "max users"); - torture_assert_str_equal(tctx, q.out.info.info502->path, "C:\\", "path"); + torture_assert_str_equal(tctx, q.out.info->info502->comment, "test comment 502", "comment"); + torture_assert_int_equal(tctx, q.out.info->info502->max_users, 502, "max users"); + torture_assert_str_equal(tctx, q.out.info->info502->path, "C:\\", "path"); break; case 1004: - torture_assert_str_equal(tctx, q.out.info.info1004->comment, "test comment 1004", + torture_assert_str_equal(tctx, q.out.info->info1004->comment, "test comment 1004", "comment"); break; case 1005: break; case 1006: - torture_assert_int_equal(tctx, q.out.info.info1006->max_users, 1006, "Max users"); + torture_assert_int_equal(tctx, q.out.info->info1006->max_users, 1006, "Max users"); break; /* case 1007: break; -- cgit From d2cc4e63c570633c387f72cb977e3adcfc3a7ce8 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 29 Oct 2008 16:33:47 +0100 Subject: s4-srvsvc: merge srvsvc_NetTransportEnum from s3 idl. Guenther --- source4/torture/rpc/srvsvc.c | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) (limited to 'source4/torture/rpc') diff --git a/source4/torture/rpc/srvsvc.c b/source4/torture/rpc/srvsvc.c index 3e584aaba5..a6536faec7 100644 --- a/source4/torture/rpc/srvsvc.c +++ b/source4/torture/rpc/srvsvc.c @@ -826,21 +826,36 @@ static bool test_NetTransportEnum(struct torture_context *tctx, { NTSTATUS status; struct srvsvc_NetTransportEnum r; - struct srvsvc_NetTransportCtr0 c0; + struct srvsvc_NetTransportInfoCtr transports; + struct srvsvc_NetTransportCtr0 ctr0; + struct srvsvc_NetTransportCtr1 ctr1; + + uint32_t totalentries = 0; uint32_t levels[] = {0, 1}; int i; + ZERO_STRUCT(transports); + r.in.server_unc = talloc_asprintf(tctx,"\\\\%s", dcerpc_server_name(p)); - r.in.transports.ctr0 = &c0; - r.in.transports.ctr0->count = 0; - r.in.transports.ctr0->array = NULL; + r.in.transports = &transports; r.in.max_buffer = (uint32_t)-1; r.in.resume_handle = NULL; + r.out.totalentries = &totalentries; + r.out.transports = &transports; for (i=0;i Date: Wed, 29 Oct 2008 20:39:57 +0100 Subject: s4-srvsvc: merge srvsvc_NetSrvGetInfo from s3 idl. Guenther --- source4/torture/rpc/srvsvc.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'source4/torture/rpc') diff --git a/source4/torture/rpc/srvsvc.c b/source4/torture/rpc/srvsvc.c index a6536faec7..8ce2321369 100644 --- a/source4/torture/rpc/srvsvc.c +++ b/source4/torture/rpc/srvsvc.c @@ -766,19 +766,15 @@ static bool test_NetSrvGetInfo(struct torture_context *tctx, { NTSTATUS status; struct srvsvc_NetSrvGetInfo r; - struct srvsvc_NetSrvInfo503 i503; + union srvsvc_NetSrvInfo info; uint32_t levels[] = {100, 101, 102, 502, 503}; int i; - uint32_t resume_handle; - - ZERO_STRUCT(i503); r.in.server_unc = talloc_asprintf(tctx,"\\\\%s",dcerpc_server_name(p)); for (i=0;i Date: Wed, 29 Oct 2008 20:44:04 +0100 Subject: s4-srvsvc: merge srvsvc_NetCharDevGetInfo from s3 idl. Guenther --- source4/torture/rpc/srvsvc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source4/torture/rpc') diff --git a/source4/torture/rpc/srvsvc.c b/source4/torture/rpc/srvsvc.c index 8ce2321369..0b53e3b066 100644 --- a/source4/torture/rpc/srvsvc.c +++ b/source4/torture/rpc/srvsvc.c @@ -32,14 +32,15 @@ static bool test_NetCharDevGetInfo(struct dcerpc_pipe *p, struct torture_context { NTSTATUS status; struct srvsvc_NetCharDevGetInfo r; + union srvsvc_NetCharDevInfo info; uint32_t levels[] = {0, 1}; int i; r.in.server_unc = talloc_asprintf(tctx,"\\\\%s",dcerpc_server_name(p)); r.in.device_name = devname; + r.out.info = &info; for (i=0;i Date: Wed, 29 Oct 2008 20:50:15 +0100 Subject: s4-srvsvc: merge srvsvc_NetCharDevQGetInfo from s3 idl. Guenther --- source4/torture/rpc/srvsvc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source4/torture/rpc') diff --git a/source4/torture/rpc/srvsvc.c b/source4/torture/rpc/srvsvc.c index 0b53e3b066..2e78f8edf2 100644 --- a/source4/torture/rpc/srvsvc.c +++ b/source4/torture/rpc/srvsvc.c @@ -131,15 +131,16 @@ static bool test_NetCharDevQGetInfo(struct dcerpc_pipe *p, struct torture_contex { NTSTATUS status; struct srvsvc_NetCharDevQGetInfo r; + union srvsvc_NetCharDevQInfo info; uint32_t levels[] = {0, 1}; int i; r.in.server_unc = talloc_asprintf(tctx,"\\\\%s",dcerpc_server_name(p)); r.in.queue_name = devicequeue; r.in.user = talloc_asprintf(tctx,"Administrator"); + r.out.info = &info; for (i=0;i Date: Thu, 30 Oct 2008 11:21:52 +0100 Subject: s4-srvsvc: merge srvsvc_NetDiskEnum from s3 idl. Guenther --- source4/torture/rpc/srvsvc.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'source4/torture/rpc') diff --git a/source4/torture/rpc/srvsvc.c b/source4/torture/rpc/srvsvc.c index 2e78f8edf2..b513ccc973 100644 --- a/source4/torture/rpc/srvsvc.c +++ b/source4/torture/rpc/srvsvc.c @@ -796,16 +796,23 @@ static bool test_NetDiskEnum(struct torture_context *tctx, { NTSTATUS status; struct srvsvc_NetDiskEnum r; + struct srvsvc_NetDiskInfo info; + uint32_t totalentries = 0; uint32_t levels[] = {0}; int i; uint32_t resume_handle=0; - ZERO_STRUCT(r.in); + ZERO_STRUCT(info); + r.in.server_unc = NULL; r.in.resume_handle = &resume_handle; + r.in.info = &info; + r.out.info = &info; + r.out.totalentries = &totalentries; + r.out.resume_handle = &resume_handle; for (i=0;i Date: Thu, 30 Oct 2008 16:34:28 +0100 Subject: s4-srvsvc: merge srvsvc_NetCharDevEnum from s3 idl. Guenther --- source4/torture/rpc/srvsvc.c | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) (limited to 'source4/torture/rpc') diff --git a/source4/torture/rpc/srvsvc.c b/source4/torture/rpc/srvsvc.c index b513ccc973..aa10955a37 100644 --- a/source4/torture/rpc/srvsvc.c +++ b/source4/torture/rpc/srvsvc.c @@ -81,23 +81,39 @@ static bool test_NetCharDevEnum(struct torture_context *tctx, { NTSTATUS status; struct srvsvc_NetCharDevEnum r; + struct srvsvc_NetCharDevInfoCtr info_ctr; struct srvsvc_NetCharDevCtr0 c0; + struct srvsvc_NetCharDevCtr0 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.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.info_ctr = &info_ctr; + r.out.totalentries = &totalentries; for (i=0;icount;j++) { + if (info_ctr.level == 1) { + for (j=0;jctr.ctr1->count;j++) { const char *device; - device = r.out.ctr.ctr1->array[j].device; + device = r.out.info_ctr->ctr.ctr1->array[j].device; if (!test_NetCharDevGetInfo(p, tctx, device)) { return false; } -- cgit From d1340df8b80c4dbe9f37dffa315a26396ed4f93f Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 30 Oct 2008 16:49:21 +0100 Subject: s4-srvsvc: merge srvsvc_NetCharDevQEnum from s3 idl. Guenther --- source4/torture/rpc/srvsvc.c | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) (limited to 'source4/torture/rpc') diff --git a/source4/torture/rpc/srvsvc.c b/source4/torture/rpc/srvsvc.c index aa10955a37..cda2d44e71 100644 --- a/source4/torture/rpc/srvsvc.c +++ b/source4/torture/rpc/srvsvc.c @@ -228,24 +228,39 @@ static bool test_NetCharDevQEnum(struct torture_context *tctx, { NTSTATUS status; struct srvsvc_NetCharDevQEnum r; + struct srvsvc_NetCharDevQInfoCtr info_ctr; struct srvsvc_NetCharDevQCtr0 c0; + struct srvsvc_NetCharDevQCtr1 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.user = talloc_asprintf(tctx,"%s","Administrator"); - 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;icount;j++) { + if (info_ctr.level == 1) { + for (j=0;jctr.ctr1->count;j++) { const char *device; - device = r.out.ctr.ctr1->array[j].device; + device = r.out.info_ctr->ctr.ctr1->array[j].device; if (!test_NetCharDevQGetInfo(p, tctx, device)) { return false; } -- cgit From 8f99170ab94173670900677810def6893fd95024 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 30 Oct 2008 16:59:03 +0100 Subject: s4-srvsvc: merge srvsvc_NetConnEnum from s3 idl. Guenther --- source4/torture/rpc/srvsvc.c | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'source4/torture/rpc') 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 Date: Thu, 30 Oct 2008 17:05:11 +0100 Subject: s4-srvsvc: merge srvsvc_NetFileEnum from s3 idl. Guenther --- source4/torture/rpc/srvsvc.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'source4/torture/rpc') 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 Date: Thu, 30 Oct 2008 17:21:31 +0100 Subject: s4-srvsvc: merge srvsvc_NetSessEnum from s3 idl. Guenther --- source4/torture/rpc/srvsvc.c | 43 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 6 deletions(-) (limited to 'source4/torture/rpc') diff --git a/source4/torture/rpc/srvsvc.c b/source4/torture/rpc/srvsvc.c index c3dd5b0e6f..783dfd328b 100644 --- a/source4/torture/rpc/srvsvc.c +++ b/source4/torture/rpc/srvsvc.c @@ -391,23 +391,54 @@ static bool test_NetSessEnum(struct torture_context *tctx, { NTSTATUS status; struct srvsvc_NetSessEnum r; + struct srvsvc_NetSessInfoCtr info_ctr; struct srvsvc_NetSessCtr0 c0; + struct srvsvc_NetSessCtr1 c1; + struct srvsvc_NetSessCtr2 c2; + struct srvsvc_NetSessCtr10 c10; + struct srvsvc_NetSessCtr502 c502; + uint32_t totalentries = 0; uint32_t levels[] = {0, 1, 2, 10, 502}; int i; + ZERO_STRUCT(info_ctr); + r.in.server_unc = talloc_asprintf(tctx,"\\\\%s",dcerpc_server_name(p)); r.in.client = NULL; r.in.user = NULL; - 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 Date: Thu, 30 Oct 2008 18:02:40 +0100 Subject: s4-srvsvc: merge srvsvc_NetShareEnumAll from s3 idl. Guenther --- source4/torture/rpc/bench.c | 43 +++++++++++++++++++++++++++++++++------ source4/torture/rpc/srvsvc.c | 48 ++++++++++++++++++++++++++++++++++++-------- 2 files changed, 77 insertions(+), 14 deletions(-) (limited to 'source4/torture/rpc') diff --git a/source4/torture/rpc/bench.c b/source4/torture/rpc/bench.c index cacc1d3baa..6fa3815516 100644 --- a/source4/torture/rpc/bench.c +++ b/source4/torture/rpc/bench.c @@ -31,32 +31,63 @@ static bool test_NetShareEnumAll(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) { NTSTATUS status; struct srvsvc_NetShareEnumAll r; + struct srvsvc_NetShareInfoCtr info_ctr; struct srvsvc_NetShareCtr0 c0; + struct srvsvc_NetShareCtr1 c1; + struct srvsvc_NetShareCtr2 c2; + struct srvsvc_NetShareCtr501 c501; + struct srvsvc_NetShareCtr502 c502; + uint32_t totalentries = 0; uint32_t levels[] = {0, 1, 2, 501, 502}; int i; bool ret = true; uint32_t resume_handle; - ZERO_STRUCT(c0); + ZERO_STRUCT(info_ctr); r.in.server_unc = talloc_asprintf(mem_ctx,"\\\\%s",dcerpc_server_name(p)); - r.in.ctr.ctr0 = &c0; + r.in.info_ctr = &info_ctr; r.in.max_buffer = (uint32_t)-1; r.in.resume_handle = &resume_handle; r.out.resume_handle = &resume_handle; + r.out.totalentries = &totalentries; + r.out.info_ctr = &info_ctr; for (i=0;icount;j++) { + if (info_ctr.level == 2 && r.out.info_ctr->ctr.ctr2) { + for (j=0;jctr.ctr2->count;j++) { const char *name; - name = r.out.ctr.ctr2->array[j].name; + name = r.out.info_ctr->ctr.ctr2->array[j].name; if (!test_NetShareGetInfo(tctx, p, name, admin)) { return false; } -- cgit From f25b645ab1946ea8d36ce2adf26fd4b6590d476c Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 30 Oct 2008 18:21:49 +0100 Subject: s4-srvsvc: merge srvsvc_NetShareEnum from s3 idl. Guenther --- source4/torture/rpc/samba3rpc.c | 87 +++++++++++++++++++++++++++++++++-------- source4/torture/rpc/srvsvc.c | 42 ++++++++++++++++---- 2 files changed, 106 insertions(+), 23 deletions(-) (limited to 'source4/torture/rpc') diff --git a/source4/torture/rpc/samba3rpc.c b/source4/torture/rpc/samba3rpc.c index bd23327e70..93bcb3a1ea 100644 --- a/source4/torture/rpc/samba3rpc.c +++ b/source4/torture/rpc/samba3rpc.c @@ -1907,38 +1907,87 @@ static bool test_NetShareEnum(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, { NTSTATUS status; struct srvsvc_NetShareEnum r; + struct srvsvc_NetShareInfoCtr info_ctr; struct srvsvc_NetShareCtr0 c0; + struct srvsvc_NetShareCtr1 c1; + struct srvsvc_NetShareCtr2 c2; + struct srvsvc_NetShareCtr501 c501; + struct srvsvc_NetShareCtr502 c502; + struct srvsvc_NetShareCtr1004 c1004; + struct srvsvc_NetShareCtr1005 c1005; + struct srvsvc_NetShareCtr1006 c1006; + struct srvsvc_NetShareCtr1007 c1007; + uint32_t totalentries = 0; uint32_t levels[] = { 0, 1, 2, 501, 502, 1004, 1005, 1006, 1007 }; int i; bool ret = true; + ZERO_STRUCT(info_ctr); + r.in.server_unc = talloc_asprintf(mem_ctx,"\\\\%s",dcerpc_server_name(p)); - 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;ictr.ctr0; if (ctr->count > 0) { *one_sharename = ctr->array[0].name; } @@ -2471,8 +2520,10 @@ static NTSTATUS find_printers(TALLOC_CTX *ctx, struct loadparm_context *lp_ctx, NTSTATUS status; struct dcerpc_pipe *p; struct srvsvc_NetShareEnum r; + struct srvsvc_NetShareInfoCtr info_ctr; struct srvsvc_NetShareCtr1 c1_in; struct srvsvc_NetShareCtr1 *c1; + uint32_t totalentries = 0; int i; mem_ctx = talloc_new(ctx); @@ -2489,25 +2540,29 @@ static NTSTATUS find_printers(TALLOC_CTX *ctx, struct loadparm_context *lp_ctx, return status; } + ZERO_STRUCT(c1_in); + info_ctr.level = 1; + info_ctr.ctr.ctr1 = &c1_in; + r.in.server_unc = talloc_asprintf( mem_ctx, "\\\\%s", dcerpc_server_name(p)); - r.in.level = 1; - ZERO_STRUCT(c1_in); - r.in.ctr.ctr1 = &c1_in; + 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; status = dcerpc_srvsvc_NetShareEnum(p, mem_ctx, &r); if (!NT_STATUS_IS_OK(status)) { d_printf("NetShareEnum level %u failed - %s\n", - r.in.level, nt_errstr(status)); + info_ctr.level, nt_errstr(status)); talloc_free(mem_ctx); return status; } *printers = NULL; *num_printers = 0; - c1 = r.out.ctr.ctr1; + c1 = r.out.info_ctr->ctr.ctr1; for (i=0; icount; i++) { if (c1->array[i].type != STYPE_PRINTQ) { continue; diff --git a/source4/torture/rpc/srvsvc.c b/source4/torture/rpc/srvsvc.c index 13563d809c..82a8a67854 100644 --- a/source4/torture/rpc/srvsvc.c +++ b/source4/torture/rpc/srvsvc.c @@ -834,7 +834,13 @@ static bool test_NetShareEnum(struct torture_context *tctx, { NTSTATUS status; struct srvsvc_NetShareEnum r; + struct srvsvc_NetShareInfoCtr info_ctr; struct srvsvc_NetShareCtr0 c0; + struct srvsvc_NetShareCtr1 c1; + struct srvsvc_NetShareCtr2 c2; + struct srvsvc_NetShareCtr501 c501; + struct srvsvc_NetShareCtr502 c502; + uint32_t totalentries = 0; struct { uint32_t level; WERROR anon_status; @@ -849,22 +855,44 @@ static bool test_NetShareEnum(struct torture_context *tctx, int i; r.in.server_unc = talloc_asprintf(tctx,"\\\\%s",dcerpc_server_name(p)); - 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