diff --git a/policy/modules/apps/ada.if b/policy/modules/apps/ada.if index 6d8950f..c2ba698 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 c35bff5..53d83fa 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 58d5983..5aa646e 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 4ee35d7..a61282d 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 6fea2a1..1c08a77 100644 --- a/policy/modules/kernel/filesystem.if +++ b/policy/modules/kernel/filesystem.if @@ -1037,7 +1037,7 @@ interface(`fs_relabelfrom_dos_fs',` ## # 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 0aeaf6e..bb83707 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 2bfa5f2..d9c0af3 100644 --- a/policy/modules/system/mount.if +++ b/policy/modules/system/mount.if @@ -117,7 +117,7 @@ interface(`mount_use_fds',` ## # 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 e2f4bc5..ea38ab7 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 b30be16..9970be4 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 3471b66..3482d33 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])