Skip to contentSkip to conversation

Policy Language

DISCUSSION Stephen D. Smalley 1 participant 1 message Jan 6, 2003 SELinux security module

lore
Share & tools
lore
#0 lore raw
Quoted 3 lines

In working toward a policy management system I have run across a few ambiguities in the language.

The grammar in policy_parse.y is unambiguous. For that matter, the attached grammar for the constructs that you mentioned is unambiguous, even with a completely free form statement list. There are no conflicts. What precisely is the problem?

--
Stephen Smalley, NSA
[email protected]

%token CLASS
%token INHERITS
%token IDENTIFIER
%token SID
%token ALLOW

%%
statement_list : statement | statement_list statement

                        ;
statement               : av_perms_def |
                          class_def |
                          initial_sid_def |
                          initial_sid_context_def |
                          allow_def |
                          role_allow_def
                        ;

av_perms_def : CLASS identifier '{' identifier_list '}'
| CLASS identifier INHERITS identifier
| CLASS identifier INHERITS identifier '{' identifier_list '}' ;
identifier_list : identifier

			| identifier_list identifier
			;
identifier		: IDENTIFIER
			;
class_def		: CLASS identifier
			;
initial_sid_def         : SID identifier
                        ;
initial_sid_context_def : SID identifier security_context_def
                        ;
security_context_def	: identifier ':' identifier ':' identifier 
	                ;
allow_def               : ALLOW names names ':' names names ';'
                        ;
role_allow_def          : ALLOW names names ';'
                        ;
names           	: identifier
			| nested_id_set
			;
nested_id_set           : '{' nested_id_list '}'
                        ;
nested_id_list          : nested_id_element | nested_id_list nested_id_element
                        ;
nested_id_element       : identifier | nested_id_set
                        ;

%%