Skip to contentSkip to conversation

yacc problem

DISCUSSION Russell Coker 2 participants 2 messages Oct 10, 2002 SELinux security module

lore
Share & tools
lore
#0 lore raw

yacc -d policy_parse.y
policy_parse.y:344.4: parse error, unexpected "|"
make[1]: *** [y.tab.c] Error 1

I have suddenly started getting the above error on building selinux-small after upgrading to the latest bison.

I upgraded from bison 1.35 to 1.50 ("yacc" == "bison -y" on my system).

I have attached the policy_parse.y file I am using to avoid confusion about which patches I have installed.

Signature · 4 lines
http://www.coker.com.au/selinux/   My NSA Security Enhanced Linux packages
http://www.coker.com.au/bonnie++/  Bonnie++ hard drive benchmark
http://www.coker.com.au/postal/    Postal SMTP/POP benchmark
http://www.coker.com.au/~russell/  My home page
#1 lore raw
Quoted 11 lines · Russell Coker

yacc -d policy_parse.y
policy_parse.y:344.4: parse error, unexpected "|"
make[1]: *** [y.tab.c] Error 1

I have suddenly started getting the above error on building selinux-small after upgrading to the latest bison.

I upgraded from bison 1.35 to 1.50 ("yacc" == "bison -y" on my system).

I have attached the policy_parse.y file I am using to avoid confusion about which patches I have installed.

Yes, there is a spurious semicolon in the yacc file. The attached patch (also committed to sf CVS) removes it. Thanks.

--
Stephen D. Smalley, NAI Labs
[email protected]

Index: selinux/module/checkpolicy/policy_parse.y
===================================================================
RCS file: /cvsroot/selinux/nsa/selinux/module/checkpolicy/policy_parse.y,v retrieving revision 1.5

module/checkpolicy/policy_parse.y +0 -1
diff -u -r1.5 policy_parse.y
@@ -341,7 +341,6 @@
 			| T2 op { if (insert_separator(1)) return -1; } names_push
 			{ $$ = (int) define_cexpr(CEXPR_NAMES, CEXPR_TYPE | CEXPR_TARGET, $2);
 			  if ($$ == 0) return -1; }
-			;
 			| SAMEUSER
 			{ $$ = (int) define_cexpr(CEXPR_ATTR, CEXPR_USER, CEXPR_EQ);
 			  if ($$ == 0) return -1; }