Added prefer_ipv4 bool parameter to resolve_name().
[ira/wip.git] / source3 / utils / net_util.c
index c6b6ee9e809d0b35a063f5ab64ec97cdc84832d7..383fea47cce391322c4e8b614631a79b17dbd457 100644 (file)
@@ -45,7 +45,7 @@ NTSTATUS net_rpc_lookup_name(struct net_context *c,
        }
 
        result = rpccli_lsa_open_policy(lsa_pipe, mem_ctx, false,
-                                       SEC_RIGHTS_MAXIMUM_ALLOWED,
+                                       SEC_FLAG_MAXIMUM_ALLOWED,
                                        &pol);
        if (!NT_STATUS_IS_OK(result)) {
                d_fprintf(stderr, "open_policy failed: %s\n",
@@ -393,7 +393,7 @@ bool net_find_server(struct net_context *c,
                }
        } else if (*server_name) {
                /* resolve the IP address */
-               if (!resolve_name(*server_name, server_ss, 0x20))  {
+               if (!resolve_name(*server_name, server_ss, 0x20, false))  {
                        DEBUG(1,("Unable to resolve server name\n"));
                        return false;
                }
@@ -420,8 +420,8 @@ bool net_find_server(struct net_context *c,
                struct sockaddr_storage msbrow_ss;
                char addr[INET6_ADDRSTRLEN];
 
-               /*  if (!resolve_name(MSBROWSE, &msbrow_ip, 1)) */
-               if (!resolve_name(d, &msbrow_ss, 0x1B))  {
+               /*  if (!resolve_name(MSBROWSE, &msbrow_ip, 1, false)) */
+               if (!resolve_name(d, &msbrow_ss, 0x1B, false))  {
                        DEBUG(1,("Unable to resolve domain browser via name lookup\n"));
                        return false;
                }
@@ -431,7 +431,7 @@ bool net_find_server(struct net_context *c,
        } else if (flags & NET_FLAGS_MASTER) {
                struct sockaddr_storage brow_ss;
                char addr[INET6_ADDRSTRLEN];
-               if (!resolve_name(d, &brow_ss, 0x1D))  {
+               if (!resolve_name(d, &brow_ss, 0x1D, false))  {
                                /* go looking for workgroups */
                        DEBUG(1,("Unable to resolve master browser via name lookup\n"));
                        return false;
@@ -521,6 +521,8 @@ NTSTATUS net_make_ipc_connection_ex(struct net_context *c ,const char *domain,
                d_fprintf(stderr, "Connection failed: %s\n",
                          nt_errstr(nt_status));
                cli = NULL;
+       } else if (c->opt_request_timeout) {
+               cli_set_timeout(cli, c->opt_request_timeout * 1000);
        }
 
 done: