apparmor/utils/apparmor
Christian Boltz b8171d547e [08/38] Drop dead code in aa.py handle_children()
The 'exec' handling in handle_children starts with

     if do_execute:
         if profile_known_exec(...)
            continue

which means if profile_known_exec() returns True, the rest of the loop
will be skipped. profile_known_exec() will return True if it finds an
exec rule in the profile or an include (independent of the exec type,
and (thanks to rematchfrag()) even if the path is globbed.

Later in the loop, there are checks for various exec modes - but those
checks can only be reached without an existing x rule, so they'll never
be hit.

This patch removes the dead code in the handle_children() / 'exec' / 'no
existing x rule found' section.

I confirmed that this code is really dead by
a) reading the code and, after being confused
b) two manual aa-logprof runs with coverage enabled - in one of them, I
   added some ix, Px and Cx rules, and in the second one, no more exec
   rules were needed/asked.

After dropping the dead code, combinedmode and combinedaudit are no
longer used, so we can also drop the code that sets those variables.


Sidenote: this patch drops 2% of the lines in aa.py ;-)



Acked-by: Seth Arnold <seth.arnold@canonical.com>
2016-10-01 19:49:50 +02:00
..
rule [06/38] Add FileRule and FileRuleset 2016-10-01 19:47:52 +02:00
__init__.py Due to wanting to support additional external apparmor python modules, 2014-09-15 12:18:16 -07:00
aa.py [08/38] Drop dead code in aa.py handle_children() 2016-10-01 19:49:50 +02:00
aamode.py Raise an exception if sub_str_to_mode() is called with invalid mode 2015-02-03 12:47:36 +01:00
aare.py AARE: escape exclamation mark 2016-01-20 21:50:20 +01:00
cleanprofile.py Centralize the 'ruletypes' list 2015-12-04 12:01:32 +01:00
common.py type_is_str(): make pyflakes3 happy 2016-08-12 12:02:20 +02:00
config.py Let 'make check' work without logprof.conf 2015-10-20 23:21:51 +02:00
easyprof.py incorporate feedback from Seth Arnold: 2015-03-28 07:16:22 -05:00
fail.py Let the apparmor.fail error handler print to stderr 2015-12-16 11:59:10 +01:00
logparser.py logparser: store network-related params if an event looks like network 2016-07-31 17:13:57 +02:00
regex.py [04/38] Add detailed regex for file rules 2016-10-01 19:46:37 +02:00
rules.py [7/9] Remove the DBUS_Rule class 2016-05-23 23:19:59 +02:00
sandbox.py Move os.chdir(old_cwd) to before the aa-exec call it remove the side-effect of 2014-02-06 15:15:48 -05:00
severity.py severity.py: use re_match_include() 2015-06-19 21:43:19 +02:00
tools.py change aa-cleanprof to use reload_profile() 2015-06-06 14:31:03 +02:00
translations.py Merge in Kshitij Gupta <kgupta8592@gmail.com>'s rewrite of the 2014-02-12 15:54:00 -08:00
ui.py Add a test to check for hotkey conflicts 2016-05-06 22:19:34 +02:00
yasti.py utils/apparmor/yasti.py: remove XXX comments; when the time comes for 2014-02-14 22:52:31 -08:00