s3:libnet_join: make use of cli_credentials_init_anon()
authorStefan Metzmacher <metze@samba.org>
Mon, 11 Nov 2019 14:10:10 +0000 (15:10 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Thu, 28 May 2020 06:43:38 +0000 (06:43 +0000)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/libnet/libnet_join.c

index eb8e0ea17f7abd21566663400f38c86407a89828..fa3a91f1121fb3349cc9e0b9b6b27f90fea5b65a 100644 (file)
@@ -1692,15 +1692,22 @@ NTSTATUS libnet_join_ok(struct messaging_context *msg_ctx,
                                           SMB_SIGNING_IPC_DEFAULT);
 
        if (!NT_STATUS_IS_OK(status)) {
-               status = cli_full_connection(&cli, NULL,
-                                            dc_name,
-                                            NULL, 0,
-                                            "IPC$", "IPC",
-                                            "",
-                                            NULL,
-                                            "",
-                                            0,
-                                            SMB_SIGNING_IPC_DEFAULT);
+               struct cli_credentials *anon_creds = NULL;
+
+               anon_creds = cli_credentials_init_anon(frame);
+               if (anon_creds == NULL) {
+                       TALLOC_FREE(frame);
+                       return NT_STATUS_NO_MEMORY;
+               }
+
+               status = cli_full_connection_creds(&cli,
+                                                  NULL,
+                                                  dc_name,
+                                                  NULL, 0,
+                                                  "IPC$", "IPC",
+                                                  anon_creds,
+                                                  0,
+                                                  SMB_SIGNING_OFF);
        }
 
        if (!NT_STATUS_IS_OK(status)) {