Added prefer_ipv4 bool parameter to resolve_name().
[ira/wip.git] / source3 / auth / auth_server.c
index e74e3f5b3bf89810a0279b8fb337ad06017ca712..287b50b080ff437edc11b69a9c22c6e38634da82 100644 (file)
@@ -38,6 +38,7 @@ static struct cli_state *server_cryptkey(TALLOC_CTX *mem_ctx)
        char *pserver = NULL;
        bool connected_ok = False;
        struct named_mutex *mutex = NULL;
+       NTSTATUS status;
 
        if (!(cli = cli_initialise()))
                return NULL;
@@ -49,7 +50,6 @@ static struct cli_state *server_cryptkey(TALLOC_CTX *mem_ctx)
        p = pserver;
 
         while(next_token_talloc(mem_ctx, &p, &desthost, LIST_SEP)) {
-               NTSTATUS status;
 
                desthost = talloc_sub_basic(mem_ctx,
                                current_user_info.smb_name,
@@ -60,7 +60,7 @@ static struct cli_state *server_cryptkey(TALLOC_CTX *mem_ctx)
                }
                strupper_m(desthost);
 
-               if(!resolve_name( desthost, &dest_ss, 0x20)) {
+               if(!resolve_name( desthost, &dest_ss, 0x20, false)) {
                        DEBUG(1,("server_cryptkey: Can't resolve address for %s\n",desthost));
                        continue;
                }
@@ -112,9 +112,12 @@ static struct cli_state *server_cryptkey(TALLOC_CTX *mem_ctx)
 
        DEBUG(3,("got session\n"));
 
-       if (!cli_negprot(cli)) {
+       status = cli_negprot(cli);
+
+       if (!NT_STATUS_IS_OK(status)) {
                TALLOC_FREE(mutex);
-               DEBUG(1,("%s rejected the negprot\n",desthost));
+               DEBUG(1, ("%s rejected the negprot: %s\n",
+                         desthost, nt_errstr(status)));
                cli_shutdown(cli);
                return NULL;
        }