]> source.dussan.org Git - rspamd.git/commitdiff
Fix logging conversion from xml.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 15 Nov 2013 15:49:15 +0000 (15:49 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 15 Nov 2013 15:49:15 +0000 (15:49 +0000)
src/cfg_rcl.c
src/cfg_xml.c

index be7bb2a4805a89657e3c6e590a6cb3b453c684c4..c9e1c4437622f185cd573cfee55445b67147b436 100644 (file)
@@ -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 */
index ffe9b80272393578e40df18713c83aacfa037048..1e20f04568e5626cbe9ccd47fb87105d33b3d0a4 100644 (file)
@@ -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;