aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-12-30 16:43:58 +0100
committerMax Kellermann <max@duempel.org>2008-12-30 16:43:58 +0100
commitbbed35822e52a204bf3d82e5df4bb8d00b67af39 (patch)
tree8060641b6163cb05d7ecdd5aec350394d9e2444f /src
parente9a3c4ce32e9728189689e2d15ff7c17c56e577f (diff)
downloadmpd-bbed35822e52a204bf3d82e5df4bb8d00b67af39.tar.gz
mpd-bbed35822e52a204bf3d82e5df4bb8d00b67af39.tar.xz
mpd-bbed35822e52a204bf3d82e5df4bb8d00b67af39.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/zeroconf.c12
1 files 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;