return status;
}
-/********************************************************
- Resolve via "lmhosts" method.
-*********************************************************/
-
-static NTSTATUS resolve_lmhosts(const char *name, int name_type,
- struct ip_service **return_iplist,
- int *return_count)
-{
- /*
- * "lmhosts" means parse the local lmhosts file.
- */
- struct sockaddr_storage *ss_list;
- NTSTATUS status = NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND;
- TALLOC_CTX *ctx = NULL;
-
- *return_iplist = NULL;
- *return_count = 0;
-
- DEBUG(3,("resolve_lmhosts: "
- "Attempting lmhosts lookup for name %s<0x%x>\n",
- name, name_type));
-
- ctx = talloc_init("resolve_lmhosts");
- if (!ctx) {
- return NT_STATUS_NO_MEMORY;
- }
-
- status = resolve_lmhosts_file_as_sockaddr(get_dyn_LMHOSTSFILE(),
- name, name_type,
- ctx,
- &ss_list,
- return_count);
- if (NT_STATUS_IS_OK(status)) {
- if (convert_ss2service(return_iplist,
- ss_list,
- return_count)) {
- talloc_free(ctx);
- return NT_STATUS_OK;
- } else {
- talloc_free(ctx);
- return NT_STATUS_NO_MEMORY;
- }
- }
- talloc_free(ctx);
- return status;
-}
-
-
/********************************************************
Resolve via "hosts" method.
*********************************************************/
goto done;
}
} else if (strequal(tok, "lmhosts")) {
- status = resolve_lmhosts(name, name_type,
- return_iplist, return_count);
+ struct sockaddr_storage *ss_list;
+ status = resolve_lmhosts_file_as_sockaddr(
+ get_dyn_LMHOSTSFILE(), name, name_type,
+ talloc_tos(), &ss_list, return_count);
if (NT_STATUS_IS_OK(status)) {
+ if (!convert_ss2service(return_iplist,
+ ss_list,
+ return_count)) {
+ status = NT_STATUS_NO_MEMORY;
+ }
goto done;
}
} else if (strequal(tok, "wins")) {