Array contains a "lock" flag, allowing "per array" locking.
[apps/pfixtools.git] / postlicyd / config.c
index 0bd69e2..b563ef3 100644 (file)
@@ -111,6 +111,9 @@ static bool config_second_pass(config_t *config)
     if (!ok) {
         return false;
     }
+    if (!filter_check_safety(&config->filters)) {
+        return false;
+    }
 
     ok = false;
     foreach (filter_param_t *param, config->params) {
@@ -264,6 +267,9 @@ config_t *config_read(const char *file)
             if (escaped) {                                                     \
                 ADD_IN_BUFFER(Buffer, Len, '\\');                              \
             }                                                                  \
+            while ((Len) > 0 && isspace((Buffer)[(Len) - 1])) {                \
+                (Buffer)[--(Len)] = '\0';                                      \
+            }                                                                  \
         }                                                                      \
         READ_NEXT(OnEOF);                                                      \
     } while(0)
@@ -298,7 +304,8 @@ read_param_value:
         filter_param_t param;
         param.type  = param_tokenize(key, key_len);
         if (param.type != ATK_UNKNOWN) {
-            param.value = m_strdup(value);
+            param.value     = p_dupstr(value, value_len);
+            param.value_len = value_len;
             array_add(config->params, param);
         }
     }