Skip to contentSkip to conversation

checkpolicy/policy_parse.y:define_class: allow class identifiers to contain dots

PATCH Caleb Case 3 participants 3 messages Feb 6, 2007 – Feb 20, 2007 SELinux security module

lore
Share & tools
lore

Caleb Case

author
#0 lore raw

Class identifiers are now allowed to contain dots. This facilitates the new dot notation for class names used in metapolicy.

---
 checkpolicy/policy_parse.y |    5 -----
 1 file changed, 5 deletions(-)
checkpolicy/policy_parse.y +0 -5
Index: selinux-pms-support/checkpolicy/policy_parse.y
===================================================================
@@ -929,11 +929,6 @@ static int define_class(void)
 		yyerror("no class name for class definition?");
 		return -1;
 	}
-	if (id_has_dot(id)) {
-		free(id);
-		yyerror("class identifiers may not contain periods");
-		return -1;
-	}
 	datum = (class_datum_t *) malloc(sizeof(class_datum_t));
 	if (!datum) {
 		yyerror("out of memory");
Signature · 9 lines
Caleb Case
Tresys Technology
410.290.1411 x144


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#1 lore raw
Quoted 11 lines · Caleb Case

Class identifiers are now allowed to contain dots. This facilitates the new dot notation for class names used in metapolicy.

---
 checkpolicy/policy_parse.y |    5 -----
 1 file changed, 5 deletions(-)

Index: selinux-pms-support/checkpolicy/policy_parse.y
===================================================================

checkpolicy/policy_parse.y +0 -0
@@ -929,11 +929,6 @@ static int define_class(void)
 		yyerror("no class name for class definition?");

checkpolicy/policy_parse.y static int define_class(void) · line 934

Quoted 10 lines
checkpolicy/policy_parse.y +0 -5
 		return -1;
 	}
-	if (id_has_dot(id)) {
-		free(id);
-		yyerror("class identifiers may not contain periods");
-		return -1;
-	}
 	datum = (class_datum_t *) malloc(sizeof(class_datum_t));
 	if (!datum) {
 		yyerror("out of memory");

I merged this patch to -stable and -trunk, but am now having second thoughts. Class identifiers with dots in them would pose a problem for symbol definition generation, no?

Signature · 8 lines
Stephen Smalley
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#2 lore raw

RE: checkpolicy/policy_parse.y:define_class: allow classidentifiers to contain dots

Quoted 21 lines

From: Stephen Smalley [mailto:[email protected]]

Quoted 1 line · Caleb Case

Class identifiers are now allowed to contain dots. This

facilitates the new dot notation for class names used in metapolicy.

Quoted 16 lines
---
 checkpolicy/policy_parse.y |    5 -----
 1 file changed, 5 deletions(-)

Index: selinux-pms-support/checkpolicy/policy_parse.y
===================================================================

checkpolicy/policy_parse.y +0 -4
@@ -929,11 +929,6 @@ static int define_class(void)
 		yyerror("no class name for class definition?");
 		return -1;
 	}
-	if (id_has_dot(id)) {
-		free(id);
-		yyerror("class identifiers may not contain periods");
-		return -1;
Quoted 9 lines

checkpolicy/policy_parse.y static int define_class(void) · line 934

Quoted 4 lines
checkpolicy/policy_parse.y +0 -1
-	}
 	datum = (class_datum_t *) malloc(sizeof(class_datum_t));
 	if (!datum) {
 		yyerror("out of memory");

I merged this patch to -stable and -trunk, but am now having second thoughts. Class identifiers with dots in them would pose a problem for symbol definition generation, no?

Yes, we have patches to refpolicy that replace dots with something else for symbol definitions. Hopefully this is just a workaround until class discovery is done and integrated with upstream and the existing object managers.

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.