From f150ca93d1dd4f0284a1e4a44125e6e2e9846dd0 Mon Sep 17 00:00:00 2001 From: Alexey Gladkov Date: Mon, 28 Mar 2022 13:59:15 +0200 Subject: initrd-scanmod: module must satisfy all the rules from the ruleset Signed-off-by: Alexey Gladkov --- utils/initrd-scanmod/initrd-scanmod-walk.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/utils/initrd-scanmod/initrd-scanmod-walk.c b/utils/initrd-scanmod/initrd-scanmod-walk.c index 87352b718..893e9d16e 100644 --- a/utils/initrd-scanmod/initrd-scanmod-walk.c +++ b/utils/initrd-scanmod/initrd-scanmod-walk.c @@ -117,7 +117,7 @@ process_module_ruleset(struct kmod_ctx *ctx, const char *filename, struct rulese if (rc < 0) goto exit; if (rc > 0) { - is_match = 1; + is_match |= RULESET_HAS_PATHS; if (verbose > 1) warnx("%s: path matches", kmod_module_get_path(mod)); @@ -139,7 +139,7 @@ process_module_ruleset(struct kmod_ctx *ctx, const char *filename, struct rulese if (rc < 0) goto exit; if (rc > 0) { - is_match = 1; + is_match |= RULESET_HAS_INFO; if (verbose > 1) warnx("%s: the module information matches", kmod_module_get_path(mod)); @@ -167,7 +167,7 @@ process_module_ruleset(struct kmod_ctx *ctx, const char *filename, struct rulese if (rc < 0) goto exit; if (rc > 0) { - is_match = 1; + is_match |= RULESET_HAS_SYMBOLS; if (verbose > 1) warnx("%s: symbols matches", kmod_module_get_path(mod)); @@ -193,7 +193,7 @@ process_module_ruleset(struct kmod_ctx *ctx, const char *filename, struct rulese if (rc < 0) goto exit; if (rc > 0) { - is_match = 1; + is_match |= RULESET_HAS_SYMBOLS; if (verbose > 1) warnx("%s: symbols matches", kmod_module_get_path(mod)); @@ -208,7 +208,7 @@ process_module_ruleset(struct kmod_ctx *ctx, const char *filename, struct rulese goto exit; } } - if (is_match) + if (set->flags == is_match) printf("%s\n", kmod_module_get_path(mod)); exit: if (mod) -- 2.33.0