From: Stefan Metzmacher Date: Mon, 11 Nov 2019 12:58:37 +0000 (+0100) Subject: s3:net: make use of cli_rpc_pipe_open_with_creds() by using net_context_creds() X-Git-Tag: ldb-2.2.0~314 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e8d71172cafd74a622bb0d375507f6f5ee3ffe88;p=thirdparty%2Fsamba.git s3:net: make use of cli_rpc_pipe_open_with_creds() by using net_context_creds() Signed-off-by: Stefan Metzmacher Reviewed-by: Andreas Schneider --- diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c index 17f751284ab..d59522e29ca 100644 --- a/source3/utils/net_rpc.c +++ b/source3/utils/net_rpc.c @@ -206,15 +206,23 @@ int run_rpc_command(struct net_context *c, } } else { if (conn_flags & NET_FLAGS_SEAL) { - nt_status = cli_rpc_pipe_open_generic_auth( + struct cli_credentials *creds = NULL; + + creds = net_context_creds(c, mem_ctx); + if (creds == NULL) { + DBG_ERR("net_rpc_ntlm_creds() failed\n"); + nt_status = NT_STATUS_INTERNAL_ERROR; + goto fail; + } + + nt_status = cli_rpc_pipe_open_with_creds( cli, table, (conn_flags & NET_FLAGS_TCP) ? NCACN_IP_TCP : NCACN_NP, DCERPC_AUTH_TYPE_NTLMSSP, DCERPC_AUTH_LEVEL_PRIVACY, smbXcli_conn_remote_name(cli->conn), - lp_workgroup(), c->opt_user_name, - c->opt_password, &pipe_hnd); + creds, &pipe_hnd); } else { nt_status = cli_rpc_pipe_open_noauth( cli, table,