1
Author: John Johansen <john.johansen@canonical.com>
2
Origin: https://lists.ubuntu.com/archives/apparmor/2014-March/005558.html
3
Subject: change syntax of ptrace target
11
Signed-off-by: John Johansen <john.johansen@canonical.com>
15
parser/parser_yacc.y | 7 +------
16
parser/ptrace.c | 13 ++++++++-----
17
parser/ptrace.h | 2 +-
18
3 files changed, 10 insertions(+), 12 deletions(-)
20
--- 2.9-test.orig/parser/parser_yacc.y
21
+++ 2.9-test/parser/parser_yacc.y
22
@@ -1349,12 +1349,7 @@
24
ptrace_rule: TOK_PTRACE opt_ptrace_perm opt_conds TOK_END_OF_RULE
26
- ptrace_rule *ent = new ptrace_rule($2, $3, NULL);
29
- | TOK_PTRACE opt_ptrace_perm opt_conds TOK_ID TOK_END_OF_RULE
31
- ptrace_rule *ent = new ptrace_rule($2, $3, $4);
32
+ ptrace_rule *ent = new ptrace_rule($2, $3);
36
--- 2.9-test.orig/parser/ptrace.c
37
+++ 2.9-test/parser/ptrace.c
40
yyerror("keyword \"in\" is not allowed in ptrace rules\n");
42
- /* no valid conditionals atm */
43
- yyerror("invalid ptrace rule conditional \"%s\"\n",
45
+ if (strcmp(cond_ent->name, "peer") == 0) {
46
+ move_conditional_value("ptrace", &peer_label, cond_ent);
48
+ yyerror("invalid ptrace rule conditional \"%s\"\n",
54
-ptrace_rule::ptrace_rule(int mode_p, struct cond_entry *conds, char *peer):
55
- peer_label(peer), audit(0), deny(0)
56
+ptrace_rule::ptrace_rule(int mode_p, struct cond_entry *conds):
57
+ peer_label(NULL), audit(0), deny(0)
60
if (mode_p & ~AA_VALID_PTRACE_PERMS)
61
--- 2.9-test.orig/parser/ptrace.h
62
+++ 2.9-test/parser/ptrace.h
67
- ptrace_rule(int mode, struct cond_entry *conds, char *peer);
68
+ ptrace_rule(int mode, struct cond_entry *conds);
69
virtual ~ptrace_rule()