summaryrefslogtreecommitdiff
path: root/source3/libsmb/namequery.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2015-12-15 21:52:38 +0100
committerUri Simchoni <uri@samba.org>2016-01-13 07:48:30 +0100
commit812e07418eae036f079bec7835516a86ae89f86e (patch)
tree11f60dfa2dfbb4c8f5bd2952ee58fcee3dd69879 /source3/libsmb/namequery.c
parentc29188f501936f986470821064032d6681622ca5 (diff)
downloadsamba-812e07418eae036f079bec7835516a86ae89f86e.tar.gz
libsmb: Remove ip_service based resolve_lmhosts
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org>
Diffstat (limited to 'source3/libsmb/namequery.c')
-rw-r--r--source3/libsmb/namequery.c59
1 files changed, 9 insertions, 50 deletions
diff --git a/source3/libsmb/namequery.c b/source3/libsmb/namequery.c
index 38c6648f02b..4709c035545 100644
--- a/source3/libsmb/namequery.c
+++ b/source3/libsmb/namequery.c
@@ -2275,54 +2275,6 @@ fail:
}
/********************************************************
- 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.
*********************************************************/
@@ -2747,9 +2699,16 @@ NTSTATUS internal_resolve_name(const char *name,
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")) {