From 23cbc33ec79a98119b284c2db6f5a228a97cac3b Mon Sep 17 00:00:00 2001 From: Luke Heberling Date: Thu, 20 Aug 2009 14:10:37 +0200 Subject: [PATCH] =?utf8?q?powerdns=20plugin:=20Fix=20handling=20of=20the?= =?utf8?q?=20=E2=80=9CLocalSocket=E2=80=9D=20config=20option.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit → See also: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=535787 --- src/powerdns.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/powerdns.c b/src/powerdns.c index 09ad8353..7288c372 100644 --- a/src/powerdns.c +++ b/src/powerdns.c @@ -923,11 +923,18 @@ static int powerdns_config (oconfig_item_t *ci) /* {{{ */ powerdns_config_add_server (option); else if (strcasecmp ("LocalSocket", option->key) == 0) { - char *temp = strdup (option->key); - if (temp == NULL) - return (1); - sfree (local_sockpath); - local_sockpath = temp; + if ((option->values_num != 1) || (option->values[0].type != OCONFIG_TYPE_STRING)) + { + WARNING ("powerdns plugin: `%s' needs exactly one string argument.", option->key); + } + else + { + char *temp = strdup (option->values[0].value.string); + if (temp == NULL) + return (1); + sfree (local_sockpath); + local_sockpath = temp; + } } else { -- 2.30.2