From ac79bea034766adc19067c3307f2ad6bdae4c36f Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Fri, 11 May 2018 12:33:46 +0200 Subject: evaluate: Return ENOENT if rule index is too large Since EINVAL usually indicates errors from kernel, avoid using it here too. Instead return ENOENT to indicate there's no entry to append or prepend the rule to. Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso --- src/evaluate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/evaluate.c b/src/evaluate.c index cb27f7c2..4eb36e2d 100644 --- a/src/evaluate.c +++ b/src/evaluate.c @@ -2888,7 +2888,7 @@ static int rule_translate_index(struct eval_ctx *ctx, struct rule *rule) if (!rule->handle.position.id) return cmd_error(ctx, &rule->handle.index.location, "Could not process rule: %s", - strerror(EINVAL)); + strerror(ENOENT)); return 0; } -- cgit v1.2.3