mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-28 12:58:07 +00:00
Merge Unify get_directory_contents(), and delete unused copy
Copy the optimized version from common.py to easyprof.py (shouldn't change the behaviour). Since get_directory_contents() is only used in easyprof.py, delete the unused copy from common.py. MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1720 Approved-by: Ryan Lee <rlee287@yahoo.com> Merged-by: Christian Boltz <apparmor@cboltz.de>
This commit is contained in:
commit
1c2f3582fe
@ -10,7 +10,6 @@
|
|||||||
# ------------------------------------------------------------------
|
# ------------------------------------------------------------------
|
||||||
|
|
||||||
import collections
|
import collections
|
||||||
import glob
|
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
@ -169,14 +168,6 @@ def valid_path(path):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
def get_directory_contents(path):
|
|
||||||
"""Find contents of the given directory"""
|
|
||||||
if not valid_path(path):
|
|
||||||
return None
|
|
||||||
|
|
||||||
return sorted(glob.glob(path + "/*"))
|
|
||||||
|
|
||||||
|
|
||||||
def is_skippable_file(path):
|
def is_skippable_file(path):
|
||||||
"""Returns True if filename matches something to be skipped (rpm or dpkg backup files, hidden files etc.)
|
"""Returns True if filename matches something to be skipped (rpm or dpkg backup files, hidden files etc.)
|
||||||
The list of skippable files needs to be synced with apparmor initscript and libapparmor _aa_is_blacklisted()
|
The list of skippable files needs to be synced with apparmor initscript and libapparmor _aa_is_blacklisted()
|
||||||
|
@ -200,12 +200,7 @@ def get_directory_contents(path):
|
|||||||
if not valid_path(path):
|
if not valid_path(path):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
files = []
|
return sorted(glob.glob(path + "/*"))
|
||||||
for f in glob.glob(path + "/*"):
|
|
||||||
files.append(f)
|
|
||||||
|
|
||||||
files.sort()
|
|
||||||
return files
|
|
||||||
|
|
||||||
|
|
||||||
def verify_policy(policy, exe, base=None, include=None):
|
def verify_policy(policy, exe, base=None, include=None):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user