Add a "special" return value: abort.
[apps/pfixtools.git] / postlicyd / rbl.c
index ed4ab2b..131b095 100644 (file)
@@ -252,7 +252,7 @@ static bool rbl_filter_constructor(filter_t *filter)
         return false;                                                          \
     }
 
-    foreach (filter_params_t *param, filter->params) {
+    foreach (filter_param_t *param, filter->params) {
         switch (param->type) {
           /* file parameter is:
            *  [no]lock:weight:filename
@@ -317,7 +317,7 @@ static bool rbl_filter_constructor(filter_t *filter)
           case ATK_HARD_THRESHOLD: {
             char *next;
             data->hard_threshold = strtol(param->value, &next, 10);
-            PARSE_CHECK(*next, "invalid threshold value %s", param->value);
+            PARSE_CHECK(!*next, "invalid threshold value %s", param->value);
           } break;
 
           /* soft_threshold parameter is an integer.
@@ -329,7 +329,7 @@ static bool rbl_filter_constructor(filter_t *filter)
           case ATK_SOFT_THRESHOLD: {
             char *next;
             data->soft_threshold = strtol(param->value, &next, 10);
-            PARSE_CHECK(*next, "invalid threshold value %s", param->value);
+            PARSE_CHECK(!*next, "invalid threshold value %s", param->value);
           } break;
 
           default: break;
@@ -383,6 +383,7 @@ static int rbl_init(void)
                                           rbl_filter_destructor, rbl_filter);
     /* Hooks.
      */
+    (void)filter_hook_register(type, "abort");
     (void)filter_hook_register(type, "error");
     (void)filter_hook_register(type, "fail");
     (void)filter_hook_register(type, "hard_match");