From 6611f0109b73d8c9ff5679e434aa8e354f28608a Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Sun, 10 Apr 2011 20:47:43 +0200 Subject: s4:torture/rpc/testjoin.c - use a LDB result constant Reviewed-by: abartlet --- source4/torture/rpc/testjoin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/rpc') diff --git a/source4/torture/rpc/testjoin.c b/source4/torture/rpc/testjoin.c index c4ab0e43ad..776ddbab72 100644 --- a/source4/torture/rpc/testjoin.c +++ b/source4/torture/rpc/testjoin.c @@ -590,7 +590,7 @@ static NTSTATUS torture_leave_ads_domain(struct torture_context *torture, } rtn = ldb_delete(ldb_ctx, server_dn); - if (rtn != 0) { + if (rtn != LDB_SUCCESS) { libnet_r->out.error_string = NULL; talloc_free(tmp_ctx); return NT_STATUS_UNSUCCESSFUL; -- cgit From bbf28703a47fc464a7d5dac25e6a4a6cf96fe3e9 Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Sun, 10 Apr 2011 20:47:18 +0200 Subject: s4:"ldb_connect" calls - proof for "!= LDB_SUCCESS" Reviewed-by: abartlet --- source4/torture/rpc/testjoin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/rpc') diff --git a/source4/torture/rpc/testjoin.c b/source4/torture/rpc/testjoin.c index 776ddbab72..76344e0ddf 100644 --- a/source4/torture/rpc/testjoin.c +++ b/source4/torture/rpc/testjoin.c @@ -583,7 +583,7 @@ static NTSTATUS torture_leave_ads_domain(struct torture_context *torture, ldb_set_opaque(ldb_ctx, "loadparm", cmdline_lp_ctx); rtn = ldb_connect(ldb_ctx, remote_ldb_url, 0, NULL); - if (rtn != 0) { + if (rtn != LDB_SUCCESS) { libnet_r->out.error_string = NULL; talloc_free(tmp_ctx); return NT_STATUS_UNSUCCESSFUL; -- cgit From 22cb631b4fd0647b70fbaaafaffda8712a84a999 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 2 May 2011 15:57:19 +1000 Subject: s4-interfaces Rename interfaces code so not to conflict with source3/ The iface_count, iface_n_bcast, and load_interfaces functions conflicted with functions of the same name in source3, so the source4 functions were renamed. Hopefully we can actually wrap one around the other in future. Andrew Bartlett --- source4/torture/rpc/spoolss_notify.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/torture/rpc') diff --git a/source4/torture/rpc/spoolss_notify.c b/source4/torture/rpc/spoolss_notify.c index ec29c3944f..04cd01b4a3 100644 --- a/source4/torture/rpc/spoolss_notify.c +++ b/source4/torture/rpc/spoolss_notify.c @@ -455,8 +455,8 @@ static bool test_start_dcerpc_server(struct torture_context *tctx, lpcfg_set_cmdline(tctx->lp_ctx, "dcerpc endpoint servers", "spoolss"); - load_interfaces(tctx, lpcfg_interfaces(tctx->lp_ctx), &ifaces); - address = iface_n_ip(ifaces, 0); + load_interface_list(tctx, lpcfg_interfaces(tctx->lp_ctx), &ifaces); + address = iface_list_n_ip(ifaces, 0); torture_comment(tctx, "Listening for callbacks on %s\n", address); -- cgit From a41efe6802da4e81a4af72aa231daa00f5012ab8 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 22 Apr 2011 11:22:50 +0200 Subject: s4:auth/credentials: pass 'self_service' to cli_credentials_set_impersonate_principal() This also adds a cli_credentials_get_self_service() helper function. In order to support S4U2Proxy we need to be able to set the service principal for the S4U2Self step independent of the target principal. metze --- source4/torture/rpc/remote_pac.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source4/torture/rpc') diff --git a/source4/torture/rpc/remote_pac.c b/source4/torture/rpc/remote_pac.c index c4efabcebc..70912781a8 100644 --- a/source4/torture/rpc/remote_pac.c +++ b/source4/torture/rpc/remote_pac.c @@ -476,8 +476,9 @@ static bool test_S2U4Self(struct torture_context *tctx, /* Wipe out any existing ccache */ cli_credentials_invalidate_ccache(credentials, CRED_SPECIFIED); - cli_credentials_set_target_service(credentials, talloc_asprintf(tmp_ctx, "host/%s", test_machine_name)); - cli_credentials_set_impersonate_principal(credentials, cli_credentials_get_principal(cmdline_credentials, tmp_ctx)); + cli_credentials_set_impersonate_principal(credentials, + cli_credentials_get_principal(cmdline_credentials, tmp_ctx), + talloc_asprintf(tmp_ctx, "host/%s", test_machine_name)); status = gensec_client_start(tctx, &gensec_client_context, tctx->ev, lpcfg_gensec_settings(tctx, tctx->lp_ctx)); @@ -525,7 +526,7 @@ static bool test_S2U4Self(struct torture_context *tctx, /* Don't pollute the remaining tests with the changed credentials */ cli_credentials_invalidate_ccache(credentials, CRED_SPECIFIED); cli_credentials_set_target_service(credentials, NULL); - cli_credentials_set_impersonate_principal(credentials, NULL); + cli_credentials_set_impersonate_principal(credentials, NULL, NULL); /* Extract the PAC using Samba's code */ -- cgit From 40dc94a53f4f0f5dee285daf486912b0996d5f3e Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 2 Jun 2011 15:40:28 +1000 Subject: s4-ipv6: update callers to load_interface_list() --- source4/torture/rpc/spoolss_notify.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/rpc') diff --git a/source4/torture/rpc/spoolss_notify.c b/source4/torture/rpc/spoolss_notify.c index 04cd01b4a3..cfb67716df 100644 --- a/source4/torture/rpc/spoolss_notify.c +++ b/source4/torture/rpc/spoolss_notify.c @@ -455,7 +455,7 @@ static bool test_start_dcerpc_server(struct torture_context *tctx, lpcfg_set_cmdline(tctx->lp_ctx, "dcerpc endpoint servers", "spoolss"); - load_interface_list(tctx, lpcfg_interfaces(tctx->lp_ctx), &ifaces); + load_interface_list(tctx, tctx->lp_ctx, &ifaces); address = iface_list_n_ip(ifaces, 0); torture_comment(tctx, "Listening for callbacks on %s\n", address); -- cgit From de46ad9084aff4384f33660acf91da3b81554a88 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 6 Jun 2011 14:37:06 +1000 Subject: lib/util use modules_path(), data_path() and shlib_ext() from source3 This brings these helpful utility functions in common, as they are not based on either loadparm system. (The 'modules dir' parameter from Samba4 will shortly be removed, so there is no loss in functionality) Andrew Bartlett --- source4/torture/rpc/dsgetinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/rpc') diff --git a/source4/torture/rpc/dsgetinfo.c b/source4/torture/rpc/dsgetinfo.c index 6122ff0603..a0360e8404 100644 --- a/source4/torture/rpc/dsgetinfo.c +++ b/source4/torture/rpc/dsgetinfo.c @@ -88,7 +88,7 @@ static const char *torture_get_ldap_base_dn(struct torture_context *tctx, struct } ldb_set_modules_dir(ldb, - talloc_asprintf(ldb, "%s/ldb", lpcfg_modulesdir(tctx->lp_ctx))); + modules_path(ldb, "ldb")); ret = ldb_connect(ldb, ldap_url, 0, NULL); if (ret != LDB_SUCCESS) { -- cgit From 907cdb5de7f16a2540299aeba211bf2a5ae6fafe Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 6 Jun 2011 14:58:28 +1000 Subject: s4-modules Remove lp_ctx from init functions that no longer need it Now that we don't allow the smb.conf to change the modules dir, many functions that simply load modules or initialise a subsytem that may load modules no longer need an lp_ctx. Andrew Bartlett --- source4/torture/rpc/rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/rpc') diff --git a/source4/torture/rpc/rpc.c b/source4/torture/rpc/rpc.c index 03936f22ff..01ce93f373 100644 --- a/source4/torture/rpc/rpc.c +++ b/source4/torture/rpc/rpc.c @@ -75,7 +75,7 @@ _PUBLIC_ NTSTATUS torture_rpc_connection(struct torture_context *tctx, NTSTATUS status; struct dcerpc_binding *binding; - dcerpc_init(tctx->lp_ctx); + dcerpc_init(); status = torture_rpc_binding(tctx, &binding); if (NT_STATUS_IS_ERR(status)) -- cgit From 834dcdb35df6c56391cef240accf39b4a3b0c48a Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 20 Jun 2011 18:01:38 +0200 Subject: s4-smbtorture: use ipv4 addresses for backchannel spoolss change notify connections for now. Guenther --- source4/torture/rpc/spoolss_notify.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/rpc') diff --git a/source4/torture/rpc/spoolss_notify.c b/source4/torture/rpc/spoolss_notify.c index cfb67716df..81487d95fe 100644 --- a/source4/torture/rpc/spoolss_notify.c +++ b/source4/torture/rpc/spoolss_notify.c @@ -456,7 +456,7 @@ static bool test_start_dcerpc_server(struct torture_context *tctx, lpcfg_set_cmdline(tctx->lp_ctx, "dcerpc endpoint servers", "spoolss"); load_interface_list(tctx, tctx->lp_ctx, &ifaces); - address = iface_list_n_ip(ifaces, 0); + address = iface_list_first_v4(ifaces); torture_comment(tctx, "Listening for callbacks on %s\n", address); -- cgit From 0b5e5db218451effe667e50ca0d0783e7878c748 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 21 Jun 2011 15:06:27 +0200 Subject: s4-smbtorture: rework the spoolss notify test a bit. Guenther --- source4/torture/rpc/spoolss_notify.c | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'source4/torture/rpc') diff --git a/source4/torture/rpc/spoolss_notify.c b/source4/torture/rpc/spoolss_notify.c index 81487d95fe..ea05d9bd1c 100644 --- a/source4/torture/rpc/spoolss_notify.c +++ b/source4/torture/rpc/spoolss_notify.c @@ -247,20 +247,13 @@ static NTSTATUS spoolss__op_init_server(struct dcesrv_context *dce_ctx, const st static bool test_OpenPrinter(struct torture_context *tctx, struct dcerpc_pipe *p, struct policy_handle *handle, - const char *name) + const char *printername) { struct spoolss_OpenPrinter r; - const char *printername; struct dcerpc_binding_handle *b = p->binding_handle; ZERO_STRUCT(r); - if (name) { - printername = talloc_asprintf(tctx, "\\\\%s\\%s", dcerpc_server_name(p), name); - } else { - printername = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p)); - } - r.in.printername = printername; r.in.datatype = NULL; r.in.devmode_ctr.devmode= NULL; @@ -352,17 +345,17 @@ static bool test_RemoteFindFirstPrinterChangeNotifyEx(struct torture_context *tc static bool test_RouterRefreshPrinterChangeNotify(struct torture_context *tctx, struct dcerpc_binding_handle *b, struct policy_handle *handle, - struct spoolss_NotifyOption *options) + struct spoolss_NotifyOption *options, + struct spoolss_NotifyInfo **info) { struct spoolss_RouterRefreshPrinterChangeNotify r; - struct spoolss_NotifyInfo *info; torture_comment(tctx, "Testing RouterRefreshPrinterChangeNotify\n"); r.in.handle = handle; r.in.change_low = 0; r.in.options = options; - r.out.info = &info; + r.out.info = info; torture_assert_ntstatus_ok(tctx, dcerpc_spoolss_RouterRefreshPrinterChangeNotify_r(b, tctx, &r), "RouterRefreshPrinterChangeNotify failed"); @@ -503,31 +496,37 @@ static bool test_RFFPCNEx(struct torture_context *tctx, struct spoolss_NotifyOption *printer_option = setup_printer_NotifyOption(tctx); #endif struct dcerpc_binding_handle *b = p->binding_handle; + const char *printername = NULL; + struct spoolss_NotifyInfo *info = NULL; received_packets = NULL; /* Start DCE/RPC server */ torture_assert(tctx, test_start_dcerpc_server(tctx, p->conn->event_ctx, &dce_ctx, &address), ""); - torture_assert(tctx, test_OpenPrinter(tctx, p, &handle, NULL), ""); + printername = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p)); + + torture_assert(tctx, test_OpenPrinter(tctx, p, &handle, printername), ""); torture_assert(tctx, test_RemoteFindFirstPrinterChangeNotifyEx(tctx, b, &handle, address, server_option), ""); torture_assert(tctx, received_packets, "no packets received"); torture_assert_int_equal(tctx, received_packets->opnum, NDR_SPOOLSS_REPLYOPENPRINTER, "no ReplyOpenPrinter packet after RemoteFindFirstPrinterChangeNotifyEx"); - torture_assert(tctx, test_RouterRefreshPrinterChangeNotify(tctx, b, &handle, NULL), ""); - torture_assert(tctx, test_RouterRefreshPrinterChangeNotify(tctx, b, &handle, server_option), ""); + torture_assert(tctx, test_RouterRefreshPrinterChangeNotify(tctx, b, &handle, NULL, &info), ""); + torture_assert(tctx, test_RouterRefreshPrinterChangeNotify(tctx, b, &handle, server_option, &info), ""); torture_assert(tctx, test_ClosePrinter(tctx, b, &handle), ""); tmp = last_packet(received_packets); torture_assert_int_equal(tctx, tmp->opnum, NDR_SPOOLSS_REPLYCLOSEPRINTER, "no ReplyClosePrinter packet after ClosePrinter"); #if 0 + printername = talloc_asprintf(tctx, "\\\\%s\\%s", dcerpc_server_name(p), name); + torture_assert(tctx, test_OpenPrinter(tctx, p, &handle, "Epson AL-2600"), ""); torture_assert(tctx, test_RemoteFindFirstPrinterChangeNotifyEx(tctx, p, &handle, address, printer_option), ""); tmp = last_packet(received_packets); torture_assert_int_equal(tctx, tmp->opnum, NDR_SPOOLSS_REPLYOPENPRINTER, "no ReplyOpenPrinter packet after RemoteFindFirstPrinterChangeNotifyEx"); - torture_assert(tctx, test_RouterRefreshPrinterChangeNotify(tctx, p, &handle, NULL), ""); - torture_assert(tctx, test_RouterRefreshPrinterChangeNotify(tctx, p, &handle, printer_option), ""); + torture_assert(tctx, test_RouterRefreshPrinterChangeNotify(tctx, p, &handle, NULL, &info), ""); + torture_assert(tctx, test_RouterRefreshPrinterChangeNotify(tctx, p, &handle, printer_option, &info), ""); torture_assert(tctx, test_SetPrinter(tctx, p, &handle), ""); tmp = last_packet(received_packets); torture_assert_int_equal(tctx, tmp->opnum, NDR_SPOOLSS_ROUTERREPLYPRINTEREX, -- cgit