summaryrefslogtreecommitdiff
path: root/source3/web
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-01-04 18:48:47 +0100
committerVolker Lendecke <vl@samba.org>2011-01-07 13:28:05 +0100
commit6ba4bddb61cb6033a7937152966a608c1bbced40 (patch)
tree56a9c41645cef3006e19f3f5eb6461a587411e96 /source3/web
parenta32f021d66f7b4f5cc3b902371a22ced1f786fee (diff)
downloadsamba-6ba4bddb61cb6033a7937152966a608c1bbced40.tar.gz
samba-6ba4bddb61cb6033a7937152966a608c1bbced40.tar.bz2
samba-6ba4bddb61cb6033a7937152966a608c1bbced40.zip
s3: Make name_query use /tmp/.nmbd/unexpected
Diffstat (limited to 'source3/web')
-rw-r--r--source3/web/diagnose.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/source3/web/diagnose.c b/source3/web/diagnose.c
index df61658f8d..fb95f0fee4 100644
--- a/source3/web/diagnose.c
+++ b/source3/web/diagnose.c
@@ -35,25 +35,21 @@ bool winbindd_running(void)
bool nmbd_running(void)
{
struct in_addr loopback_ip;
- int fd, count, flags;
+ int count, flags;
struct sockaddr_storage *ss_list;
struct sockaddr_storage ss;
+ NTSTATUS status;
loopback_ip.s_addr = htonl(INADDR_LOOPBACK);
in_addr_to_sockaddr_storage(&ss, loopback_ip);
- if ((fd = open_socket_in(SOCK_DGRAM, 0, 3,
- &ss, True)) != -1) {
- NTSTATUS status = name_query(fd, "__SAMBA__", 0,
- True, True, &ss,
- talloc_tos(), &ss_list, &count,
- &flags, NULL);
- if (NT_STATUS_IS_OK(status)) {
- TALLOC_FREE(ss_list);
- close(fd);
- return True;
- }
- close (fd);
+ status = name_query("__SAMBA__", 0,
+ True, True, &ss,
+ talloc_tos(), &ss_list, &count,
+ &flags);
+ if (NT_STATUS_IS_OK(status)) {
+ TALLOC_FREE(ss_list);
+ return True;
}
return False;