Commit bbed3582 authored by Max Kellermann's avatar Max Kellermann

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.
parent e9a3c4ce
...@@ -448,14 +448,10 @@ static void init_avahi(const char *serviceName) ...@@ -448,14 +448,10 @@ static void init_avahi(const char *serviceName)
int error; int error;
g_debug("Avahi: Initializing interface"); g_debug("Avahi: Initializing interface");
if (avahi_is_valid_service_name(serviceName)) { if (!avahi_is_valid_service_name(serviceName))
avahiName = avahi_strdup(serviceName); g_error("Invalid zeroconf_name \"%s\"", serviceName);
} else {
g_warning("Invalid zeroconf_name \"%s\", defaulting to " avahiName = avahi_strdup(serviceName);
"\"%s\" instead.",
serviceName, SERVICE_NAME);
avahiName = avahi_strdup(SERVICE_NAME);
}
avahiRunning = 1; avahiRunning = 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment