]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:net: make use of cli_credentials_init_anon() in connect_to_ipc_anonymous()
authorStefan Metzmacher <metze@samba.org>
Mon, 11 Nov 2019 14:14:18 +0000 (15:14 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Thu, 28 May 2020 06:43:39 +0000 (06:43 +0000)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/utils/net_util.c

index d1eefa3b4774f62bdbf948871297027c7d4c0c5c..77bce564b13d29becf5ba7ea44c45e82684fc110 100644 (file)
@@ -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;