Conditional blocks

if, else, defined for application developers

An if block holds rules that are compiled only when its expression is true. The expression is worked out when the profile is compiled from boolean variables and comparisons and the defined test combined with not and and or. Blocks may have else if and else branches. A block that is not taken must still be valid text and its includes are still read.

On the map: preamble and reuse

▶ Watch this deck — 8 scenes, ~6 min

Worth seeing first

01 One profile text, two compiled profiles

CONDITIONAL BLOCKS ${DEMO_DEBUG} = ... profile demo /usr/bin/demo { /etc/demo/** r, } if ${DEMO_DEBUG} { /tmp/demo-debug.log w, } false demo /etc/demo/** r ... 106 compiled lines true demo /etc/demo/** r /tmp/demo-debug.log w 107 compiled lines the kernel is given one of the two; it never sees the if decided when the profile is compiled
A profile text with the block if ${DEMO_DEBUG} { /tmp/demo-debug.log w, }. With the variable false it compiles to a profile demo of 106 compiled lines without the log file; with true to a profile of 107 compiled lines with the rule /tmp/demo-debug.log w. The kernel is given one of the two and never sees the if.

if EXPR { rules } compiles the rules in only when the expression is true at compile time.

Sometimes one program needs slightly different rules in different places: a debug log on test machines, an extra directory at one site. You could keep two profiles and watch them drift apart. Or you write one, and put the part that differs inside an if block. When the profile is compiled, the parser works out the condition from values in the preamble, and either leaves the block's rules out or compiles them in. The kernel gets an ordinary profile either way. It's a decision made once, at compile time, not a check while demo runs.

Details and sources

Details

  • The block is line 13 of this district's example file: if ${DEMO_DEBUG} { /tmp/demo-debug.log w, }. The panel shows a shortened profile; the counts are those of the whole example file.
  • The counts on this slide are the lines of -D rule-exprs that begin aare:: 106 with ${DEMO_DEBUG} = false, 107 with true. They are compiled lines, not rules of the file: two are the attachment and its alias twin, three are peer labels (aare: demo) from abstractions/base, 17 are alias twins, and the rest are the rules of the file and of the included abstraction. The extra line is aare: /tmp/demo-debug.log. Both were run with the tree's parser for this deck.
  • No shipped profile uses if (grep of profiles/). The parser's tests have 67 files in parser/tst/simple_tests/conditional/.
  • Nothing of the block structure reaches the kernel: the compiled profile holds the rules of the taken blocks as ordinary rules.
  • The program demo and its profile are invented for the map. Nothing on this slide was observed on a running kernel.

02 if, an expression, a block, and optional else branches

GRAMMAR if EXPR { rules } else if EXPR { rules } else { rules } no comma after the closing brace any number of times at most once if ${DEMO_DEBUG} { /tmp/demo-debug.log w, } line 13: the simplest case ${DEBUG} = false @{VER} = 10 if ${DEBUG} { /debug r, } else if @{VER} >= 9 { /ver9 r, } else { /else r, } a different profile, to show a chain false: left out true: compiled /ver9 r, not reached an if block may stand wherever a rule may: in a profile, a child profile, a hat, another block
Syntax diagram: if, EXPR, a block of rules in braces; then any number of else if EXPR blocks; then at most one else block; no comma after the closing brace. Demo's line 13 is the simplest case. A second profile shows a chain: if ${DEBUG} is false and left out, else if @{VER} >= 9 is true and its rule /ver9 r is compiled, and the else branch is not reached.

if EXPR { } else if EXPR { } else { }. The first true branch is compiled; the others are left out.

The shape is familiar from other languages: the word if, an expression, and a block of rules in curly braces. After the closing brace you may continue with else if and another expression, as often as you like, and finish with a plain else. There's no comma after the brace. Of the whole chain, the first branch whose expression is true is compiled, and the rest are left out. In this example the debug switch is false, the version test is true, so the middle rule is the one that ends up in the profile. The else branch isn't reached. An if block can stand anywhere a rule can.

Details and sources

Details

  • apparmor.d(5): IF_BLOCK = 'if' EXPR BLOCK [ ( 'else' 'if' EXPR BLOCK )* ] [ 'else' BLOCK ] (apparmor.d.pod:188).
  • The chain on the slide is from a profile recorded in the research notes; it stands inside profile demo /usr/bin/demo { }. Of the chain only /ver9 is compiled. The profile changed: this is not the district's example file.
  • Recorded in the research notes: if true { /first r, } else if true { /second r, } else { /third r, } compiles only /first.
  • Recorded placements: in a hat (^hat { if true { /inhat r, } } compiles /inhat); inside and around a qualifier block (deny { if true { /x r, } } gives a deny rule; if true { audit { /y r, } }); nested (if true { if false { /n r, } else { /z r, } } gives /z only).
  • Empty blocks and nested chains are valid (else_if_3.sd, expected to pass).
  • Not around a part of a rule (bad_2.sd, bad_3.sd, expected to fail), and not in the preamble.

for AppArmor developers for security researchers

In the code

03 What an expression is made of

EXPRESSIONS factor ${DEMO_DEBUG} true false defined @{HOME} @{VER} >= 9 ( ... ) one thing that is true or false or binds last and not binds first if true or false and false { /prec1 r, } compiled and first: true or (false and false) if not true or true { /prec2 r, } compiled not first: (not true) or true if not (true or true) { /prec3 r, } left out parentheses change it if defined @{SET} and not defined @{NOPE} { /def r, } compiled
A ladder of four rungs: or, which binds last; and; not, which binds first; and factor. Five kinds of factor: a boolean variable, true or false, defined with a set variable, a comparison, and a parenthesised expression. Four recorded examples: true or false and false is compiled; not true or true is compiled; not (true or true) is left out; defined @{SET} and not defined @{NOPE} is compiled.

Factors: ${VAR}, true, false, defined @{VAR}, a comparison, ( ). Operators: not, then and, then or.

What goes between if and the brace? Start at the bottom. A factor is one thing that's true or false: a boolean variable; the words true or false; the word defined followed by a set variable, which asks whether it exists; a comparison; or a whole expression in parentheses. Factors are combined with not, and, or. Not binds tightest, then and, then or. So true or false and false is true, because the and is worked out first. Not applies only to what follows it directly, unless parentheses say otherwise. And defined is handy for rules that should exist only when a site has set a particular variable.

Details and sources

Details

  • The four examples are from two profiles recorded in the research notes; "compiled" means the rule of the block appears in -D rule-exprs. In the fourth, @{SET} is assigned in the preamble and @{NOPE} is not.
  • defined @{HOME} and @{VER} >= 9 on the chips are forms, not runs.
  • not binds tightest, then and, then or. or and and are left associative.
  • A bare word must be true or false, in any case: if TRUE { /upper r, } is compiled (recorded in the research notes).
  • defined tests existence, not truth. A variable assigned "" is defined (defined_1.sd, expected to pass); if not not defined @FOO { } (defined_2.sd, expected to pass).
  • The parser's tests also have if $FOO and (($BAR and $THREE)) { } (ok_16.sd) and if (($FOO and $BAR) or $THREE) { } (ok_20.sd), both expected to pass.
  • The man page's sentence "Boolean operators are evaluated left to write with priority in order of the following list" lists in first and not, and, or last (apparmor.d.pod:2909-2964). The deck follows the grammar.
  • Known discrepancy: apparmor.d(5): the grammar summary and text disagree with the parser in several places.
  • Known discrepancy: Conditionals: defined ${bool} is false for a defined boolean, and and/or and nested if do not short-circuit.

for AppArmor developers for security researchers

In the code

04 Comparing sets, text and numbers

COMPARISONS @{SET} = /a /b @{ONE} = /a @{VER} = 10 the profile changed: these are the research runs sets of text order /a in @{SET} true @{SET} in @{ONE} false in: every value on the left is among those on the right @{SET} == /a false @{SET} != /a true ==: the two sets are the same 9 < 10 true 10 > 9 true two whole numbers: compared as numbers abc < abd true b10 > b9 false neither is a number: compared as text @{VER} > abc Can only compare numbers with numbers
With @{SET} = /a /b, @{ONE} = /a and @{VER} = 10. Sets of text: /a in @{SET} is true, @{SET} in @{ONE} is false, @{SET} == /a is false, @{SET} != /a is true. Order: 9 < 10 and 10 > 9 are true, compared as numbers; abc < abd is true and b10 > b9 is false, compared as text; @{VER} > abc is the error Can only compare numbers with numbers.

==, !=, in: sets of text. <, <=, >, >=: numbers if both sides are single integers, text if neither is.

Comparisons take two operands, each a word, a quoted string or a set variable, and each is treated as a set of text values. The in operator asks whether everything on the left is among the values on the right: whole values, not part of a string. == asks whether the two sets are the same, so a variable with two values isn't equal to either of them. The ordering operators look at the operands first. Two whole numbers are compared as numbers: nine is less than ten. Two non-numbers are compared as text, where b10 sorts before b9. A number against a word is an error.

Details and sources

Details

  • Every row is from the profiles recorded in the research notes, with @{SET} = /a /b, @{ONE} = /a and @{VER} = 10 in the preamble. "true" means the rule of the block appears in -D rule-exprs. The profile changed: this is not the district's example file.
  • Also recorded: @{ONE} in @{SET} true; /a in /a/b false (no substring match); "a b" == "a b" true; @{SET} == @{SET} true.
  • The error row in full: AppArmor parser error for /work/c3.sd in profile /work/c3.sd at line 3: Can only compare numbers with numbers, exit status 1.
  • A set variable with several values next to a number is the same error: @{SET} = 1 2 and if @{SET} > 0 (recorded in the research notes).
  • An undefined set variable in a comparison is Error retrieving variable @{NOPE} (recorded in the research notes).
  • From the code, not run: Value out of valid range.
  • The man page has an example with @{TEST_VERSION} >= @{BAZ} (apparmor.d.pod:2981-2998).
  • Known discrepancy: Ordering comparisons in if read numbers in base 0 while == and != compare text. Recorded in the research notes: 0x10 >= 16 and 010 <= 8 are true, 0x10 == 16 is false, and 08 < 9 is Can only compare numbers with numbers.

for AppArmor developers for security researchers

In the code

05 What a block that is not taken still does

NOT TAKEN if false { /srv/x r, capability net_admin, ^hat { /h r, } /x/@{UNDEFINED} r, } left out rules capabilities and rlimits hats and child profiles demo /etc/demo/** r, variables are not expanded: @{UNDEFINED} no error, exit status 0 still happens the syntax check bogus_keyword foo, syntax error, unexpected TOK_ID, expecting TOK_MODE includes include <does/not/exist> Could not open 'does/not/exist' an if block hides rules from the compiled profile, not text from the parser
A block if false { } holding a file rule, a capability, a hat and a rule with an undefined variable. Left out: the rules, capabilities and rlimits, hats and child profiles; the compiled profile demo has only its rule /etc/demo/** r, and the undefined variable is no error. Still happening: the syntax check, where bogus_keyword foo is a syntax error, and includes, where include <does/not/exist> is Could not open.

A branch that is not taken is parsed and its includes are followed. Its rules, hats, child profiles and variables are not used.

What happens to a block whose condition is false? Less than you might hope, and more. Its rules are left out of the profile, and so are capabilities, hats and child profiles declared inside it. Variables in it aren't even expanded, so a name that doesn't exist there is no error. But the text itself is still parsed: a typo inside a block that's switched off stops the compile. And include lines in it are still followed, because includes are resolved before any block is evaluated. So a file included only inside a false block must still exist. The block hides rules, not text.

Details and sources

Details

  • The panel was run with the tree's parser for this deck, inside profile demo /usr/bin/demo next to the rule /etc/demo/** r,: -D rule-exprs prints the attachment and /etc/demo/** only, -N prints only demo, exit status 0, no message. /srv/x is an invented path.
  • Recorded in the research notes, with more inside the block (an exec rule with a target, a capability, an rlimit, a network rule, a hat, a child profile and a change_profile rule): -N prints only demo, the compiled profile contains none of the names, and the only file rule is the one outside the block.
  • Recorded in the research notes: if false { /x/@{UNDEFINED} r, } compiles, exit status 0.
  • Recorded in the research notes: the same kind of block with bogus_keyword foo, in it prints syntax error, unexpected TOK_ID, expecting TOK_MODE, exit status 1; if false { include <does/not/exist> } prints Could not open 'does/not/exist', exit status 1.
  • A hat in a taken block that repeats a hat outside it is Multiple definitions for profile dupehat exist,bailing out. (recorded in the research notes; bad_dup_hats_1.sd, expected to fail).
  • if defined @{VAR} { include <x> } does not make the include optional. include if exists does: see include if exists.
  • Alias rules are applied to the rules of every branch, taken or not. That has no effect on the result.
  • Known discrepancy: An include inside an if or qualifier block makes the same include in the rest of the profile a no-op.

for security researchers

Attack surface

  • The set of rules a profile has depends on preamble state: a boolean, a set variable, whether a variable is defined. That state can come from included files and .d directories.
  • Reading the profile text does not tell which branch is compiled. -D rule-exprs does.
  • Includes in a branch are followed whatever the condition is, so a condition does not gate which files are opened.

for AppArmor developers for security researchers

In the code

06 Evaluated while parsing, chosen once, skipped later for AppArmor developers for security researchers

IN THE PARSER scanner if -> EXPR_MODE { -> back grammar factor: TOK_BOOL_VAR -> get_boolean_var() the value is fetched now cond_rule: TOK_IF expr block TOK_ELSE cond_rule else: the negated result cond_expr_set cond_expr{false, block} cond_expr{true, block} cond_expr{..., block} set_block: the first true one expand variables post-process implied rules generate only set_block push qualifiers down apply aliases merge duplicates every block
Three boxes. The scanner switches to EXPR_MODE at if and back at the opening brace. The grammar evaluates a factor at once, for example a boolean variable through get_boolean_var(), and builds cond_rule chains; an else is a condition with the negated result. A cond_expr_set holds the conditions of a chain and set_block points to the first true one. The passes expand variables, post-process, implied rules and generate walk only set_block; push qualifiers down, apply aliases and merge duplicates walk every block.

parser_yacc.y:862-1038 builds the chain; cond_expr.h:63-95 keeps the taken block; block.cc walks only it.

The word if puts the scanner into an expression mode that lasts until the opening brace. Inside it, each factor is evaluated as soon as the grammar reduces it: a boolean variable is looked up right then, a comparison is computed right then. The result is kept together with the block that follows, and an else is just a condition with the negated result. A whole chain becomes a set that remembers the block of the first true condition. From there on, variable expansion, post-processing and code generation walk only that one block, while a few structural passes, like applying aliases, still visit them all.

Details and sources

for AppArmor developers for security researchers

Details

07 Mistakes and their messages

MISTAKES if ${DEMO_DEBUG} { ... } above the profile syntax error, unexpected TOK_IF, expecting end of file if ${NOPE} { ... } Unset boolean variable ${NOPE} used in if-expression if @{V} { ... } Invalid boolean : '@{V}' is not true or false a set variable is not a condition: compare it or use defined if @{NOPE} == 1 { ... } Error retrieving variable @{NOPE} if true /a r, syntax error, unexpected TOK_ID, expecting TOK_OPEN or TOK_OR the braces are required else { ... } no if before it syntax error, unexpected TOK_ELSE, expecting TOK_ID or TOK_MODE or TOK_SET_VAR
Six wrong lines and the parser's messages. An if above the profile: syntax error, unexpected TOK_IF, expecting end of file. An unset boolean: Unset boolean variable ${NOPE} used in if-expression. A set variable as a condition: Invalid boolean. An undefined set variable in a comparison: Error retrieving variable @{NOPE}. No braces: syntax error, expecting TOK_OPEN or TOK_OR. An else without an if: syntax error, unexpected TOK_ELSE.

if only inside a profile, always with braces. A condition is a boolean, a comparison or defined.

The mistakes. An if block above the profile: conditions select rules, and the preamble has none, so if only works inside a profile. A boolean that was never set, usually a typo: the message names it. A set variable used as if it were a truth value: compare it with something, or ask whether it's defined. A comparison with a set variable that doesn't exist. Forgetting the braces around a single rule: unlike some languages, they're always required. And an else that has lost its if.

Details and sources

Details

  • Exit status 1 for each.
  • Row 1 was run with the tree's parser for this deck: ${DEMO_DEBUG} = false on line 1 and if ${DEMO_DEBUG} { /tmp/demo-debug.log w, } on line 2, above the profile, print ... at line 2: syntax error, unexpected TOK_IF, expecting end of file.
  • Rows 2 to 6 are recorded in the research notes. Row 2 in full: AppArmor parser error for /work/c6.sd in profile /work/c6.sd at line 2: Unset boolean variable ${NOPE} used in if-expression. Row 3 has @{V} = 9 in the preamble.
  • Also recorded: else followed by } is syntax error, unexpected TOK_CLOSE, expecting TOK_OPEN or TOK_IF.
  • The parser's own tests: a boolean assigned in the profile before the if (bad_1.sd), if truish { } (bad_id.sd), else ^FOO { } (else_if_8.sd), all expected to fail.
  • Guarding a comparison with defined ... and does not avoid the "Error retrieving variable" error: both sides of and are evaluated. See the entry named in the scene "Evaluated while parsing, chosen once, skipped later".

08 The other block, and the other conditionals

ROADS if EXPR { } decided once, when the profile is compiled syn-boolean-variables the switches syn-variables what comparisons look at syn-qualifier-blocks deny { }: a block with no condition syn-rule-conditionals peer=...: checked by the kernel syn-preamble where the values come from syn-include-if-exists the optional include fe-grammar how blocks are parsed also: syn-hats · syn-child-profiles · syntax-map
The form if EXPR { } in the middle, with roads to the decks syn-boolean-variables, syn-variables, syn-qualifier-blocks (a block without a condition), syn-rule-conditionals (checked by the kernel), syn-preamble, syn-include-if-exists and fe-grammar, and a line naming syn-hats, syn-child-profiles and syntax-map.

if blocks are decided at compile time. Rule conditionals such as peer= are checked by the kernel.

That's the conditional block: a compile-time choice between sets of rules. The switches that drive an if are in the boolean variables deck. Two neighbours are easy to mix up with it. Qualifier blocks use the same braces, with a qualifier like deny in front and no condition. And rule conditionals, like peer=, are part of a single rule and are checked by the kernel on every access, which is the opposite of compile time. The preamble deck says where the values come from.

Details and sources

Details

  • if EXPR { rules }, with any number of else if EXPR { } branches and at most one else { }. The first true branch is compiled.
  • Expressions: boolean variables, true, false, defined, comparisons and parentheses, combined with not, and, or.
  • A branch that is not taken is still parsed, and its includes are still followed.
  • Qualifier blocks (deny { }) have no condition. Rule conditionals (peer=, fstype=) are part of one rule and belong to the compiled profile; conditional blocks do not.
  • Commit read for this deck: AppArmor 836052d21 (6.0.0~alpha2). Conditional blocks have no kernel side.

Read more

Basis of the statements on this page: "tree" means the parser built from the AppArmor commit 836052d21 (6.0.0~alpha2) was run on the fragment (-Q -K --skip-kernel-load -D rule-exprs unless another option is named, with the tree's abi/5.0 as kernel feature set), with nothing loaded into a kernel; "code" means the parser source was read and not run; "derived" means the result was reasoned from that code. Nothing here was observed on a running kernel.

Grammar

IF_BLOCK = 'if' EXPR BLOCK [ ( 'else' 'if' EXPR BLOCK )* ] [ 'else' BLOCK ]
  • The line is apparmor.d(5)'s (apparmor.d.pod:188). BLOCK is rules in braces. There is no comma after the closing brace.
  • Of a chain, the first branch whose expression is true is compiled; the others are left out (tree).
WhereAllowedBasis
in a profile bodyyestree
in a hat: ^hat { if true { /inhat r, } }yestree
in a child profileyescode
inside a qualifier block: deny { if true { /x r, } }yes; the rule is a deny ruletree
around a qualifier block: if true { audit { /y r, } }yestree
nested: if true { if false { /n r, } else { /z r, } }yes; /z onlytree
in the preambleno: syntax error, unexpected TOK_IF, expecting end of filetree
around a part of a rulenothe parser's tests bad_2.sd, bad_3.sd

Expressions

expr:       expr or term | term
term:       term and notfactor | notfactor
notfactor:  not notfactor | factor
factor:     ${NAME} | true | false | defined VARIABLE | OPERAND OP OPERAND | ( expr )
OPERAND:    a word | "a quoted string" | @{NAME}
OP:         ==  !=  in  >  >=  <  <=
  • not binds tightest, then and, then or; and and or are left associative (code).
  • if true or false and false is true; if not true or true is true; if not (true or true) is false (tree).
  • A bare word must be true or false, in any case: if TRUE { } is taken (tree).

Comparison operators

OperatorOperandsRuleRecorded exampleBasis
==sets of textthe two sets are equal@{SET} == /a false with @{SET} = /a /b; "a b" == "a b" true; @{SET} == @{SET} truetree
!=sets of textthe two sets differ@{SET} != /a truetree
insets of textevery value on the left is among those on the right; whole values/a in @{SET} true; @{ONE} in @{SET} true; @{SET} in @{ONE} false; /a in /a/b falsetree
< <= > >=two single whole numberscompared as numbers9 < 10 true; 10 > 9 truetree
< <= > >=neither is a numbercompared as textabc < abd true; b10 > b9 falsetree
< <= > >=one number, one notCan only compare numbers with numbers@{VER} > abc with @{VER} = 10; @{SET} > 0 with @{SET} = 1 2tree
  • An undefined set variable as an operand is Error retrieving variable @{NOPE} (tree).

defined

  • defined @{NAME} is true when a set variable of that name exists (tree: if defined @{SET} and not defined @{NOPE} is taken).
  • It tests existence, not truth: a variable assigned "" is defined (the parser's test defined_1.sd).
  • In an assignment: ${D} = defined @{NOPE} gives $D = false (tree, -D variables).
  • For defined ${NAME} see the known discrepancies.

A branch that is not taken

WhatResultRun
file rules, exec rules, network rules, change_profile rulesleft outif false { } around them: the only file rule compiled is the one outside (tree)
capabilities and rlimitsleft outthe same run
hats and child profilesleft outthe same run: -N prints only demo
variablesnot expandedif false { /x/@{UNDEFINED} r, }: exit status 0 (tree)
the syntax checkstill happensbogus_keyword foo, in the block: syntax error, unexpected TOK_ID, expecting TOK_MODE, exit status 1 (tree)
includesstill followedif false { include <does/not/exist> }: Could not open 'does/not/exist', exit status 1 (tree)
alias rulesapplied to every branch, without effect on the resultcode

Errors

MessageCauseBasis
syntax error, unexpected TOK_IF, expecting end of filean if in the preambletree
Unset boolean variable ${NOPE} used in if-expressiona boolean that was never assignedtree
Invalid boolean : '@{V}' is not true or falsea set variable, or a word other than true and false, as a factortree
Error retrieving variable @{NOPE}an undefined set variable in a comparisontree
Can only compare numbers with numbersan ordering comparison of a number and something elsetree
syntax error, unexpected TOK_ID, expecting TOK_OPEN or TOK_ORno braces: if true /a r,tree
syntax error, unexpected TOK_ELSE, expecting TOK_ID or TOK_MODE or TOK_SET_VARan else without an iftree
syntax error, unexpected TOK_CLOSE, expecting TOK_OPEN or TOK_IFelse followed by }tree
Multiple definitions for profile dupehat exist,bailing out.a hat in a taken block that repeats a hat outside ittree
Value out of valid rangea number too large for the comparisoncode
  • Exit status 1 for each.

The man page

  • apparmor.d(5): "Boolean operators are evaluated left to write with priority in order of the following list", and the list puts in first and not, and, or last (apparmor.d.pod:2909-2964). In the grammar the comparisons are factors, and not binds before and before or. This page follows the grammar.

for security researchers

Attack surface

  • Which rules a profile has depends on preamble state: a boolean, a set variable, whether a variable is defined. That state can come from included files and .d directories: see include if exists.
  • The profile text does not say which branch is compiled. -D rule-exprs prints the rules that were.
  • Includes in a branch are followed whatever the condition is. A condition does not gate which files are opened.

for AppArmor developers for security researchers

In the code

for AppArmor developers for security researchers

Known discrepancies

  • An include inside an if or qualifier block makes the same include in the rest of the profile a no-op.
  • Ordering comparisons in if read numbers in base 0 while == and != compare text. Runs: if 0x10 >= 16 { /hexge r, } and if 010 <= 8 { /octle r, } are taken, if 0x10 == 16 { /hexeq r, } is not; if 08 < 9 { /x r, } is Can only compare numbers with numbers, exit status 1.
  • Conditionals: defined ${bool} is false for a defined boolean, and and/or and nested if do not short-circuit. A defined ... and guard therefore does not avoid Error retrieving variable.
  • apparmor.d(5): the grammar summary and text disagree with the parser in several places (the precedence sentence above).
  • Not determined: whether reading numbers in base 0 is intended; how the policy cache treats a changed boolean in an included file (derived from the time stamp code, not run).

Roads from here

START HERE

PREAMBLE AND REUSE

QUALIFIERS

RULE CLASSES

PROFILE STRUCTURE

INSIDE THE PARSER