mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-06 17:31:01 +01:00
![]() If the program specified as get_output param isn't executable or doesn't exist at all, get_output() returns with ret = -1. Raising an exception looks like a better option, especially because other possible exec failures already raise an exception ("Unable to fork"). Note: get_output is only used by get_reqs() which also does the os.access() check for x permissions (and raises an exception), so in practise raising an exception in get_output() doesn't change anything. This change also allows to rewrite and simplify get_output() quite a bit. Another minor change (and fix) is in the removal of the last line. The old code removed the last line if output contained at least two items. This had two not-so-nice effects: - an empty output resulted in [''] instead of [] - if a command didn't add a \n on the last line, this line was deleted nevertheless The patch changes that to always remove the last line if it is empty, which fixes both issues mentioned above. Also add a test to ensure the exception is really raised, and adjust the test that expects an empty stdout. Acked-by: Kshitij Gupta <kgupta8592@gmail.com> |
||
---|---|---|
.. | ||
aa_test.py | ||
cleanprof_test.in | ||
cleanprof_test.out | ||
common_test.py | ||
config_test.py | ||
easyprof.conf | ||
fake_ldd | ||
logprof.conf | ||
Makefile | ||
minitools_test.py | ||
runtests-py2.sh | ||
runtests-py3.sh | ||
severity.db | ||
severity_broken.db | ||
test-aa-decode.py | ||
test-aa-easyprof.py | ||
test-aa.py | ||
test-aamode.py | ||
test-aare.py | ||
test-baserule.py | ||
test-capability.py | ||
test-change_profile.py | ||
test-common.py | ||
test-dbus_parse.py | ||
test-example.py | ||
test-libapparmor-test_multi.py | ||
test-logparser.py | ||
test-mount_parse.py | ||
test-network.py | ||
test-parser-simple-tests.py | ||
test-pivot_root_parse.py | ||
test-ptrace.py | ||
test-regex_matches.py | ||
test-rlimit.py | ||
test-severity.py | ||
test-signal.py | ||
test-unix_parse.py |