]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:libsmb: Pass cli_credentials to get_ipc_connect_master_ip()
authorAndreas Schneider <asn@samba.org>
Wed, 13 Jan 2021 14:40:08 +0000 (15:40 +0100)
committerVolker Lendecke <vl@samba.org>
Wed, 13 Jan 2021 20:28:34 +0000 (20:28 +0000)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
source3/libsmb/cliconnect.c
source3/libsmb/libsmb_dir.c
source3/libsmb/proto.h

index 6623567554d5114e08b57c8c1ea2cb4cbd192706..b95b14b018cb5fad61a52a4ef84941b7bbd97212 100644 (file)
@@ -23,7 +23,6 @@
 #include "includes.h"
 #include "libsmb/libsmb.h"
 #include "libsmb/namequery.h"
-#include "auth_info.h"
 #include "../libcli/auth/libcli_auth.h"
 #include "../libcli/auth/spnego.h"
 #include "smb_krb5.h"
@@ -3887,14 +3886,13 @@ struct cli_state *get_ipc_connect(char *server,
 
 struct cli_state *get_ipc_connect_master_ip(TALLOC_CTX *ctx,
                                struct sockaddr_storage *mb_ip,
-                               const struct user_auth_info *user_info,
+                               struct cli_credentials *creds,
                                char **pp_workgroup_out)
 {
        char addr[INET6_ADDRSTRLEN];
         fstring name;
        struct cli_state *cli;
        struct sockaddr_storage server_ss;
-       struct cli_credentials *creds = get_cmdline_auth_info_creds(user_info);
 
        *pp_workgroup_out = NULL;
 
index f1596b743efc55b41b87ea7f16822fef918c5d9f..3c42071ae1bc078949c988c62d6d272fbad678eb 100644 (file)
@@ -565,6 +565,7 @@ SMBC_opendir_ctx(SMBCCTX *context,
                 struct sockaddr_storage *ip_list;
                 struct sockaddr_storage server_addr;
                 struct user_auth_info *u_info;
+               struct cli_credentials *creds = NULL;
                NTSTATUS status;
 
                if (share[0] != (char)0 || path[0] != (char)0) {
@@ -596,6 +597,8 @@ SMBC_opendir_ctx(SMBCCTX *context,
                set_cmdline_auth_info_username(u_info, user);
                set_cmdline_auth_info_password(u_info, password);
 
+               creds = get_cmdline_auth_info_creds(u_info);
+
                /*
                  * We have server and share and path empty but options
                  * requesting that we scan all master browsers for their list
@@ -654,7 +657,7 @@ SMBC_opendir_ctx(SMBCCTX *context,
 
                         cli = get_ipc_connect_master_ip(talloc_tos(),
                                                        &ip_list[i],
-                                                        u_info,
+                                                       creds,
                                                        &wg_ptr);
                        /* cli == NULL is the master browser refused to talk or
                           could not be found */
index e99cf1d11ba06073ac1796bc70ba79109ca8a000..dfa0969b3096515dcd113531922c6bee331774f7 100644 (file)
@@ -118,7 +118,7 @@ struct cli_state *get_ipc_connect(char *server,
                                struct cli_credentials *creds);
 struct cli_state *get_ipc_connect_master_ip(TALLOC_CTX *ctx,
                                struct sockaddr_storage *mb_ip,
-                               const struct user_auth_info *user_info,
+                               struct cli_credentials *creds,
                                char **pp_workgroup_out);
 
 /* The following definitions come from libsmb/clidfs.c  */