From d4c9f0ad0cd626682eaef80e188045eac07fd1a3 Mon Sep 17 00:00:00 2001 From: John Johansen Date: Sun, 6 Apr 2008 18:53:59 +0000 Subject: [PATCH] recommit namespace update to use :namespace: --- parser/parser_yacc.y | 23 ++++++++----------- parser/tst/simple_tests/profile_ns_bad1.sd | 4 ++-- parser/tst/simple_tests/profile_ns_ok1.sd | 2 +- parser/tst/simple_tests/profile_ns_ok2.sd | 4 ++-- .../simple_ok_change_profile_3.sd | 2 +- 5 files changed, 16 insertions(+), 19 deletions(-) diff --git a/parser/parser_yacc.y b/parser/parser_yacc.y index 23c706796..db906a94b 100644 --- a/parser/parser_yacc.y +++ b/parser/parser_yacc.y @@ -194,25 +194,22 @@ profile: TOK_ID flags TOK_OPEN rules TOK_CLOSE $$ = cod; }; -profile: TOK_ID TOK_COLON TOK_ID flags TOK_OPEN rules TOK_CLOSE +profile: TOK_COLON TOK_ID TOK_COLON TOK_ID flags TOK_OPEN rules TOK_CLOSE { - struct codomain *cod = $6; - PDEBUG("Matched: id (%s:%s) open rules close\n", $1, $3); + struct codomain *cod = $7; + PDEBUG("Matched: id (%s:%s) open rules close\n", $2, $4); if (!cod) { yyerror(_("Memory allocation error.")); } - if ($3[0] != '/') - yyerror(_("Profile names must begin with a '/'.")); - - cod->namespace = $1; - cod->name = $3; - cod->flags = $4; + cod->namespace = $2; + cod->name = $4; + cod->flags = $5; if (force_complain) cod->flags = force_complain_flags; PDEBUG("%s: flags='%s%s'\n", - $1, + $2, cod->flags.complain ? "complain, " : "", cod->flags.audit ? "audit" : ""); @@ -814,11 +811,11 @@ change_profile: TOK_CHANGE_PROFILE TOK_ID TOK_END_OF_RULE $$ = entry; }; -change_profile: TOK_CHANGE_PROFILE TOK_ID TOK_COLON TOK_ID TOK_END_OF_RULE +change_profile: TOK_CHANGE_PROFILE TOK_COLON TOK_ID TOK_COLON TOK_ID TOK_END_OF_RULE { struct cod_entry *entry; - PDEBUG("Matched change_profile: tok_id (%s:%s)\n", $2, $4); - entry = new_entry($2, $4, AA_CHANGE_PROFILE, NULL); + PDEBUG("Matched change_profile: tok_id (%s:%s)\n", $3, $5); + entry = new_entry($3, $5, AA_CHANGE_PROFILE, NULL); if (!entry) yyerror(_("Memory allocation error.")); PDEBUG("change_profile.entry: (%s)\n", entry->name); diff --git a/parser/tst/simple_tests/profile_ns_bad1.sd b/parser/tst/simple_tests/profile_ns_bad1.sd index 6fa1d5516..aa01b5eed 100644 --- a/parser/tst/simple_tests/profile_ns_bad1.sd +++ b/parser/tst/simple_tests/profile_ns_bad1.sd @@ -5,7 +5,7 @@ # vim:syntax=subdomain # Last Modified: Sun Apr 17 19:44:44 2005 # -foo:/does/not/exist { +:foo:/exists { #include /usr/X11R6/lib/lib*so* rrr, @@ -17,7 +17,7 @@ foo:/does/not/exist { /bin/echo uxuxuxuxux, } -foo:/does/not/exist { +:foo:/exists { #include /usr/X11R6/lib/lib*so* rrr, diff --git a/parser/tst/simple_tests/profile_ns_ok1.sd b/parser/tst/simple_tests/profile_ns_ok1.sd index 22aa9531f..db7d74a2f 100644 --- a/parser/tst/simple_tests/profile_ns_ok1.sd +++ b/parser/tst/simple_tests/profile_ns_ok1.sd @@ -5,7 +5,7 @@ # vim:syntax=subdomain # Last Modified: Sun Apr 17 19:44:44 2005 # -foo:/does/not/exist { +:foo:/does/not/exist { #include /usr/X11R6/lib/lib*so* rrr, diff --git a/parser/tst/simple_tests/profile_ns_ok2.sd b/parser/tst/simple_tests/profile_ns_ok2.sd index af9140243..ffe4882fb 100644 --- a/parser/tst/simple_tests/profile_ns_ok2.sd +++ b/parser/tst/simple_tests/profile_ns_ok2.sd @@ -14,7 +14,7 @@ /bin/ls ixixixix, } -foo:/does/not/exist { +:foo:/does/not/exist { /usr/X11R6/lib/lib*so* rrr, /does/not/exist r, /var/log/messages www, @@ -23,7 +23,7 @@ foo:/does/not/exist { /bin/ls ixixixix, } -bar:/does/not/exist { +:bar:/does/not/exist { /usr/X11R6/lib/lib*so* rrr, /does/not/exist r, /var/log/messages www, diff --git a/parser/tst/simple_tests/simple_ok_change_profile_3.sd b/parser/tst/simple_tests/simple_ok_change_profile_3.sd index 90c9272d3..4dd42a404 100644 --- a/parser/tst/simple_tests/simple_ok_change_profile_3.sd +++ b/parser/tst/simple_tests/simple_ok_change_profile_3.sd @@ -3,5 +3,5 @@ #=EXRESULT PASS # /usr/bin/foo { - change_profile foo:/bin/foo, + change_profile :foo:/bin/foo, }