2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-31 14:25:52 +00:00

Handle quoted peers when parsing ptrace rules

This patch adds handling for quoted ptrace peer values and two
testcases for it.


Acked-by: Kshitij Gupta <kgupta8592@gmail.com>
This commit is contained in:
Christian Boltz
2016-02-12 21:45:38 +01:00
parent f139b522ef
commit 7cdc098c2f
2 changed files with 4 additions and 2 deletions

View File

@@ -54,9 +54,11 @@ class PtraceTestParse(PtraceTest):
('deny ptrace read, # cmt' , exp(False, False, True , ' # cmt', {'read'}, False, None, True )),
('audit allow ptrace,' , exp(True , True , False, '', None , True , None, True )),
('ptrace peer=unconfined,' , exp(False, False, False, '', None , True , 'unconfined', False )),
('ptrace peer="unconfined",' , exp(False, False, False, '', None , True , 'unconfined', False )),
('ptrace read,' , exp(False, False, False, '', {'read'}, False, None, True )),
('ptrace peer=/foo,' , exp(False, False, False, '', None , True , '/foo', False )),
('ptrace r peer=/foo,' , exp(False, False, False, '', {'r'}, False, '/foo', False )),
('ptrace r peer="/foo bar",' , exp(False, False, False, '', {'r'}, False, '/foo bar', False )),
]
def _run_test(self, rawrule, expected):