diff options
Diffstat (limited to 'avahi-daemon')
-rw-r--r-- | avahi-daemon/Makefile.am | 9 | ||||
-rw-r--r-- | avahi-daemon/Server.introspect | 4 | ||||
-rw-r--r-- | avahi-daemon/dbus-protocol.c | 8 | ||||
-rw-r--r-- | avahi-daemon/main.c | 6 | ||||
-rw-r--r-- | avahi-daemon/main.h | 2 |
5 files changed, 27 insertions, 2 deletions
diff --git a/avahi-daemon/Makefile.am b/avahi-daemon/Makefile.am index ffcfa58..e1d64a4 100644 --- a/avahi-daemon/Makefile.am +++ b/avahi-daemon/Makefile.am @@ -100,12 +100,17 @@ avahi_daemon_SOURCES += \ dbus-sync-host-name-resolver.c \ dbus-sync-service-resolver.c \ dbus-record-browser.c \ - ../avahi-common/dbus.c ../avahi-common/dbus.h \ - ../avahi-common/dbus-watch-glue.c ../avahi-common/dbus-watch-glue.h + ../avahi-common/dbus.c ../avahi-common/dbus.h \ + ../avahi-common/dbus-watch-glue.c ../avahi-common/dbus-watch-glue.h \ + ../avahi-client/check-nss.c avahi_daemon_LDADD += \ $(DBUS_LIBS) +if HAVE_DLOPEN +avahi_daemon_LDADD += -ldl +endif + avahi_daemon_CFLAGS += $(DBUS_CFLAGS) dbusservice_DATA = avahi-dbus.conf diff --git a/avahi-daemon/Server.introspect b/avahi-daemon/Server.introspect index 5a3f88b..6635618 100644 --- a/avahi-daemon/Server.introspect +++ b/avahi-daemon/Server.introspect @@ -51,6 +51,10 @@ <arg name="name" type="s" direction="out"/> </method> + <method name="IsNSSSupportAvailable"> + <arg name="yes" type="b" direction="out"/> + </method> + <method name="GetState"> <arg name="state" type="i" direction="out"/> </method> diff --git a/avahi-daemon/dbus-protocol.c b/avahi-daemon/dbus-protocol.c index f14e746..2e3fd2f 100644 --- a/avahi-daemon/dbus-protocol.c +++ b/avahi-daemon/dbus-protocol.c @@ -251,6 +251,14 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH return avahi_dbus_respond_string(c, m, avahi_server_get_host_name_fqdn(avahi_server)); + } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVER, "IsNSSSupportAvailable")) { + if (!(dbus_message_get_args(m, &error, DBUS_TYPE_INVALID))) { + avahi_log_warn("Error parsing Server::IsNSSSupportAvailable message"); + goto fail; + } + + return avahi_dbus_respond_boolean(c, m, nss_support); + } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVER, "GetVersionString")) { if (!(dbus_message_get_args(m, &error, DBUS_TYPE_INVALID))) { diff --git a/avahi-daemon/main.c b/avahi-daemon/main.c index da19868..8327200 100644 --- a/avahi-daemon/main.c +++ b/avahi-daemon/main.c @@ -75,6 +75,7 @@ AvahiServer *avahi_server = NULL; AvahiSimplePoll *simple_poll_api = NULL; static char *argv0 = NULL; +int nss_support = 0; typedef enum { DAEMON_RUN, @@ -697,6 +698,8 @@ static void signal_callback(AvahiWatch *watch, AVAHI_GCC_UNUSED int fd, AVAHI_GC } } +/* Imported from ../avahi-client/nss-check.c */ +int avahi_nss_support(void); static int run_server(DaemonConfig *c) { int r = -1; @@ -707,6 +710,9 @@ static int run_server(DaemonConfig *c) { assert(c); + if (!(nss_support = avahi_nss_support())) + avahi_log_warn("WARNING: No NSS support for mDNS detected, consider installing nss-mdns!"); + if (!(simple_poll_api = avahi_simple_poll_new())) { avahi_log_error("Failed to create main loop object."); goto finish; diff --git a/avahi-daemon/main.h b/avahi-daemon/main.h index 951b5f6..77af0d0 100644 --- a/avahi-daemon/main.h +++ b/avahi-daemon/main.h @@ -28,4 +28,6 @@ extern AvahiServer *avahi_server; extern AvahiSimplePoll *simple_poll_api; +extern int nss_support; + #endif |