From bbed35822e52a204bf3d82e5df4bb8d00b67af39 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 30 Dec 2008 16:43:58 +0100 Subject: zeroconf: fail if avahi service name is invalid If the configured avahi service name is invalid, abort MPD. Don't fall back to the default service name. --- src/zeroconf.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/zeroconf.c b/src/zeroconf.c index 922b6809b..23d7a36e9 100644 --- a/src/zeroconf.c +++ b/src/zeroconf.c @@ -448,14 +448,10 @@ static void init_avahi(const char *serviceName) int error; g_debug("Avahi: Initializing interface"); - if (avahi_is_valid_service_name(serviceName)) { - avahiName = avahi_strdup(serviceName); - } else { - g_warning("Invalid zeroconf_name \"%s\", defaulting to " - "\"%s\" instead.", - serviceName, SERVICE_NAME); - avahiName = avahi_strdup(SERVICE_NAME); - } + if (!avahi_is_valid_service_name(serviceName)) + g_error("Invalid zeroconf_name \"%s\"", serviceName); + + avahiName = avahi_strdup(serviceName); avahiRunning = 1; -- cgit v1.2.3