Add context for libcli_resolve.
[samba-svnmirror.git] / source / auth / auth_server.c
index 36637edd57bd481b46766029b66f77b9357ace38..f200ad9665d92cb37e8bc099a254ace241907080 100644 (file)
@@ -24,7 +24,7 @@
  Support for server level security.
 ****************************************************************************/
 
-static struct smbcli_state *server_cryptkey(TALLOC_CTX *mem_ctx)
+static struct smbcli_state *server_cryptkey(TALLOC_CTX *mem_ctx, bool unicode, int maxprotocol, struct resolve_context *resolve_ctx)
 {
        struct smbcli_state *cli = NULL;
        fstring desthost;
@@ -45,7 +45,7 @@ static struct smbcli_state *server_cryptkey(TALLOC_CTX *mem_ctx)
         while(next_token( &p, desthost, LIST_SEP, sizeof(desthost))) {
                strupper(desthost);
 
-               if(!resolve_name( desthost, &dest_ip, 0x20)) {
+               if(!resolve_name(resolve_ctx, desthost, &dest_ip, 0x20)) {
                        DEBUG(1,("server_cryptkey: Can't resolve address for %s\n",desthost));
                        continue;
                }
@@ -92,7 +92,7 @@ static struct smbcli_state *server_cryptkey(TALLOC_CTX *mem_ctx)
        
        DEBUG(3,("got session\n"));
 
-       if (!smbcli_negprot(cli, lp_cli_maxprotocol(global_loadparm))) {
+       if (!smbcli_negprot(cli, unicode, maxprotocol)) {
                DEBUG(1,("%s rejected the negprot\n",desthost));
                release_server_mutex();
                talloc_free(cli);
@@ -148,7 +148,7 @@ static DATA_BLOB auth_get_challenge_server(const struct auth_context *auth_conte
                                           void **my_private_data, 
                                           TALLOC_CTX *mem_ctx)
 {
-       struct smbcli_state *cli = server_cryptkey(mem_ctx);
+       struct smbcli_state *cli = server_cryptkey(mem_ctx, lp_cli_maxprotocol(auth_context->lp_ctx));
        
        if (cli) {
                DEBUG(3,("using password server validation\n"));
@@ -206,7 +206,7 @@ static NTSTATUS check_smbserver_security(const struct auth_context *auth_context
         * password file.
         */
 
-       if (lp_is_myname(global_loadparm, user_info->domain.str)) {
+       if (lp_is_myname(auth_context->lp_ctx, user_info->domain.str)) {
                DEBUG(3,("check_smbserver_security: Requested domain was for this machine.\n"));
                return NT_STATUS_LOGON_FAILURE;
        }
@@ -215,7 +215,7 @@ static NTSTATUS check_smbserver_security(const struct auth_context *auth_context
        
        if (cli) {
        } else {
-               cli = server_cryptkey(mem_ctx);
+               cli = server_cryptkey(mem_ctx, lp_unicode(auth_context->lp_ctx), lp_cli_maxprotocol(auth_context->lp_ctx), lp_resolve_context(auth_context->lp_ctx));
                locally_made_cli = true;
        }