summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2010-12-28 13:47:35 +0100
committerVolker Lendecke <vlendec@samba.org>2010-12-28 18:21:05 +0100
commit4622812a41eb5ce07dd8f74534217e858743883f (patch)
tree3a07c7d4971c9e11fe3a623311098baaa7a925e4 /source3/utils
parent28d997a89056f144de6a7b95af0e54a044c5e5b3 (diff)
downloadsamba-4622812a41eb5ce07dd8f74534217e858743883f.tar.gz
samba-4622812a41eb5ce07dd8f74534217e858743883f.tar.bz2
samba-4622812a41eb5ce07dd8f74534217e858743883f.zip
s3: Make name_query return NTSTATUS
Also use talloc for the result Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Tue Dec 28 18:21:05 CET 2010 on sn-devel-104
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/nmblookup.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/source3/utils/nmblookup.c b/source3/utils/nmblookup.c
index 5bbd06c994..4a55647361 100644
--- a/source3/utils/nmblookup.c
+++ b/source3/utils/nmblookup.c
@@ -156,14 +156,16 @@ static bool query_one(const char *lookup, unsigned int lookup_type)
{
int j, count, flags = 0;
struct sockaddr_storage *ip_list=NULL;
+ NTSTATUS status;
if (got_bcast) {
char addr[INET6_ADDRSTRLEN];
print_sockaddr(addr, sizeof(addr), &bcast_addr);
d_printf("querying %s on %s\n", lookup, addr);
- ip_list = name_query(ServerFD,lookup,lookup_type,use_bcast,
- use_bcast?true:recursion_desired,
- &bcast_addr, &count, &flags, NULL);
+ status = name_query(ServerFD,lookup,lookup_type,use_bcast,
+ use_bcast?true:recursion_desired,
+ &bcast_addr, talloc_tos(),
+ &ip_list, &count, &flags, NULL);
} else {
const struct in_addr *bcast;
for (j=iface_count() - 1;
@@ -180,14 +182,15 @@ static bool query_one(const char *lookup, unsigned int lookup_type)
print_sockaddr(addr, sizeof(addr), &bcast_ss);
d_printf("querying %s on %s\n",
lookup, addr);
- ip_list = name_query(ServerFD,lookup,lookup_type,
- use_bcast,
- use_bcast?True:recursion_desired,
- &bcast_ss,&count, &flags, NULL);
+ status = name_query(ServerFD,lookup,lookup_type,
+ use_bcast,
+ use_bcast?True:recursion_desired,
+ &bcast_ss, talloc_tos(),
+ &ip_list, &count, &flags, NULL);
}
}
- if (!ip_list) {
+ if (!NT_STATUS_IS_OK(status)) {
return false;
}
@@ -220,9 +223,9 @@ static bool query_one(const char *lookup, unsigned int lookup_type)
}
}
- free(ip_list);
+ TALLOC_FREE(ip_list);
- return (ip_list != NULL);
+ return NT_STATUS_IS_OK(status);
}