diff options
Diffstat (limited to 'source4/torture/rpc')
-rw-r--r-- | source4/torture/rpc/dsgetinfo.c | 2 | ||||
-rw-r--r-- | source4/torture/rpc/remote_pac.c | 7 | ||||
-rw-r--r-- | source4/torture/rpc/rpc.c | 2 | ||||
-rw-r--r-- | source4/torture/rpc/spoolss_notify.c | 35 | ||||
-rw-r--r-- | source4/torture/rpc/testjoin.c | 4 |
5 files changed, 25 insertions, 25 deletions
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) { 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 */ 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)) diff --git a/source4/torture/rpc/spoolss_notify.c b/source4/torture/rpc/spoolss_notify.c index ec29c3944f..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"); @@ -455,8 +448,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, tctx->lp_ctx, &ifaces); + address = iface_list_first_v4(ifaces); torture_comment(tctx, "Listening for callbacks on %s\n", address); @@ -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, diff --git a/source4/torture/rpc/testjoin.c b/source4/torture/rpc/testjoin.c index c4ab0e43ad..76344e0ddf 100644 --- a/source4/torture/rpc/testjoin.c +++ b/source4/torture/rpc/testjoin.c @@ -583,14 +583,14 @@ 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; } 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; |