[apparmor] PATCH [5/6] - add target key

John Johansen john.johansen at canonical.com
Thu Sep 9 16:39:51 BST 2010


The new apparmor module uses has added a target key that is used to report
the target of an operation instead of name2 used in previous kernels

Index: libapparmor/src/grammar.y
===================================================================
--- libapparmor.orig/src/grammar.y	2010-09-09 08:06:21.004193401 -0700
+++ libapparmor/src/grammar.y	2010-09-09 08:08:35.774193758 -0700
@@ -164,6 +164,7 @@
 %token TOK_KEY_CAPABILITY
 %token TOK_KEY_CAPNAME
 %token TOK_KEY_OFFSET
+%token TOK_KEY_TARGET
 
 %token TOK_SYSLOG_KERNEL
 
@@ -460,6 +461,10 @@
 	   * loaded policy.  We can just drop this currently
 	   */
 	}
+	| TOK_KEY_TARGET TOK_EQUALS safe_string
+	{ /* target was always name2 in the past */
+	  ret_record->name2 = $3;
+	}
 	;
 
 apparmor_event:
Index: libapparmor/src/scanner.l
===================================================================
--- libapparmor.orig/src/scanner.l	2010-09-09 08:06:16.584193401 -0700
+++ libapparmor/src/scanner.l	2010-09-09 08:09:23.624193491 -0700
@@ -162,6 +162,7 @@
 key_capability		"capability"
 key_capname		"capname"
 key_offset		"offset"
+key_target		"target"
 audit			"audit"
 
 /* syslog tokens */
@@ -350,6 +351,7 @@
 {key_capability}	{ return(TOK_KEY_CAPABILITY); }
 {key_capname}		{ return(TOK_KEY_CAPNAME); }
 {key_offset}		{ return(TOK_KEY_OFFSET); }
+{key_target}		{ return(TOK_KEY_TARGET); }
 
 {syslog_kernel}		{ BEGIN(dmesg_timestamp); return(TOK_SYSLOG_KERNEL); }
 {syslog_month}		{ yylval->t_str = strdup(yytext); return(TOK_DATE_MONTH); }



More information about the AppArmor mailing list