#include "dazuko_platform.h"
#include "dazuko_xp.h"
#include "dazukoio.h"
#include "dazuko_call.h"
Go to the source code of this file.
Data Structures | |
struct | path |
struct | hash |
struct | daemon_id |
struct | slot |
struct | slot_list |
struct | slot_list_container |
struct | one_slot_state_not_condition_param |
struct | two_slot_state_not_condition_param |
struct | get_ready_slot_condition_param |
Defines | |
#define | NUM_SLOT_LISTS 5 |
#define | NUM_SLOTS 25 |
#define | SCAN_ON_OPEN (access_mask & DAZUKO_ON_OPEN) |
#define | SCAN_ON_CLOSE (access_mask & DAZUKO_ON_CLOSE) |
#define | SCAN_ON_EXEC (access_mask & DAZUKO_ON_EXEC) |
#define | SCAN_ON_CLOSE_MODIFIED (access_mask & DAZUKO_ON_CLOSE_MODIFIED) |
#define | DAZUKO_VSNPRINTF_PRINTSTRING |
#define | DAZUKO_VSNPRINT(type, name) dazuko_snprintf(request->reply_buffer + request->reply_buffer_size_used, (request->reply_buffer_size - request->reply_buffer_size_used) - 1, "%s%" #type , key, *((name *)value)) |
Functions | |
int | dazuko_vsnprintf (char *str, size_t size, const char *format, va_list ap) |
int | dazuko_snprintf (char *str, size_t size, const char *format,...) |
void | dazuko_bzero (void *p, int len) |
int | dazuko_get_new_unique (void) |
int | dazuko_slot_state (struct slot *s) |
int | one_slot_state_not_condition (void *param) |
int | two_slot_state_not_condition (void *param) |
int | __dazuko_change_slot_state (struct slot *s, int from_state, int to_state) |
int | dazuko_change_slot_state (struct slot *s, int from_state, int to_state, int release) |
slot * | _dazuko_find_slot (struct daemon_id *did, int release, struct slot_list *sl) |
slot * | dazuko_find_slot_and_slotlist (struct daemon_id *did, int release, struct slot_list *slist, struct slot_list **sl_result) |
slot * | dazuko_find_slot (struct daemon_id *did, int release, struct slot_list *slist) |
int | dazuko_insert_path_fs (struct path **list, char *fs_path, int fs_len) |
void | dazuko_remove_all_hash (void) |
void | dazuko_remove_all_paths (void) |
int | _dazuko_unregister_daemon (struct daemon_id *did) |
int | dazuko_unregister_daemon (struct xp_daemon_id *xp_id) |
int | dazuko_state_error (struct slot *s, int current_state) |
int | dazuko_register_daemon (struct daemon_id *did, const char *reg_name, int string_length, int write_mode) |
slot * | dazuko_get_an_access (struct daemon_id *did) |
int | dazuko_return_access (struct daemon_id *did, int response, struct slot *s) |
int | dazuko_isdigit (const char c) |
long | dazuko_strtol (const char *string) |
int | dazuko_strlen (const char *string) |
const char * | dazuko_strchr (const char *haystack, char needle) |
const char * | dazuko_strstr (const char *haystack, const char *needle) |
int | dazuko_get_value (const char *key, const char *string, char **value) |
void | dazuko_clear_replybuffer (struct dazuko_request *request) |
void | dazuko_close_replybuffer (struct dazuko_request *request) |
void | dazuko_add_keyvalue_to_replybuffer (struct dazuko_request *request, const char *key, void *value, char vtype) |
int | dazuko_printable (char c) |
void | dazuko_add_esc_to_replybuffer (struct dazuko_request *request, const char *key, char **filename) |
int | dazuko_set_option (struct daemon_id *did, int opt, void *param, int len) |
int | dazuko_handle_request (struct dazuko_request *request, struct xp_daemon_id *xp_id) |
int | dazuko_handle_user_request (struct dazuko_request *user_request, struct xp_daemon_id *xp_id) |
int | dazuko_handle_user_request_compat12 (void *ptr, int cmd, struct xp_daemon_id *xp_id) |
slot * | dazuko_get_and_hold_ready_slot (struct slot_list *sl) |
int | get_ready_slot_condition (void *param) |
int | dazuko_run_daemon_on_slotlist (int event, char *filename, int filenamelength, struct event_properties *event_p, struct file_properties *file_p, int prev_response, struct slot_list *sl) |
int | dazuko_run_daemon (int event, char *filename, int filenamelength, struct event_properties *event_p, struct file_properties *file_p) |
int | dazuko_is_our_daemon (struct xp_daemon_id *xp_id) |
int | dazuko_is_selected (char *filename, int len) |
int | dazuko_add_hash (struct xp_file *file, char *filename, int len) |
void | dazuko_mark_hash_dirty (struct xp_file *file) |
hash * | dazuko_get_hash (struct xp_file *file) |
int | dazuko_get_filename_length (char *filename) |
int | dazuko_should_scan (struct dazuko_file_struct *kfs) |
int | dazuko_sys_check (unsigned long event, int daemon_is_allowed, struct xp_daemon_id *xp_id) |
int | dazuko_sys_pre (unsigned long event, struct dazuko_file_struct *kfs, struct event_properties *event_p) |
int | dazuko_sys_post (unsigned long event, struct dazuko_file_struct *kfs, struct xp_file *file, struct event_properties *event_p) |
int | dazuko_init (void) |
int | dazuko_exit (void) |
Variables | |
int | unique_count = 1 |
char | access_mask = 7 |
slot_list_container | slot_lists [NUM_SLOT_LISTS] |
path * | incl_paths = NULL |
path * | excl_paths = NULL |
hash * | hash = NULL |
xp_rwlock | lock_hash |
xp_rwlock | lock_lists |
xp_atomic | active |
xp_mutex | mutex_unique_count |
xp_queue | wait_kernel_waiting_for_free_slot |
xp_queue | wait_daemon_waiting_for_work |
xp_queue | wait_kernel_waiting_while_daemon_works |
xp_queue | wait_daemon_waiting_for_free |
|
Referenced by dazuko_add_keyvalue_to_replybuffer(). |
|
Value:
Referenced by dazuko_vsnprintf(). |
|
Definition at line 41 of file dazuko_xp.c. Referenced by dazuko_exit(), dazuko_find_slot_and_slotlist(), dazuko_init(), dazuko_register_daemon(), and dazuko_run_daemon(). |
|
Definition at line 42 of file dazuko_xp.c. Referenced by _dazuko_find_slot(), dazuko_exit(), dazuko_get_and_hold_ready_slot(), and dazuko_register_daemon(). |
|
Definition at line 45 of file dazuko_xp.c. Referenced by dazuko_sys_check(), and dazuko_sys_post(). |
|
Definition at line 47 of file dazuko_xp.c. Referenced by dazuko_sys_check(), and dazuko_sys_post(). |
|
Definition at line 46 of file dazuko_xp.c. |
|
Definition at line 44 of file dazuko_xp.c. Referenced by dazuko_sys_check(), dazuko_sys_post(), and dazuko_sys_pre(). |
|
Definition at line 328 of file dazuko_xp.c. References call_xp_notify(), DAZUKO_FREE, DAZUKO_READY, slot::did, slot::state, daemon_id::unique, wait_daemon_waiting_for_free, wait_kernel_waiting_for_free_slot, and wait_kernel_waiting_while_daemon_works. Referenced by _dazuko_unregister_daemon(), dazuko_change_slot_state(), dazuko_register_daemon(), and dazuko_run_daemon_on_slotlist(). |
|
Definition at line 386 of file dazuko_xp.c. References call_xp_down(), call_xp_id_compare(), call_xp_print, call_xp_up(), NULL, NUM_SLOTS, slot_list::slots, daemon_id::unique, and daemon_id::xp_id. Referenced by dazuko_find_slot_and_slotlist(). |
|
Definition at line 631 of file dazuko_xp.c. References __dazuko_change_slot_state(), active, call_xp_atomic_dec(), call_xp_atomic_read(), call_xp_id_free(), call_xp_notify(), call_xp_print, call_xp_up(), dazuko_find_slot_and_slotlist(), DAZUKO_FREE, dazuko_remove_all_hash(), dazuko_remove_all_paths(), DPRINT, NULL, daemon_id::unique, wait_kernel_waiting_for_free_slot, and wait_kernel_waiting_while_daemon_works. Referenced by dazuko_set_option(), and dazuko_unregister_daemon(). |
|
Definition at line 1222 of file dazuko_xp.c. References dazuko_add_keyvalue_to_replybuffer(), dazuko_printable(), dazuko_snprintf(), dazuko_request::reply_buffer, dazuko_request::reply_buffer_size, and dazuko_request::reply_buffer_size_used. Referenced by dazuko_handle_request(). |
|
Definition at line 2295 of file dazuko_xp.c. References call_xp_copy_file(), call_xp_malloc(), call_xp_write_lock(), call_xp_write_unlock(), hash, lock_hash, and XP_ERROR_FAULT. Referenced by dazuko_sys_post(). |
|
Definition at line 1186 of file dazuko_xp.c. References DAZUKO_VSNPRINT, dazuko_request::reply_buffer, and dazuko_request::reply_buffer_size_used. Referenced by dazuko_add_esc_to_replybuffer(), and dazuko_handle_request(). |
|
Definition at line 272 of file dazuko_xp.c. Referenced by dazuko_clear_replybuffer(), dazuko_init(), dazuko_register_daemon(), dazuko_rsbac_process(), dazuko_run_daemon_on_slotlist(), linux_dazuko_device_read(), rsbac_adf_request_daz(), and rsbac_adf_set_attr_daz(). |
|
Definition at line 360 of file dazuko_xp.c. References __dazuko_change_slot_state(), call_xp_down(), call_xp_up(), and slot::mutex. Referenced by dazuko_get_an_access(), dazuko_get_and_hold_ready_slot(), dazuko_return_access(), dazuko_run_daemon_on_slotlist(), and dazuko_state_error(). |
|
Definition at line 1174 of file dazuko_xp.c. References dazuko_bzero(), dazuko_request::reply_buffer, dazuko_request::reply_buffer_size, and dazuko_request::reply_buffer_size_used. Referenced by dazuko_handle_request(). |
|
Definition at line 1180 of file dazuko_xp.c. References dazuko_request::reply_buffer, and dazuko_request::reply_buffer_size_used. Referenced by dazuko_handle_request(). |
|
|
Definition at line 497 of file dazuko_xp.c. References dazuko_find_slot_and_slotlist(), and NULL. Referenced by dazuko_get_an_access(), dazuko_is_our_daemon(), dazuko_register_daemon(), dazuko_return_access(), and dazuko_set_option(). |
|
Definition at line 454 of file dazuko_xp.c. References _dazuko_find_slot(), call_xp_down(), call_xp_up(), NULL, NUM_SLOT_LISTS, slot_list_container::slot_list, and slot_lists. Referenced by _dazuko_unregister_daemon(), and dazuko_find_slot(). |
|
|
Definition at line 1990 of file dazuko_xp.c. References dazuko_change_slot_state(), DAZUKO_READY, DAZUKO_WAITING, NULL, NUM_SLOTS, and slot_list::slots. Referenced by get_ready_slot_condition(). |
|
Definition at line 2453 of file dazuko_xp.c. Referenced by xp_file_struct_check(). |
|
Definition at line 2415 of file dazuko_xp.c. References call_xp_compare_file(), call_xp_write_lock(), call_xp_write_unlock(), hash, lock_hash, hash::next, and NULL. Referenced by dazuko_sys_post(). |
|
Definition at line 282 of file dazuko_xp.c. References call_xp_down(), call_xp_up(), mutex_unique_count, and unique_count. Referenced by dazuko_register_daemon(). |
|
Definition at line 1140 of file dazuko_xp.c. References call_xp_malloc(), dazuko_strlen(), dazuko_strstr(), and NULL. Referenced by dazuko_handle_request(), and linux_dazuko_device_write(). |
|
|
Definition at line 1652 of file dazuko_xp.c. References call_xp_copyin(), call_xp_copyout(), call_xp_free(), call_xp_malloc(), dazuko_handle_request(), NULL, and XP_ERROR_FAULT. Referenced by linux_dazuko_device_write(). |
|
|
Definition at line 2714 of file dazuko_xp.c. References active, call_xp_atomic_set(), call_xp_init_mutex(), call_xp_init_queue(), call_xp_init_rwlock(), call_xp_print, call_xp_sys_hook, dazuko_bzero(), lock_hash, lock_lists, mutex_unique_count, NUM_SLOT_LISTS, slot_lists, VERSION, wait_daemon_waiting_for_free, wait_daemon_waiting_for_work, wait_kernel_waiting_for_free_slot, and wait_kernel_waiting_while_daemon_works. Referenced by linux_dazuko_init(), and rsbac_init_daz(). |
|
Definition at line 502 of file dazuko_xp.c. References call_xp_free(), call_xp_is_absolute_path(), call_xp_malloc(), call_xp_write_lock(), call_xp_write_unlock(), DPRINT, incl_paths, lock_lists, path::next, NULL, XP_ERROR_FAULT, and XP_ERROR_INVALID. Referenced by dazuko_set_option(). |
|
Definition at line 2216 of file dazuko_xp.c. References call_xp_id_copy(), call_xp_id_free(), dazuko_find_slot(), NULL, daemon_id::unique, and daemon_id::xp_id. Referenced by dazuko_sys_check(). |
|
Definition at line 2234 of file dazuko_xp.c. References call_xp_read_lock(), call_xp_read_unlock(), excl_paths, incl_paths, lock_lists, and path::next. Referenced by dazuko_should_scan(). |
|
Definition at line 1042 of file dazuko_xp.c. Referenced by dazuko_strtol(). |
|
Definition at line 2328 of file dazuko_xp.c. References call_xp_compare_file(), call_xp_write_lock(), call_xp_write_unlock(), hash, lock_hash, hash::next, and NULL. Referenced by dazuko_sys_post(). |
|
Definition at line 1215 of file dazuko_xp.c. Referenced by dazuko_add_esc_to_replybuffer(). |
|
|
Definition at line 574 of file dazuko_xp.c. References call_xp_free(), call_xp_write_lock(), call_xp_write_unlock(), DPRINT, hash, lock_hash, and hash::next. Referenced by _dazuko_unregister_daemon(), and dazuko_exit(). |
|
Definition at line 595 of file dazuko_xp.c. References call_xp_free(), call_xp_write_lock(), call_xp_write_unlock(), DPRINT, excl_paths, incl_paths, lock_lists, and path::next. Referenced by _dazuko_unregister_daemon(), dazuko_exit(), and dazuko_set_option(). |
|
|
Definition at line 2169 of file dazuko_xp.c. References call_xp_down(), call_xp_up(), dazuko_run_daemon_on_slotlist(), NULL, NUM_SLOT_LISTS, slot_list_container::slot_list, slot_lists, event_properties::thrown, and XP_ERROR_INTERRUPT. Referenced by dazuko_sys_post(), and dazuko_sys_pre(). |
|
|
Definition at line 1275 of file dazuko_xp.c. References _dazuko_unregister_daemon(), access_mask, ADD_EXCLUDE_PATH, ADD_INCLUDE_PATH, call_xp_print, dazuko_find_slot(), dazuko_insert_path_fs(), dazuko_register_daemon(), dazuko_remove_all_paths(), excl_paths, incl_paths, NULL, REGISTER, REMOVE_ALL_PATHS, SET_ACCESS_MASK, daemon_id::unique, UNREGISTER, and XP_ERROR_PERMISSION. Referenced by dazuko_handle_request(), and dazuko_handle_user_request_compat12(). |
|
Definition at line 2462 of file dazuko_xp.c. References call_xp_file_struct_check(), call_xp_file_struct_check_cleanup(), dazuko_is_selected(), dazuko_file_struct::filename, dazuko_file_struct::filename_length, and dazuko_file_struct::should_scan. Referenced by dazuko_sys_post(), and dazuko_sys_pre(). |
|
Definition at line 298 of file dazuko_xp.c. References call_xp_down(), call_xp_up(), slot::mutex, slot::state, and XP_ERROR_INTERRUPT. Referenced by one_slot_state_not_condition(), and two_slot_state_not_condition(). |
|
Definition at line 260 of file dazuko_xp.c. References dazuko_vsnprintf(). Referenced by dazuko_add_esc_to_replybuffer(), and linux_dazuko_device_read(). |
|
Definition at line 722 of file dazuko_xp.c. References call_xp_notify(), DAZUKO_BROKEN, dazuko_change_slot_state(), wait_kernel_waiting_for_free_slot, and wait_kernel_waiting_while_daemon_works. Referenced by dazuko_handle_user_request_compat12(). |
|
Definition at line 1100 of file dazuko_xp.c. References NULL. Referenced by dazuko_handle_request(). |
|
Definition at line 1087 of file dazuko_xp.c. References NULL. Referenced by dazuko_get_value(), and dazuko_handle_request(). |
|
Definition at line 1116 of file dazuko_xp.c. References NULL. Referenced by dazuko_get_value(). |
|
Definition at line 1047 of file dazuko_xp.c. References dazuko_isdigit(), and NULL. Referenced by dazuko_handle_request(). |
|
Definition at line 2519 of file dazuko_xp.c. References access_mask, active, call_xp_atomic_read(), dazuko_is_our_daemon(), DAZUKO_ON_CLOSE, DAZUKO_ON_OPEN, SCAN_ON_CLOSE, SCAN_ON_CLOSE_MODIFIED, and SCAN_ON_OPEN. Referenced by dazuko_rsbac_process(), rsbac_adf_request_daz(), and rsbac_adf_set_attr_daz(). |
|
Definition at line 2634 of file dazuko_xp.c. References active, call_xp_atomic_read(), call_xp_free(), dazuko_add_hash(), dazuko_get_hash(), dazuko_mark_hash_dirty(), DAZUKO_ON_CLOSE, DAZUKO_ON_CLOSE_MODIFIED, DAZUKO_ON_OPEN, dazuko_run_daemon(), dazuko_should_scan(), dazuko_file_struct::file_p, dazuko_file_struct::filename, dazuko_file_struct::filename_length, NULL, SCAN_ON_CLOSE, SCAN_ON_CLOSE_MODIFIED, and SCAN_ON_OPEN. Referenced by dazuko_rsbac_process(), and rsbac_adf_set_attr_daz(). |
|
Definition at line 2564 of file dazuko_xp.c. References DAZUKO_ON_CLOSE, DAZUKO_ON_CLOSE_MODIFIED, DAZUKO_ON_OPEN, dazuko_run_daemon(), dazuko_should_scan(), dazuko_file_struct::file_p, dazuko_file_struct::filename, dazuko_file_struct::filename_length, NULL, SCAN_ON_OPEN, XP_ERROR_INTERRUPT, and XP_ERROR_PERMISSION. Referenced by dazuko_rsbac_process(), and rsbac_adf_request_daz(). |
|
Definition at line 704 of file dazuko_xp.c. References _dazuko_unregister_daemon(), call_xp_id_copy(), call_xp_id_free(), NULL, daemon_id::unique, and daemon_id::xp_id. Referenced by linux_dazuko_device_release(). |
|
Definition at line 148 of file dazuko_xp.c. References DAZUKO_VSNPRINTF_PRINTSTRING, and NULL. Referenced by dazuko_snprintf(), and xp_print(). |
|
Definition at line 2019 of file dazuko_xp.c. References active, call_xp_atomic_read(), dazuko_get_and_hold_ready_slot(), and NULL. Referenced by dazuko_run_daemon_on_slotlist(). |
|
Definition at line 314 of file dazuko_xp.c. References dazuko_slot_state(). Referenced by dazuko_get_an_access(), and dazuko_return_access(). |
|
Definition at line 320 of file dazuko_xp.c. References dazuko_slot_state(). Referenced by dazuko_run_daemon_on_slotlist(). |
|
Definition at line 132 of file dazuko_xp.c. Referenced by dazuko_handle_request(), dazuko_set_option(), and dazuko_sys_check(). |
|
Definition at line 139 of file dazuko_xp.c. |
|
Definition at line 135 of file dazuko_xp.c. Referenced by dazuko_is_selected(), dazuko_remove_all_paths(), and dazuko_set_option(). |
|
Definition at line 136 of file dazuko_xp.c. Referenced by dazuko_add_hash(), dazuko_get_hash(), dazuko_mark_hash_dirty(), and dazuko_remove_all_hash(). |
|
Definition at line 134 of file dazuko_xp.c. Referenced by dazuko_insert_path_fs(), dazuko_is_selected(), dazuko_remove_all_paths(), and dazuko_set_option(). |
|
Definition at line 137 of file dazuko_xp.c. Referenced by dazuko_add_hash(), dazuko_exit(), dazuko_get_hash(), dazuko_init(), dazuko_mark_hash_dirty(), and dazuko_remove_all_hash(). |
|
Definition at line 138 of file dazuko_xp.c. Referenced by dazuko_exit(), dazuko_init(), dazuko_insert_path_fs(), dazuko_is_selected(), and dazuko_remove_all_paths(). |
|
Definition at line 140 of file dazuko_xp.c. Referenced by dazuko_exit(), dazuko_get_new_unique(), and dazuko_init(). |
|
Definition at line 133 of file dazuko_xp.c. Referenced by dazuko_exit(), dazuko_find_slot_and_slotlist(), dazuko_init(), dazuko_register_daemon(), and dazuko_run_daemon(). |
|
Definition at line 131 of file dazuko_xp.c. Referenced by dazuko_get_new_unique(). |
|
Definition at line 145 of file dazuko_xp.c. Referenced by __dazuko_change_slot_state(), dazuko_exit(), dazuko_init(), and dazuko_return_access(). |
|
Definition at line 143 of file dazuko_xp.c. Referenced by dazuko_exit(), dazuko_get_an_access(), dazuko_init(), and dazuko_run_daemon_on_slotlist(). |
|
Definition at line 142 of file dazuko_xp.c. Referenced by __dazuko_change_slot_state(), _dazuko_unregister_daemon(), dazuko_exit(), dazuko_get_an_access(), dazuko_init(), dazuko_run_daemon_on_slotlist(), and dazuko_state_error(). |
|
Definition at line 144 of file dazuko_xp.c. Referenced by __dazuko_change_slot_state(), _dazuko_unregister_daemon(), dazuko_exit(), dazuko_get_an_access(), dazuko_init(), dazuko_return_access(), dazuko_run_daemon_on_slotlist(), and dazuko_state_error(). |