# Copyright (C) 2005 Tresys Technology, LLC
########################################
#
# bootloader_install_kernel(domain,[`optional'])
#
define(`bootloader_install_kernel',`
requires_block_template(bootloader_install_kernel_depend,$2)
allow $1 boot_t:dir { getattr search read write add_name };
allow $1 boot_t:file { getattr read write create };
allow $1 boot_t:lnk_file { getattr read create unlink };
')
define(`bootloader_install_kernel_depend',`
type boot_t;
class dir { getattr search read write add_name };
class file { getattr read write create };
class lnk_file { getattr read create unlink };
')
########################################
#
# bootloader_install_initrd(domain,[`optional'])
#
define(`bootloader_install_initrd',`
requires_block_template(bootloader_install_initrd_depend,$2)
allow $1 boot_t:dir { getattr search read write add_name };
allow $1 boot_t:file { getattr read write create };
allow $1 boot_t:lnk_file { getattr read create unlink };
')
define(`bootloader_install_initrd_depend',`
type boot_t;
class dir { getattr search read write add_name };
class file { getattr read write create };
class lnk_file { getattr read create unlink };
')
########################################
#
# bootloader_install_kernel_symbol_table(domain,[`optional'])
#
define(`bootloader_install_kernel_symbol_table',`
requires_block_template(bootloader_install_kernel_symbol_table_depend,$2)
allow $1 boot_t:dir { getattr search read write add_name };
allow $1 system_map_t:file { getattr read write create };
')
define(`bootloader_install_kernel_symbol_table_depend',`
type boot_t, system_map_t;
class dir { getattr search read write add_name };
class file { getattr read write create };
')
########################################
#
# bootloader_read_kernel_symbol_table(domain,[`optional'])
#
define(`bootloader_read_kernel_symbol_table',`
requires_block_template(bootloader_read_kernel_symbol_table_depend,$2)
allow $1 boot_t:dir { getattr search read };
allow $1 system_map_t:file { getattr read };
')
define(`bootloader_read_kernel_symbol_table_depend',`
type boot_t, system_map_t;
class dir { getattr search read };
class file { getattr read };
')
########################################
#
# bootloader_remove_kernel(domain,[`optional'])
#
define(`bootloader_remove_kernel',`
requires_block_template(bootloader_remove_kernel_depend,$2)
allow $1 boot_t:dir { getattr search read write remove_name };
allow $1 boot_t:file { getattr unlink };
')
define(`bootloader_remove_kernel_depend',`
type boot_t;
class dir { getattr search read write remove_name };
class file { getattr unlink };
')
########################################
#
# bootloader_remove_kernel_symbol_table(domain,[`optional'])
#
define(`bootloader_remove_kernel_symbol_table',`
requires_block_template(bootloader_remove_kernel_symbol_table_depend,$2)
allow $1 boot_t:dir { getattr search read write remove_name };
allow $1 system_map_t:file { getattr unlink };
')
define(`bootloader_remove_kernel_symbol_table_depend',`
type boot_t, system_map_t;
class dir { getattr search read write remove_name };
class file { getattr unlink };
')
########################################
#
# bootloader_read_config(domain,[`optional'])
#
define(`bootloader_read_config',`
requires_block_template(bootloader_read_config_depend,$2)
allow $1 bootloader_etc_t:file { getattr read };
')
define(`bootloader_read_config_depend',`
type bootloader_etc_t;
class file { getattr read };
')
########################################
#
# bootloader_modify_config(domain,[`optional'])
#
define(`bootloader_modify_bootloader_config',`
requires_block_template(bootloader_modify_config_depend,$2)
allow $1 bootloader_etc_t:file { getattr read write append };
')
define(`bootloader_modify_bootloader_config_depend',`
type bootloader_etc_t;
class file { getattr read write append };
')
########################################
#
# bootloader_create_runtime_data(domain,[`optional'])
#
define(`bootloader_create_runtime_data',`
requires_block_template(bootloader_create_runtime_data_depend,$2)
allow $1 boot_t:dir { getattr search read write add_name remove_name };
allow $1 boot_runtime_t:file { getattr create read write append unlink };
type_transition $1 boot_t:file boot_runtime_t;
')
define(`bootloader_create_runtime_data_depend',`
type boot_t, boot_runtime_t;
class dir { getattr search read write add_name remove_name };
class file { getattr create read write append unlink };
')
########################################
#
# bootloader_list_kernel_modules(domain,[`optional'])
#
define(`bootloader_list_kernel_modules',`
requires_block_template(bootloader_list_kernel_modules_depend,$2)
allow $1 modules_object_t:dir { getattr search read };
')
define(`bootloader_list_kernel_modules_depend',`
type modules_object_t;
class dir { getattr search read };
')
########################################
#
# bootloader_read_kernel_modules(domain,[`optional'])
#
define(`bootloader_read_kernel_modules',`
requires_block_template(bootloader_read_kernel_modules_depend,$2)
allow $1 modules_object_t:dir { getattr search read };
allow $1 modules_object_t:{ lnk_file file } { getattr read };
')
define(`bootloader_read_kernel_modules_depend',`
type modules_object_t;
class dir { getattr search read };
class lnk_file { getattr read };
class file { getattr read };
')
########################################
#
# bootloader_modify_kernel_modules(domain,[`optional'])
#
define(`bootloader_modify_kernel_modules',`
requires_block_template(bootloader_modify_kernel_modules_depend,$2)
allow $1 modules_object_t:file { getattr create read write setattr unlink };
allow $1 modules_object_t:dir { getattr search read write add_name remove_name };
')
define(`bootloader_modify_kernel_modules_depend',`
type modules_object_t;
class file { getattr create read write setattr unlink };
class dir { getattr search read write add_name remove_name };
')
########################################
#
# bootloader_create_private_module_dir_entry(domain,privatetype,[class(es)],[`optional'])
#
define(`bootloader_create_private_module_dir_entry',`
requires_block_template(bootloader_create_private_module_dir_entry_depend,$2)
allow $1 modules_object_t:dir { getattr search read write add_name remove_name };
ifelse(`$3',`',`
type_transition $1 modules_object_t:file $2;
',`
type_transition $1 modules_object_t:$3 $2;
') dnl end ifelse
')
define(`bootloader_create_private_module_dir_entry_depend',`
type modules_object_t;
class dir { getattr search read write add_name remove_name };
')