diff options
author | Chris PeBenito <cpebenito@tresys.com> | 2006-07-25 17:27:00 +0000 |
---|---|---|
committer | Chris PeBenito <cpebenito@tresys.com> | 2006-07-25 17:27:00 +0000 |
commit | ea3c1f508a39834c07f594f00afabe28b884ebd9 (patch) | |
tree | 10c4841a2916cef275763f837a981cfdbaa6ab31 /policy | |
parent | 8b9ebd37693b8abb422f748b4b71e4c8bf5613fe (diff) |
add helpers for printing warning and error messages
Diffstat (limited to 'policy')
-rw-r--r-- | policy/modules/apps/ada.if | 2 | ||||
-rw-r--r-- | policy/modules/apps/java.if | 2 | ||||
-rw-r--r-- | policy/modules/kernel/corecommands.if | 2 | ||||
-rw-r--r-- | policy/modules/kernel/files.if | 2 | ||||
-rw-r--r-- | policy/modules/kernel/filesystem.if | 2 | ||||
-rw-r--r-- | policy/modules/services/mta.if | 1 | ||||
-rw-r--r-- | policy/modules/system/mount.if | 4 | ||||
-rw-r--r-- | policy/modules/system/unconfined.if | 2 | ||||
-rw-r--r-- | policy/support/loadable_module.spt | 6 | ||||
-rw-r--r-- | policy/support/misc_macros.spt | 15 |
10 files changed, 26 insertions, 12 deletions
diff --git a/policy/modules/apps/ada.if b/policy/modules/apps/ada.if index 6d8950f4..c2ba6983 100644 --- a/policy/modules/apps/ada.if +++ b/policy/modules/apps/ada.if @@ -24,6 +24,6 @@ interface(`ada_domtrans',` allow ada_t $1:fifo_file rw_file_perms; allow ada_t $1:process sigchld; ',` - errprint(`Warning: $0($1) has no effect in strict policy.'__endline__) + refpolicywarn(`$0($1) has no effect in strict policy.') ') ') diff --git a/policy/modules/apps/java.if b/policy/modules/apps/java.if index c35bff53..53d83fa4 100644 --- a/policy/modules/apps/java.if +++ b/policy/modules/apps/java.if @@ -196,6 +196,6 @@ interface(`java_domtrans',` allow java_t $1:fifo_file rw_file_perms; allow java_t $1:process sigchld; ',` - errprint(`Warning: $0($1) has no effect in strict policy.'__endline__) + refpolicywarn(`$0($1) has no effect in strict policy.') ') ') diff --git a/policy/modules/kernel/corecommands.if b/policy/modules/kernel/corecommands.if index 58d59833..5aa646e5 100644 --- a/policy/modules/kernel/corecommands.if +++ b/policy/modules/kernel/corecommands.if @@ -58,7 +58,7 @@ interface(`corecmd_bin_alias',` typealias bin_t alias $1; ',` - errprint(__file__:__line__:` $0($*) has no effect in strict policy.'__endline__) + refpolicywarn(`$0($*) has no effect in strict policy.') ') ') diff --git a/policy/modules/kernel/files.if b/policy/modules/kernel/files.if index 4ee35d78..a61282da 100644 --- a/policy/modules/kernel/files.if +++ b/policy/modules/kernel/files.if @@ -497,7 +497,7 @@ interface(`files_execmod_all_files',` allow $1 file_type:file execmod; ',` - errprint(__file__:__line__:` $0($1) has no effect in strict policy.'__endline__) + refpolicywarn(`$0($1) has no effect in strict policy.') ') ') diff --git a/policy/modules/kernel/filesystem.if b/policy/modules/kernel/filesystem.if index 6fea2a12..1c08a771 100644 --- a/policy/modules/kernel/filesystem.if +++ b/policy/modules/kernel/filesystem.if @@ -1037,7 +1037,7 @@ interface(`fs_relabelfrom_dos_fs',` ## </param> # interface(`fs_read_eventpollfs',` - errprint(__file__:__line__:` $0($*) has been deprecated.'__endline__) + refpolicywarn(`$0($*) has been deprecated.') ') ######################################## diff --git a/policy/modules/services/mta.if b/policy/modules/services/mta.if index 0aeaf6ed..bb837078 100644 --- a/policy/modules/services/mta.if +++ b/policy/modules/services/mta.if @@ -523,7 +523,6 @@ interface(`mta_sendmail_exec',` ') can_exec($1, sendmail_exec_t) - errprint(`bah $1'__endline__) ') ######################################## diff --git a/policy/modules/system/mount.if b/policy/modules/system/mount.if index 2bfa5f26..d9c0af34 100644 --- a/policy/modules/system/mount.if +++ b/policy/modules/system/mount.if @@ -117,7 +117,7 @@ interface(`mount_use_fds',` ## </param> # interface(`mount_send_nfs_client_request',` - errprint(__file__:__line__:` $0($*) has been deprecated.'__endline__) + refpolicywarn(`$0($*) has been deprecated.') ') ######################################## @@ -143,6 +143,6 @@ interface(`mount_domtrans_unconfined',` allow unconfined_mount_t $1:fifo_file rw_file_perms; allow unconfined_mount_t $1:process sigchld; ',` - errprint(`Warning: $0($1) has no effect in strict policy.'__endline__) + refpolicywarn(`$0($1) has no effect in strict policy.') ') ') diff --git a/policy/modules/system/unconfined.if b/policy/modules/system/unconfined.if index e2f4bc5f..ea38ab70 100644 --- a/policy/modules/system/unconfined.if +++ b/policy/modules/system/unconfined.if @@ -482,7 +482,7 @@ interface(`unconfined_alias_domain',` typealias unconfined_t alias $1; ',` - errprint(`Warning: $0($1) has no effect in strict policy.'__endline__) + refpolicywarn(`$0($1) has no effect in strict policy.') ') ') diff --git a/policy/support/loadable_module.spt b/policy/support/loadable_module.spt index b30be161..9970be4d 100644 --- a/policy/support/loadable_module.spt +++ b/policy/support/loadable_module.spt @@ -50,7 +50,7 @@ define(`policy_m4_comment',` # template(name,rules) # define(`template',` dnl - ifdef(`$1',`errprint(__file__:__line__`: duplicate definition of $1(). Original definition on '$1. __endline__) define(`__if_error')',`define(`$1',__line__)') dnl + ifdef(`$1',`refpolicyerr(`duplicate definition of $1(). Original definition on '$1.) define(`__if_error')',`define(`$1',__line__)') dnl `define(`$1',` dnl define(`policy_temp',incr(policy_call_depth)) dnl pushdef(`policy_call_depth',policy_temp) dnl @@ -71,7 +71,7 @@ define(`template',` dnl # interface(name,rules) # define(`interface',` dnl - ifdef(`$1',`errprint(__file__:__line__`: duplicate definition of $1(). Original definition on '$1. __endline__) define(`__if_error')',`define(`$1',__line__)') dnl + ifdef(`$1',`refpolicyerr(`duplicate definition of $1(). Original definition on '$1.) define(`__if_error')',`define(`$1',__line__)') dnl `define(`$1',` dnl define(`policy_temp',incr(policy_call_depth)) dnl pushdef(`policy_call_depth',policy_temp) dnl @@ -93,7 +93,7 @@ define(`policy_call_depth',0) # define(`optional_policy',` ifelse(regexp(`$1',`\W'),`-1',` - errprint(__file__:__line__`: deprecated use of module name ($1) as first parameter of optional_policy() block.' __endline__) + refpolicywarn(`deprecated use of module name ($1) as first parameter of optional_policy() block.') optional_policy(shift($*)) ',` optional {`'pushdef(`__in_optional_policy') diff --git a/policy/support/misc_macros.spt b/policy/support/misc_macros.spt index 3471b668..3482d331 100644 --- a/policy/support/misc_macros.spt +++ b/policy/support/misc_macros.spt @@ -28,6 +28,21 @@ define(`ifndef',`ifdef(`$1',`$3',`$2')') define(`__endline__',` ') +# +# refpolwarn(message) +# +# print a warning message +# +define(`refpolicywarn',`errprint(__file__:__line__: Warning: `$1'__endline__)') + +# +# refpolerr(message) +# +# print an error message. does not +# make anything fail. +# +define(`refpolicyerr',`errprint(__file__:__line__: Error: `$1'__endline__)') + ######################################## # # gen_user(username, prefix, role_set, mls_defaultlevel, mls_range, [mcs_categories]) |