summaryrefslogtreecommitdiff
path: root/source3/utils/net_rpc.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2019-11-11 13:58:37 +0100
committerAndreas Schneider <asn@cryptomilk.org>2020-05-28 06:43:37 +0000
commite8d71172cafd74a622bb0d375507f6f5ee3ffe88 (patch)
treef8c167aa18daa1b93a9a2bc51e43833b6ee03358 /source3/utils/net_rpc.c
parentf6e0582eaa0fbc7b1cb1747f3f3aa395b1cd83b3 (diff)
downloadsamba-e8d71172cafd74a622bb0d375507f6f5ee3ffe88.tar.gz
s3:net: make use of cli_rpc_pipe_open_with_creds() by using net_context_creds()
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'source3/utils/net_rpc.c')
-rw-r--r--source3/utils/net_rpc.c14
1 files changed, 11 insertions, 3 deletions
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,