s3:libsmb/clirap2: make use of cli_state_remote_name()
authorStefan Metzmacher <metze@samba.org>
Fri, 22 Jul 2011 14:33:16 +0000 (16:33 +0200)
committerStefan Metzmacher <metze@samba.org>
Fri, 22 Jul 2011 15:06:09 +0000 (17:06 +0200)
metze

source3/libsmb/clirap2.c

index 1d36ca65ca1b79493ff95de0c3700caf545a4427..8c8968651b80e91b46f98fe2488300689a97951d 100644 (file)
@@ -1535,7 +1535,7 @@ bool cli_get_pdc_name(struct cli_state *cli, const char *workgroup, char **pdc_n
                } else {
                        DEBUG(4, ("cli_get_pdc_name: machine %s failed the "
                                  "NetServerEnum call. Error was : %s.\n",
-                                 cli->desthost,
+                                 cli_state_remote_name(cli),
                                  win_errstr(W_ERROR(cli->rap_error))));
                }
        }
@@ -1756,7 +1756,7 @@ bool cli_get_server_name(TALLOC_CTX *mem_ctx, struct cli_state *cli,
 * PURPOSE:  Remotes a NetServerEnum2 API call to the current server
 *           requesting server_info_0 level information of machines
 *           matching the given server type. If the returned server
-*           list contains the machine name contained in cli->desthost
+*           list contains the machine name contained in cli_state_remote_name()
 *           then we conclude the server type checks out. This routine
 *           is useful to retrieve list of server's of a certain
 *           type when all you have is a null session connection and
@@ -1791,6 +1791,7 @@ bool cli_ns_check_server_type(struct cli_state *cli, char *workgroup, uint32 sty
                +RAP_MACHNAME_LEN];             /* workgroup     */
        bool found_server = false;
        int res = -1;
+       const char *remote_name = cli_state_remote_name(cli);
 
        /* send a SMBtrans command with api NetServerEnum */
        p = make_header(param, RAP_NetServerEnum2,
@@ -1826,7 +1827,7 @@ bool cli_ns_check_server_type(struct cli_state *cli, char *workgroup, uint32 sty
                                                RAP_MACHNAME_LEN,
                                                RAP_MACHNAME_LEN,
                                                endp);
-                               if (strequal(ret_server, cli->desthost)) {
+                               if (strequal(ret_server, remote_name)) {
                                        found_server = true;
                                        break;
                                }
@@ -1834,7 +1835,7 @@ bool cli_ns_check_server_type(struct cli_state *cli, char *workgroup, uint32 sty
                } else {
                        DEBUG(4, ("cli_ns_check_server_type: machine %s "
                                  "failed the NetServerEnum call. Error was : "
-                                 "%s.\n", cli->desthost,
+                                 "%s.\n", remote_name,
                                  win_errstr(W_ERROR(cli->rap_error))));
                }
        }