@@ -37,10 +37,16 @@ static void initializeSELinuxTypeEnforcementParser (const langType language)
37
37
"\\1" , "m" , "" , NULL );
38
38
addLanguageTagMultiTableRegex (language , "main" ,
39
39
"^type[[:blank:]]+([a-zA-Z0-9_]+)[[:blank:]]*" ,
40
- "\\1" , "t" , "{tenter=typedef}" , NULL );
40
+ "\\1" , "t" , "{tenter=typedef}"
41
+ "{{\n"
42
+ " .\n"
43
+ "}}" , NULL );
41
44
addLanguageTagMultiTableRegex (language , "main" ,
42
45
"^typealias[[:blank:]]+([a-zA-Z0-9_]+)[[:blank:]]*" ,
43
- "" , "" , "{tenter=typedef}" , NULL );
46
+ "\\1" , "t" , "{_role=aliased}{tenter=typedef}"
47
+ "{{\n"
48
+ " .\n"
49
+ "}}" , NULL );
44
50
addLanguageTagMultiTableRegex (language , "main" ,
45
51
"^attribute[[:blank:]]+([a-zA-Z0-9_]+)[[:blank:]]*[^;]*;" ,
46
52
"\\1" , "T" , "" , NULL );
@@ -73,7 +79,10 @@ static void initializeSELinuxTypeEnforcementParser (const langType language)
73
79
"" , "" , "{tenter=alias}" , NULL );
74
80
addLanguageTagMultiTableRegex (language , "typedef" ,
75
81
"^;" ,
76
- "" , "" , "{tleave}" , NULL );
82
+ "" , "" , "{tleave}"
83
+ "{{\n"
84
+ " pop\n"
85
+ "}}" , NULL );
77
86
addLanguageTagMultiTableRegex (language , "typedef" ,
78
87
"^." ,
79
88
"" , "" , "" , NULL );
@@ -82,7 +91,10 @@ static void initializeSELinuxTypeEnforcementParser (const langType language)
82
91
"" , "" , "" , NULL );
83
92
addLanguageTagMultiTableRegex (language , "alias" ,
84
93
"^([a-zA-Z0-9_]+)[[:space:]]*" ,
85
- "\\1" , "a" , "{tleave}" , NULL );
94
+ "\\1" , "a" , "{tleave}"
95
+ "{{\n"
96
+ " dup :name . exch [ (type) 3 -1 roll ] typeref:\n"
97
+ "}}" , NULL );
86
98
addLanguageTagMultiTableRegex (language , "alias" ,
87
99
"^\\{[[:space:]]*" ,
88
100
"" , "" , "{tenter=compoundalias}" , NULL );
@@ -97,7 +109,10 @@ static void initializeSELinuxTypeEnforcementParser (const langType language)
97
109
"" , "" , "" , NULL );
98
110
addLanguageTagMultiTableRegex (language , "compoundalias" ,
99
111
"^([a-zA-Z0-9_]+)[[:space:]]*" ,
100
- "\\1" , "a" , "" , NULL );
112
+ "\\1" , "a" , ""
113
+ "{{\n"
114
+ " dup :name . exch [ (type) 3 -1 roll ] typeref:\n"
115
+ "}}" , NULL );
101
116
addLanguageTagMultiTableRegex (language , "compoundalias" ,
102
117
"^\\}[[:space:]]*" ,
103
118
"" , "" , "{tleave}{_advanceTo=0start}" , NULL );
@@ -133,12 +148,16 @@ extern parserDefinition* SELinuxTypeEnforcementParser (void)
133
148
NULL
134
149
};
135
150
151
+ static roleDefinition SELinuxTypeEnforcementTypeRoleTable [] = {
152
+ { true, "aliased" , "aliased" },
153
+ };
136
154
static kindDefinition SELinuxTypeEnforcementKindTable [] = {
137
155
{
138
156
true, 'm' , "module" , "policy modules" ,
139
157
},
140
158
{
141
159
true, 't' , "type" , "types" ,
160
+ ATTACH_ROLES (SELinuxTypeEnforcementTypeRoleTable ),
142
161
},
143
162
{
144
163
true, 'a' , "alias" , "type aliases" ,
@@ -169,6 +188,7 @@ extern parserDefinition* SELinuxTypeEnforcementParser (void)
169
188
def -> patterns = patterns ;
170
189
def -> aliases = aliases ;
171
190
def -> method = METHOD_NOT_CRAFTED |METHOD_REGEX ;
191
+ def -> useCork = CORK_QUEUE ;
172
192
def -> kindTable = SELinuxTypeEnforcementKindTable ;
173
193
def -> kindCount = ARRAY_SIZE (SELinuxTypeEnforcementKindTable );
174
194
def -> initialize = initializeSELinuxTypeEnforcementParser ;
0 commit comments