2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-09-04 08:15:21 +00:00

IncludeRule: sort files in included directory

... instead of relying on the filesystem(!) ordering, which will look
random to both users and unittests.

Also partially revert the test changes from
c5a7bcd50e /
https://gitlab.com/apparmor/apparmor/-/merge_requests/548 -
sorting the result only in the tests is a bad idea.
This commit is contained in:
Christian Boltz
2020-05-28 20:17:29 +02:00
parent d29bf02d7b
commit c4db85c66a
2 changed files with 3 additions and 3 deletions

View File

@@ -138,7 +138,7 @@ class IncludeRule(BaseRule):
files = []
if os.path.isdir(full_path):
for path in os.listdir(full_path):
for path in sorted(os.listdir(full_path)):
if is_skippable_file(path):
continue