The Samba-Bugzilla – Attachment 7935 Details for
Bug 9183
DNS server does not listen on localhost
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for v4-0-test
0001-s4-dns_server-introduce-the-wildcard-binding-feature.patch (text/plain), 2.91 KB, created by
Kai Blin
on 2012-09-25 05:55:00 UTC
(
hide
)
Description:
Patch for v4-0-test
Filename:
MIME Type:
Creator:
Kai Blin
Created:
2012-09-25 05:55:00 UTC
Size:
2.91 KB
patch
obsolete
>From dea9325974b5b32497b942037def5764c14d6600 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Matthias=20Dieter=20Walln=C3=B6fer?= <mdw@samba.org> >Date: Sun, 12 Aug 2012 18:08:20 +0200 >Subject: [PATCH] s4:dns_server - introduce the wildcard binding feature > >We need the wildcard binding feature otherwise we might get bound to a >private interface in case of multiple interfaces and no "interfaces" >parameter in smb.conf. > >Code taken from source4/ldap_server/ldap_server.c > >Signed-off-by: Kai Blin <kai@samba.org> > >Autobuild-User(master): Kai Blin <kai@samba.org> >Autobuild-Date(master): Sun Sep 23 23:44:03 CEST 2012 on sn-devel-104 >--- > source4/dns_server/dns_server.c | 38 ++++++++++++++++++++++++++++---------- > 1 files changed, 28 insertions(+), 10 deletions(-) > >diff --git a/source4/dns_server/dns_server.c b/source4/dns_server/dns_server.c >index c88ea83..dbdc300 100644 >--- a/source4/dns_server/dns_server.c >+++ b/source4/dns_server/dns_server.c >@@ -669,13 +669,29 @@ static NTSTATUS dns_startup_interfaces(struct dns_server *dns, struct loadparm_c > return NT_STATUS_INTERNAL_ERROR; > } > >- num_interfaces = iface_list_count(ifaces); >+ if (ifaces != NULL) { >+ num_interfaces = iface_list_count(ifaces); > >- for (i=0; i<num_interfaces; i++) { >- const char *address = talloc_strdup(tmp_ctx, iface_list_n_ip(ifaces, i)); >+ for (i=0; i<num_interfaces; i++) { >+ const char *address = talloc_strdup(tmp_ctx, >+ iface_list_n_ip(ifaces, i)); > >- status = dns_add_socket(dns, model_ops, "dns", address, DNS_SERVICE_PORT); >- NT_STATUS_NOT_OK_RETURN(status); >+ status = dns_add_socket(dns, model_ops, "dns", address, >+ DNS_SERVICE_PORT); >+ NT_STATUS_NOT_OK_RETURN(status); >+ } >+ } else { >+ const char **wcard; >+ wcard = iface_list_wildcard(tmp_ctx, lp_ctx); >+ if (wcard == NULL) { >+ DEBUG(0, ("No wildcard address available\n")); >+ return NT_STATUS_INTERNAL_ERROR; >+ } >+ for (i = 0; wcard[i] != NULL; i++) { >+ status = dns_add_socket(dns, model_ops, "dns", wcard[i], >+ DNS_SERVICE_PORT); >+ NT_STATUS_NOT_OK_RETURN(status); >+ } > } > > talloc_free(tmp_ctx); >@@ -729,7 +745,7 @@ static void dns_task_init(struct task_server *task) > { > struct dns_server *dns; > NTSTATUS status; >- struct interface *ifaces; >+ struct interface *ifaces = NULL; > int ret; > struct ldb_result *res; > static const char * const attrs[] = { "name", NULL}; >@@ -747,11 +763,13 @@ static void dns_task_init(struct task_server *task) > break; > } > >- load_interface_list(task, task->lp_ctx, &ifaces); >+ if (lpcfg_interfaces(task->lp_ctx) && lpcfg_bind_interfaces_only(task->lp_ctx)) { >+ load_interface_list(task, task->lp_ctx, &ifaces); > >- if (iface_list_count(ifaces) == 0) { >- task_server_terminate(task, "dns: no network interfaces configured", false); >- return; >+ if (iface_list_count(ifaces) == 0) { >+ task_server_terminate(task, "dns: no network interfaces configured", false); >+ return; >+ } > } > > task_server_set_title(task, "task[dns]"); >-- >1.7.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
kai
:
review+
abartlet
:
review+
Actions:
View
Attachments on
bug 9183
: 7935