From: Vsevolod Stakhov Date: Fri, 15 Nov 2013 15:49:15 +0000 (+0000) Subject: Fix logging conversion from xml. X-Git-Tag: 0.6.0~64 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=384f8cfa8afeb9e05fd07d6eb947647c7591af81;p=rspamd.git Fix logging conversion from xml. --- diff --git a/src/cfg_rcl.c b/src/cfg_rcl.c index be7bb2a48..c9e1c4437 100644 --- a/src/cfg_rcl.c +++ b/src/cfg_rcl.c @@ -39,7 +39,6 @@ rspamd_rcl_logging_handler (struct config_file *cfg, ucl_object_t *obj, gpointer ud, struct rspamd_rcl_section *section, GError **err) { ucl_object_t *val; - gchar *filepath; const gchar *facility, *log_type, *log_level; val = ucl_object_find_key (obj, "type"); @@ -51,13 +50,8 @@ rspamd_rcl_logging_handler (struct config_file *cfg, ucl_object_t *obj, g_set_error (err, CFG_RCL_ERROR, ENOENT, "filename attribute must be specified for file logging type"); return FALSE; } - if ((filepath = realpath (ucl_object_tostring (val), NULL)) == NULL || - access (filepath, W_OK) == -1) { - g_set_error (err, CFG_RCL_ERROR, errno, "log file is inaccessible"); - return FALSE; - } cfg->log_type = RSPAMD_LOG_FILE; - cfg->log_file = memory_pool_strdup (cfg->cfg_pool, filepath); + cfg->log_file = memory_pool_strdup (cfg->cfg_pool, ucl_object_tostring (val)); } else if (g_ascii_strcasecmp (log_type, "syslog") == 0) { /* Need to get facility */ diff --git a/src/cfg_xml.c b/src/cfg_xml.c index ffe9b8027..1e20f0456 100644 --- a/src/cfg_xml.c +++ b/src/cfg_xml.c @@ -834,7 +834,8 @@ rspamd_xml_start_element (GMarkupParseContext *context, const gchar *element_nam } else { tobj = ucl_object_new (); - if (process_attrs (attribute_names, attribute_values, tobj)) { + if (g_ascii_strcasecmp (element_name, "symbol") == 0 && + process_attrs (attribute_names, attribute_values, tobj)) { ud->parent_pointer[ud->nested] = tobj; tobj->type = UCL_OBJECT; ud->parent_pointer[ud->nested - 1] = @@ -853,6 +854,7 @@ rspamd_xml_start_element (GMarkupParseContext *context, const gchar *element_nam } else { ucl_object_unref (tobj); + process_attrs (attribute_names, attribute_values, ud->parent_pointer[ud->nested - 1]); } } break;