add helpers for printing warning and error messages
This commit is contained in:
parent
8b9ebd3769
commit
ea3c1f508a
|
@ -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.')
|
||||
')
|
||||
')
|
||||
|
|
|
@ -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.')
|
||||
')
|
||||
')
|
||||
|
|
|
@ -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.')
|
||||
')
|
||||
')
|
||||
|
||||
|
|
|
@ -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.')
|
||||
')
|
||||
')
|
||||
|
||||
|
|
|
@ -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.')
|
||||
')
|
||||
|
||||
########################################
|
||||
|
|
|
@ -523,7 +523,6 @@ interface(`mta_sendmail_exec',`
|
|||
')
|
||||
|
||||
can_exec($1, sendmail_exec_t)
|
||||
errprint(`bah $1'__endline__)
|
||||
')
|
||||
|
||||
########################################
|
||||
|
|
|
@ -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.')
|
||||
')
|
||||
')
|
||||
|
|
|
@ -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.')
|
||||
')
|
||||
')
|
||||
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -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])
|
||||
|
|
Loading…
Reference in New Issue