From 3d7fb67ad45a7fa7efe24ca81ce6abceaa3a7d64 Mon Sep 17 00:00:00 2001 From: Petr Lautrbach Date: Tue, 27 May 2025 14:17:49 +0200 Subject: [PATCH] libselinux: Revert part of previous patch Content-type: text/plain These four lines should be removed. It makes sense to consider the wildcard mode as less specific and give priority to a rule that is not using a wildcard, but that is not how it was done in the past and that is not (from my testing) what is being done if a regex is involved. So for both consistency and in keeping with past practice, we should not use the file kind to sort here. Proposed-by: James Carter Signed-off-by: Petr Lautrbach --- libselinux/src/label_file.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/libselinux/src/label_file.h b/libselinux/src/label_file.h index eb7239719a85..284028a054ce 100644 --- a/libselinux/src/label_file.h +++ b/libselinux/src/label_file.h @@ -368,11 +368,6 @@ static inline int compare_literal_spec(const void *p1, const void *p2) if (ret) return ret; - /* Order wildcard mode (0) last */ - ret = spaceship_cmp(l1->file_kind, l2->file_kind); - if (ret) - return -ret; - /* Order by input number (higher number means added later, means higher priority) */ ret = spaceship_cmp(l1->inputno, l2->inputno); return -ret; -- 2.49.0