From f6ddd6b9b7a7357b1cf64eb2ef53c4fe44ba10a4 Mon Sep 17 00:00:00 2001 From: Chris PeBenito Date: Fri, 30 Mar 2007 12:43:15 +0000 Subject: [PATCH] bools in modules fix to require the boolean in optionals that are part of the base module, and move bool declarations in the base module/monolithic --- policy/support/loadable_module.spt | 41 ++++++++---------------------- support/comment_move_decl.sed | 3 ++- support/get_type_attr_decl.sed | 2 +- 3 files changed, 13 insertions(+), 33 deletions(-) diff --git a/policy/support/loadable_module.spt b/policy/support/loadable_module.spt index 171967376..2d31e6275 100644 --- a/policy/support/loadable_module.spt +++ b/policy/support/loadable_module.spt @@ -128,10 +128,10 @@ define(`dflt_or_overr',`ifdef(`$1',$1,$2)') # This needs to be reworked so expressions # with parentheses can work. -define(`delcare_required_symbols',` +define(`declare_required_symbols',` ifelse(regexp($1, `\w'), -1, `', `dnl bool regexp($1, `\(\w+\)', `\1'); -delcare_required_symbols(regexp($1, `\w+\(.*\)', `\1'))dnl +declare_required_symbols(regexp($1, `\w+\(.*\)', `\1'))dnl ') dnl ') @@ -140,16 +140,7 @@ delcare_required_symbols(regexp($1, `\w+\(.*\)', `\1'))dnl # Tunable declaration # define(`gen_tunable',` - ifdef(`self_contained_policy',` - bool $1 dflt_or_overr(`$1'_conf,$2); - ',` - # loadable module tunable - # declaration will go here - # instead of bool when - # loadable modules support - # tunables - bool $1 dflt_or_overr(`$1'_conf,$2); - ') + bool $1 dflt_or_overr(`$1'_conf,$2); ') ############################## @@ -157,24 +148,12 @@ define(`gen_tunable',` # Tunable policy handling # define(`tunable_policy',` - ifdef(`self_contained_policy',` - if (`$1') { - $2 - ifelse(`$3',`',`',`} else { - $3 - ')} - ',` - # structure for tunables - # will go here instead of a - # conditional when loadable - # modules support tunables - gen_require(` - delcare_required_symbols(`$1') - ') - if (`$1') { - $2 - ifelse(`$3',`',`',`} else { - $3 - ')} + gen_require(` + declare_required_symbols(`$1') ') + if (`$1') { + $2 + ifelse(`$3',`',`',`} else { + $3 + ')} ') diff --git a/support/comment_move_decl.sed b/support/comment_move_decl.sed index 1d098d5bc..20ffa6cf1 100644 --- a/support/comment_move_decl.sed +++ b/support/comment_move_decl.sed @@ -5,9 +5,10 @@ /require \{/,/} # end require/b nextline /optional \{/,/} # end optional/b nextline -/^[[:blank:]]*(attribute|type(alias)?) / s/^/# this line was moved by the build process: &/ +/^[[:blank:]]*(attribute|type(alias)?) /s/^/# this line was moved by the build process: &/ /^[[:blank:]]*(port|node|netif|genfs)con /s/^/# this line was moved by the build process: &/ /^[[:blank:]]*fs_use_(xattr|task|trans) /s/^/# this line was moved by the build process: &/ /^[[:blank:]]*sid /s/^/# this line was moved by the build process: &/ +/^[[:blank:]]*bool /s/^/# this line was moved by the build process: &/ :nextline diff --git a/support/get_type_attr_decl.sed b/support/get_type_attr_decl.sed index 52a11abe4..a113f217c 100644 --- a/support/get_type_attr_decl.sed +++ b/support/get_type_attr_decl.sed @@ -5,7 +5,7 @@ /require \{/,/} # end require/b nextline /optional \{/,/} # end optional/b nextline -/^[[:blank:]]*(attribute|type(alias)?) /{ +/^[[:blank:]]*(attribute|type(alias)?|bool) /{ s/^[[:blank:]]+// p }