From: Stefan Metzmacher Date: Mon, 11 Nov 2019 14:14:18 +0000 (+0100) Subject: s3:net: make use of cli_credentials_init_anon() in connect_to_ipc_anonymous() X-Git-Tag: ldb-2.2.0~301 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf142ab619dd41e6151a4cd48058336c0bcdfebd;p=thirdparty%2Fsamba.git s3:net: make use of cli_credentials_init_anon() in connect_to_ipc_anonymous() Signed-off-by: Stefan Metzmacher Reviewed-by: Andreas Schneider --- diff --git a/source3/utils/net_util.c b/source3/utils/net_util.c index d1eefa3b477..77bce564b13 100644 --- a/source3/utils/net_util.c +++ b/source3/utils/net_util.c @@ -195,12 +195,18 @@ NTSTATUS connect_to_ipc_anonymous(struct net_context *c, const char *server_name) { NTSTATUS nt_status; + struct cli_credentials *anon_creds = NULL; - nt_status = cli_full_connection(cli_ctx, c->opt_requester_name, + anon_creds = cli_credentials_init_anon(c); + if (anon_creds == NULL) { + DBG_ERR("cli_credentials_init_anon() failed\n"); + return NT_STATUS_NO_MEMORY; + } + + nt_status = cli_full_connection_creds(cli_ctx, c->opt_requester_name, server_name, server_ss, c->opt_port, "IPC$", "IPC", - "", "", - "", 0, SMB_SIGNING_DEFAULT); + anon_creds, 0, SMB_SIGNING_OFF); if (NT_STATUS_IS_OK(nt_status)) { return nt_status;