diff options
author | Jakub Dorňák <jdornak@redhat.com> | 2012-07-25 13:12:56 -0500 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2012-07-25 13:18:14 -0500 |
commit | ac152ece0206b4cde28acf78abb21518e67513e1 (patch) | |
tree | 23be83735379835504dd5aa0edd71f70721dbfbb /src/dns-manager | |
parent | e0e804b30b1eef92e3024cfad8a3abfa172c2960 (diff) | |
download | NetworkManager-ac152ece0206b4cde28acf78abb21518e67513e1.tar.gz |
dnsmasq: allow custom configuration via files in /etc/NetworkManager/dnsmasq.d (bgo #679628)
We don't use the default dnsmasq directory because packages often drop files
there that don't take account of NM's specific use-case and end up conflicting
with the specific local caching nameserver functionality that NM uses dnsmasq
for. NM's private dnsmasq is orthogonal to whatever global dnsmasq
daemon may be running, and with that daemons configuration.
(dcbw: change directory to private one)
Diffstat (limited to 'src/dns-manager')
-rw-r--r-- | src/dns-manager/Makefile.am | 3 | ||||
-rw-r--r-- | src/dns-manager/nm-dns-dnsmasq.c | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/dns-manager/Makefile.am b/src/dns-manager/Makefile.am index fd31b140cf..c6c284461b 100644 --- a/src/dns-manager/Makefile.am +++ b/src/dns-manager/Makefile.am @@ -25,7 +25,8 @@ libdns_manager_la_CPPFLAGS = \ $(LIBNL_CFLAGS) \ $(DBUS_CFLAGS) \ $(GLIB_CFLAGS) \ - -DLOCALSTATEDIR=\"$(localstatedir)\" + -DLOCALSTATEDIR=\"$(localstatedir)\" \ + -DSYSCONFDIR=\"$(sysconfdir)\" libdns_manager_la_LIBADD = \ $(top_builddir)/src/logging/libnm-logging.la \ diff --git a/src/dns-manager/nm-dns-dnsmasq.c b/src/dns-manager/nm-dns-dnsmasq.c index 8e216f4d29..9090e26bc6 100644 --- a/src/dns-manager/nm-dns-dnsmasq.c +++ b/src/dns-manager/nm-dns-dnsmasq.c @@ -41,6 +41,7 @@ G_DEFINE_TYPE (NMDnsDnsmasq, nm_dns_dnsmasq, NM_TYPE_DNS_PLUGIN) #define PIDFILE LOCALSTATEDIR "/run/nm-dns-dnsmasq.pid" #define CONFFILE LOCALSTATEDIR "/run/nm-dns-dnsmasq.conf" +#define CONFDIR SYSCONFDIR "/NetworkManager/dnsmasq.d" typedef struct { guint32 foo; @@ -246,7 +247,7 @@ update (NMDnsPlugin *plugin, NMDnsDnsmasq *self = NM_DNS_DNSMASQ (plugin); GString *conf; GSList *iter; - const char *argv[11]; + const char *argv[12]; GError *error = NULL; int ignored; GPid pid = 0; @@ -309,7 +310,8 @@ update (NMDnsPlugin *plugin, argv[7] = "--conf-file=" CONFFILE; argv[8] = "--cache-size=400"; argv[9] = "--proxy-dnssec"; /* Allow DNSSEC to pass through */ - argv[10] = NULL; + argv[10] = "--conf-dir=" CONFDIR; + argv[11] = NULL; /* And finally spawn dnsmasq */ pid = nm_dns_plugin_child_spawn (NM_DNS_PLUGIN (self), argv, PIDFILE, "bin/dnsmasq"); |