dazuko_xp.c File Reference

#include "dazuko_platform.h"
#include "dazuko_xp.h"
#include "dazukoio.h"
#include "dazuko_call.h"

Go to the source code of this file.

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)
static int dazuko_get_new_unique (void)
static int dazuko_slot_state (struct slot *s)
static int one_slot_state_not_condition (void *param)
static int two_slot_state_not_condition (void *param)
static int __dazuko_change_slot_state (struct slot *s, int from_state, int to_state)
static int dazuko_change_slot_state (struct slot *s, int from_state, int to_state, int release)
static struct slot_dazuko_find_slot (struct daemon_id *did, int release, struct slot_list *sl)
static struct slotdazuko_find_slot_and_slotlist (struct daemon_id *did, int release, struct slot_list *slist, struct slot_list **sl_result)
static struct slotdazuko_find_slot (struct daemon_id *did, int release, struct slot_list *slist)
static int dazuko_insert_path_fs (struct path **list, char *fs_path, int fs_len)
static void dazuko_remove_all_hash (void)
static void dazuko_remove_all_paths (void)
static int _dazuko_unregister_daemon (struct daemon_id *did)
int dazuko_unregister_daemon (struct xp_daemon_id *xp_id)
static int dazuko_state_error (struct slot *s, int current_state)
static int dazuko_register_daemon (struct daemon_id *did, const char *reg_name, int string_length, int write_mode)
static struct slotdazuko_get_an_access (struct daemon_id *did)
static int dazuko_return_access (struct daemon_id *did, int response, struct slot *s)
static int dazuko_isdigit (const char c)
static long dazuko_strtol (const char *string)
static int dazuko_strlen (const char *string)
static const char * dazuko_strchr (const char *haystack, char needle)
static const char * dazuko_strstr (const char *haystack, const char *needle)
int dazuko_get_value (const char *key, const char *string, char **value)
static void dazuko_clear_replybuffer (struct dazuko_request *request)
static void dazuko_close_replybuffer (struct dazuko_request *request)
static void dazuko_add_keyvalue_to_replybuffer (struct dazuko_request *request, const char *key, void *value, char vtype)
static int dazuko_printable (char c)
static void dazuko_add_esc_to_replybuffer (struct dazuko_request *request, const char *key, char **filename)
static int dazuko_set_option (struct daemon_id *did, int opt, void *param, int len)
static 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)
static struct slotdazuko_get_and_hold_ready_slot (struct slot_list *sl)
static int get_ready_slot_condition (void *param)
static 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)
static 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)
static int dazuko_is_selected (struct dazuko_file_struct *kfs)
static int dazuko_add_hash (struct xp_file *file, char *filename, int len)
static void dazuko_mark_hash_dirty (struct xp_file *file)
static struct hashdazuko_get_hash (struct xp_file *file)
int dazuko_get_filename_length (char *filename)
static 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 xp_file *file, 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

static int unique_count = 1
static char access_mask = 7
static struct slot_list_container slot_lists [NUM_SLOT_LISTS]
static struct pathincl_paths = NULL
static struct pathexcl_paths = NULL
static struct hashhash = NULL
static struct xp_rwlock lock_hash
static struct xp_rwlock lock_lists
static struct xp_atomic active
static struct xp_mutex mutex_unique_count
static struct xp_queue wait_kernel_waiting_for_free_slot
static struct xp_queue wait_daemon_waiting_for_work
static struct xp_queue wait_kernel_waiting_while_daemon_works
static struct xp_queue wait_daemon_waiting_for_free


Define Documentation

#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))
 

Referenced by dazuko_add_keyvalue_to_replybuffer().

#define DAZUKO_VSNPRINTF_PRINTSTRING
 

Value:

for ( ; *s ; s++) \
        { \
                if (target == end) \
                { \
                        overflow = 1; \
                        goto dazuko_vsnprintf_out; \
                } \
                *target = *s; \
                target++; \
        }

Referenced by dazuko_vsnprintf().

#define NUM_SLOT_LISTS   5
 

Definition at line 42 of file dazuko_xp.c.

#define NUM_SLOTS   25
 

Definition at line 43 of file dazuko_xp.c.

Referenced by _dazuko_find_slot(), dazuko_exit(), dazuko_get_and_hold_ready_slot(), and dazuko_register_daemon().

#define SCAN_ON_CLOSE   (access_mask & DAZUKO_ON_CLOSE)
 

Definition at line 46 of file dazuko_xp.c.

Referenced by dazuko_sys_check(), and dazuko_sys_post().

#define SCAN_ON_CLOSE_MODIFIED   (access_mask & DAZUKO_ON_CLOSE_MODIFIED)
 

Definition at line 48 of file dazuko_xp.c.

Referenced by dazuko_sys_check(), and dazuko_sys_post().

#define SCAN_ON_EXEC   (access_mask & DAZUKO_ON_EXEC)
 

Definition at line 47 of file dazuko_xp.c.

#define SCAN_ON_OPEN   (access_mask & DAZUKO_ON_OPEN)
 

Definition at line 45 of file dazuko_xp.c.

Referenced by dazuko_sys_check(), dazuko_sys_post(), and dazuko_sys_pre().


Function Documentation

static int __dazuko_change_slot_state struct slot s,
int  from_state,
int  to_state
[inline, static]
 

Definition at line 329 of file dazuko_xp.c.

References call_xp_notify(), DAZUKO_FREE, and DAZUKO_READY.

Referenced by _dazuko_unregister_daemon(), dazuko_change_slot_state(), dazuko_register_daemon(), and dazuko_run_daemon_on_slotlist().

static struct slot* _dazuko_find_slot struct daemon_id did,
int  release,
struct slot_list sl
[static]
 

Definition at line 387 of file dazuko_xp.c.

References call_xp_down(), call_xp_id_compare(), call_xp_print, call_xp_up(), slot::did, slot::mutex, NULL, NUM_SLOTS, slot_list::slots, daemon_id::unique, and daemon_id::xp_id.

Referenced by dazuko_find_slot_and_slotlist().

static int _dazuko_unregister_daemon struct daemon_id did  )  [static]
 

Definition at line 632 of file dazuko_xp.c.

References __dazuko_change_slot_state(), 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(), slot::did, DPRINT, slot::mutex, NULL, daemon_id::unique, slot_list::use_count, and daemon_id::xp_id.

Referenced by dazuko_set_option(), and dazuko_unregister_daemon().

static void dazuko_add_esc_to_replybuffer struct dazuko_request request,
const char *  key,
char **  filename
[inline, static]
 

Definition at line 1223 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().

static int dazuko_add_hash struct xp_file file,
char *  filename,
int  len
[static]
 

Definition at line 2341 of file dazuko_xp.c.

References call_xp_copy_file(), call_xp_malloc(), call_xp_write_lock(), call_xp_write_unlock(), hash::dirty, hash::file, hash::name, hash::namelen, hash::next, NULL, and XP_ERROR_FAULT.

Referenced by dazuko_sys_post().

static void dazuko_add_keyvalue_to_replybuffer struct dazuko_request request,
const char *  key,
void *  value,
char  vtype
[inline, static]
 

Definition at line 1187 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().

void dazuko_bzero void *  p,
int  len
[inline]
 

Definition at line 273 of file dazuko_xp.c.

Referenced by dazuko_clear_replybuffer(), dazuko_init(), dazuko_is_selected(), dazuko_register_daemon(), dazuko_run_daemon_on_slotlist(), linux_dazuko_device_read(), rsbac_adf_request_daz(), and rsbac_adf_set_attr_daz().

static int dazuko_change_slot_state struct slot s,
int  from_state,
int  to_state,
int  release
[static]
 

Definition at line 361 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().

static void dazuko_clear_replybuffer struct dazuko_request request  )  [inline, static]
 

Definition at line 1175 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().

static void dazuko_close_replybuffer struct dazuko_request request  )  [inline, static]
 

Definition at line 1181 of file dazuko_xp.c.

References dazuko_request::reply_buffer, and dazuko_request::reply_buffer_size_used.

Referenced by dazuko_handle_request().

int dazuko_exit void   )  [inline]
 

Definition at line 2837 of file dazuko_xp.c.

References call_xp_atomic_read(), call_xp_destroy_mutex(), call_xp_destroy_queue(), call_xp_destroy_rwlock(), call_xp_free(), call_xp_print, call_xp_sys_unhook, dazuko_remove_all_hash(), dazuko_remove_all_paths(), slot_list_container::mutex, NULL, NUM_SLOTS, slot_list_container::slot_list, and VERSION.

static struct slot* dazuko_find_slot struct daemon_id did,
int  release,
struct slot_list slist
[inline, static]
 

Definition at line 498 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().

static struct slot* dazuko_find_slot_and_slotlist struct daemon_id did,
int  release,
struct slot_list slist,
struct slot_list **  sl_result
[static]
 

Definition at line 455 of file dazuko_xp.c.

References _dazuko_find_slot(), call_xp_down(), call_xp_up(), NULL, and slot_list_container::slot_list.

Referenced by _dazuko_unregister_daemon(), and dazuko_find_slot().

static struct slot* dazuko_get_an_access struct daemon_id did  )  [static]
 

Definition at line 894 of file dazuko_xp.c.

References call_xp_notify(), call_xp_print, call_xp_wait_until_condition(), DAZUKO_BROKEN, dazuko_change_slot_state(), dazuko_find_slot(), DAZUKO_READY, dazuko_register_daemon(), DAZUKO_WAITING, DAZUKO_WORKING, DPRINT, NULL, one_slot_state_not_condition(), one_slot_state_not_condition_param::slot, one_slot_state_not_condition_param::state, and daemon_id::unique.

Referenced by dazuko_handle_request(), and dazuko_handle_user_request_compat12().

static struct slot* dazuko_get_and_hold_ready_slot struct slot_list sl  )  [static]
 

Definition at line 1991 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().

int dazuko_get_filename_length char *  filename  )  [inline]
 

Definition at line 2499 of file dazuko_xp.c.

Referenced by xp_fill_file_struct().

static struct hash* dazuko_get_hash struct xp_file file  )  [static]
 

Definition at line 2461 of file dazuko_xp.c.

References call_xp_compare_file(), call_xp_write_lock(), call_xp_write_unlock(), hash::file, hash::next, and NULL.

Referenced by dazuko_sys_post().

static int dazuko_get_new_unique void   )  [inline, static]
 

Definition at line 283 of file dazuko_xp.c.

References call_xp_down(), call_xp_up(), and unique_count.

Referenced by dazuko_register_daemon().

int dazuko_get_value const char *  key,
const char *  string,
char **  value
 

Definition at line 1141 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().

static int dazuko_handle_request struct dazuko_request request,
struct xp_daemon_id xp_id
[static]
 

Definition at line 1368 of file dazuko_xp.c.

References access_mask, ADD_EXCLUDE_PATH, ADD_INCLUDE_PATH, dazuko_request::buffer, dazuko_request::buffer_size, call_xp_free(), call_xp_id_copy(), call_xp_id_free(), call_xp_print, call_xp_up(), dazuko_add_esc_to_replybuffer(), dazuko_add_keyvalue_to_replybuffer(), dazuko_clear_replybuffer(), dazuko_close_replybuffer(), dazuko_get_an_access(), dazuko_get_value(), dazuko_register_daemon(), dazuko_return_access(), dazuko_set_option(), dazuko_strchr(), dazuko_strlen(), dazuko_strtol(), file_properties::device_type, slot::event, slot::event_p, slot::file_p, slot::filename, event_properties::flags, GET_AN_ACCESS, file_properties::gid, file_properties::mode, event_properties::mode, slot::mutex, NULL, event_properties::pid, REGISTER, REMOVE_ALL_PATHS, dazuko_request::reply_buffer_size, RETURN_AN_ACCESS, SET_ACCESS_MASK, file_properties::set_device_type, event_properties::set_flags, file_properties::set_gid, file_properties::set_mode, event_properties::set_mode, event_properties::set_pid, file_properties::set_size, file_properties::set_uid, event_properties::set_uid, file_properties::size, dazuko_request::type, file_properties::uid, event_properties::uid, daemon_id::unique, UNREGISTER, slot::write_mode, XP_ERROR_INTERRUPT, and daemon_id::xp_id.

Referenced by dazuko_handle_user_request().

int dazuko_handle_user_request struct dazuko_request user_request,
struct xp_daemon_id xp_id
 

Definition at line 1653 of file dazuko_xp.c.

References dazuko_request::buffer, dazuko_request::buffer_size, call_xp_copyin(), call_xp_copyout(), call_xp_free(), call_xp_malloc(), dazuko_handle_request(), NULL, dazuko_request::reply_buffer, dazuko_request::reply_buffer_size, dazuko_request::reply_buffer_size_used, dazuko_request::type, XP_ERROR_FAULT, and XP_ERROR_PERMISSION.

Referenced by linux_dazuko_device_write().

int dazuko_handle_user_request_compat12 void *  ptr,
int  cmd,
struct xp_daemon_id xp_id
 

Definition at line 1776 of file dazuko_xp.c.

References call_xp_copyin(), call_xp_copyout(), call_xp_free(), call_xp_id_copy(), call_xp_id_free(), call_xp_malloc(), call_xp_print, call_xp_up(), call_xp_verify_user_readable(), call_xp_verify_user_writable(), DAZUKO_FILENAME_MAX_LENGTH_COMPAT12, dazuko_get_an_access(), dazuko_register_daemon(), dazuko_return_access(), dazuko_set_option(), dazuko_state_error(), DAZUKO_WORKING, access_compat12::deny, access_compat12::event, slot::event, slot::event_p, slot::filename, access_compat12::filename, slot::filenamelength, event_properties::flags, IOCTL_GET_AN_ACCESS, IOCTL_RETURN_ACCESS, IOCTL_SET_OPTION, event_properties::mode, slot::mutex, NULL, access_compat12::o_flags, access_compat12::o_mode, access_compat12::pid, event_properties::pid, REGISTER, access_compat12::uid, event_properties::uid, daemon_id::unique, XP_ERROR_FAULT, XP_ERROR_INTERRUPT, XP_ERROR_INVALID, and daemon_id::xp_id.

Referenced by linux_dazuko_device_ioctl().

int dazuko_init void   )  [inline]
 

Definition at line 2807 of file dazuko_xp.c.

References 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(), and VERSION.

Referenced by rsbac_init_daz().

static int dazuko_insert_path_fs struct path **  list,
char *  fs_path,
int  fs_len
[static]
 

Definition at line 503 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, path::len, path::next, NULL, path::path, XP_ERROR_FAULT, and XP_ERROR_INVALID.

Referenced by dazuko_set_option().

int dazuko_is_our_daemon struct xp_daemon_id xp_id  )  [inline]
 

Definition at line 2218 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().

static int dazuko_is_selected struct dazuko_file_struct kfs  )  [static]
 

Definition at line 2236 of file dazuko_xp.c.

References dazuko_file_struct::aliases, call_xp_print, call_xp_read_lock(), call_xp_read_unlock(), dazuko_bzero(), dazuko_file_listnode::filename, dazuko_file_struct::filename, dazuko_file_struct::filename_length, dazuko_file_listnode::filename_length, path::len, path::next, dazuko_file_listnode::next, NULL, path::path, xp_free(), and xp_malloc().

Referenced by dazuko_should_scan().

static int dazuko_isdigit const char  c  )  [inline, static]
 

Definition at line 1043 of file dazuko_xp.c.

Referenced by dazuko_strtol().

static void dazuko_mark_hash_dirty struct xp_file file  )  [static]
 

Definition at line 2374 of file dazuko_xp.c.

References call_xp_compare_file(), call_xp_write_lock(), call_xp_write_unlock(), hash::dirty, hash::file, hash::next, and NULL.

Referenced by dazuko_sys_post().

static int dazuko_printable char  c  )  [inline, static]
 

Definition at line 1216 of file dazuko_xp.c.

Referenced by dazuko_add_esc_to_replybuffer().

static int dazuko_register_daemon struct daemon_id did,
const char *  reg_name,
int  string_length,
int  write_mode
[static]
 

Definition at line 734 of file dazuko_xp.c.

References __dazuko_change_slot_state(), call_xp_atomic_inc(), call_xp_atomic_set(), call_xp_down(), call_xp_free(), call_xp_id_copy(), call_xp_init_mutex(), call_xp_malloc(), call_xp_print, call_xp_up(), dazuko_bzero(), dazuko_find_slot(), DAZUKO_FREE, dazuko_get_new_unique(), slot::did, DPRINT, slot::id, slot::mutex, NULL, NUM_SLOTS, slot_list::reg_name, slot_list_container::slot_list, daemon_id::unique, slot_list::use_count, slot::write_mode, XP_ERROR_BUSY, XP_ERROR_FAULT, XP_ERROR_INTERRUPT, XP_ERROR_PERMISSION, and daemon_id::xp_id.

Referenced by dazuko_get_an_access(), dazuko_handle_request(), dazuko_handle_user_request_compat12(), and dazuko_set_option().

static void dazuko_remove_all_hash void   )  [static]
 

Definition at line 575 of file dazuko_xp.c.

References call_xp_free(), call_xp_write_lock(), call_xp_write_unlock(), DPRINT, hash::name, and hash::next.

Referenced by _dazuko_unregister_daemon(), and dazuko_exit().

static void dazuko_remove_all_paths void   )  [static]
 

Definition at line 596 of file dazuko_xp.c.

References call_xp_free(), call_xp_write_lock(), call_xp_write_unlock(), DPRINT, path::next, and path::path.

Referenced by _dazuko_unregister_daemon(), dazuko_exit(), and dazuko_set_option().

static int dazuko_return_access struct daemon_id did,
int  response,
struct slot s
[static]
 

Definition at line 976 of file dazuko_xp.c.

References call_xp_notify(), call_xp_up(), call_xp_wait_until_condition(), dazuko_change_slot_state(), DAZUKO_DONE, dazuko_find_slot(), DAZUKO_WORKING, DPRINT, slot::id, slot::mutex, NULL, one_slot_state_not_condition(), slot::response, one_slot_state_not_condition_param::slot, one_slot_state_not_condition_param::state, daemon_id::unique, XP_ERROR_INTERRUPT, and XP_ERROR_PERMISSION.

Referenced by dazuko_handle_request(), and dazuko_handle_user_request_compat12().

static int dazuko_run_daemon int  event,
char *  filename,
int  filenamelength,
struct event_properties event_p,
struct file_properties file_p
[static]
 

Definition at line 2170 of file dazuko_xp.c.

References call_xp_down(), call_xp_up(), dazuko_run_daemon_on_slotlist(), NULL, slot_list_container::slot_list, event_properties::thrown, and XP_ERROR_INTERRUPT.

Referenced by dazuko_sys_post(), and dazuko_sys_pre().

static 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
[static]
 

Definition at line 2027 of file dazuko_xp.c.

References __dazuko_change_slot_state(), call_xp_down(), call_xp_notify(), call_xp_up(), call_xp_wait_until_condition(), dazuko_bzero(), dazuko_change_slot_state(), DAZUKO_DONE, DAZUKO_FREE, DAZUKO_WAITING, DAZUKO_WORKING, slot::did, DPRINT, slot::event, slot::event_p, slot::file_p, slot::filename, slot::filenamelength, get_ready_slot_condition(), slot::mutex, NULL, event_properties::pid, slot::response, get_ready_slot_condition_param::slot, two_slot_state_not_condition_param::slot1, two_slot_state_not_condition_param::slot2, get_ready_slot_condition_param::slotlist, two_slot_state_not_condition_param::state1, two_slot_state_not_condition_param::state2, two_slot_state_not_condition(), and daemon_id::unique.

Referenced by dazuko_run_daemon().

static int dazuko_set_option struct daemon_id did,
int  opt,
void *  param,
int  len
[static]
 

Definition at line 1276 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(), NULL, REGISTER, REMOVE_ALL_PATHS, SET_ACCESS_MASK, UNREGISTER, and XP_ERROR_PERMISSION.

Referenced by dazuko_handle_request(), and dazuko_handle_user_request_compat12().

static int dazuko_should_scan struct dazuko_file_struct kfs  )  [static]
 

Definition at line 2508 of file dazuko_xp.c.

References call_xp_fill_file_struct(), dazuko_is_selected(), and dazuko_file_struct::should_scan.

Referenced by dazuko_sys_post(), and dazuko_sys_pre().

static int dazuko_slot_state struct slot s  )  [inline, static]
 

Definition at line 299 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().

int dazuko_snprintf char *  str,
size_t  size,
const char *  format,
  ...
 

Definition at line 261 of file dazuko_xp.c.

References dazuko_vsnprintf().

Referenced by dazuko_add_esc_to_replybuffer(), and linux_dazuko_device_read().

static int dazuko_state_error struct slot s,
int  current_state
[inline, static]
 

Definition at line 723 of file dazuko_xp.c.

References call_xp_notify(), DAZUKO_BROKEN, and dazuko_change_slot_state().

Referenced by dazuko_handle_user_request_compat12().

static const char* dazuko_strchr const char *  haystack,
char  needle
[inline, static]
 

Definition at line 1101 of file dazuko_xp.c.

References NULL.

Referenced by dazuko_handle_request().

static int dazuko_strlen const char *  string  )  [inline, static]
 

Definition at line 1088 of file dazuko_xp.c.

References NULL.

Referenced by dazuko_get_value(), and dazuko_handle_request().

static const char* dazuko_strstr const char *  haystack,
const char *  needle
[inline, static]
 

Definition at line 1117 of file dazuko_xp.c.

References NULL.

Referenced by dazuko_get_value().

static long dazuko_strtol const char *  string  )  [inline, static]
 

Definition at line 1048 of file dazuko_xp.c.

References dazuko_isdigit(), and NULL.

Referenced by dazuko_handle_request().

int dazuko_sys_check unsigned long  event,
int  daemon_is_allowed,
struct xp_daemon_id xp_id
[inline]
 

Definition at line 2563 of file dazuko_xp.c.

References access_mask, 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 rsbac_adf_request_daz(), and rsbac_adf_set_attr_daz().

int dazuko_sys_post unsigned long  event,
struct dazuko_file_struct kfs,
struct xp_file file,
struct event_properties event_p
[inline]
 

Definition at line 2726 of file dazuko_xp.c.

References 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(), hash::dirty, hash::name, hash::namelen, NULL, SCAN_ON_CLOSE, SCAN_ON_CLOSE_MODIFIED, and SCAN_ON_OPEN.

Referenced by rsbac_adf_set_attr_daz().

int dazuko_sys_pre unsigned long  event,
struct dazuko_file_struct kfs,
struct xp_file file,
struct event_properties event_p
[inline]
 

Definition at line 2608 of file dazuko_xp.c.

References call_xp_compare_file(), call_xp_malloc(), call_xp_print, call_xp_read_lock(), call_xp_read_unlock(), DAZUKO_ON_CLOSE, DAZUKO_ON_CLOSE_MODIFIED, DAZUKO_ON_OPEN, dazuko_run_daemon(), dazuko_should_scan(), dazuko_file_struct::extra_data, hash::file, dazuko_file_struct::filename, dazuko_file_struct::filename_length, hash::name, hash::namelen, hash::next, NULL, SCAN_ON_OPEN, dazuko_file_struct::should_scan, XP_ERROR_INTERRUPT, and XP_ERROR_PERMISSION.

Referenced by rsbac_adf_request_daz().

int dazuko_unregister_daemon struct xp_daemon_id xp_id  ) 
 

Definition at line 705 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().

int dazuko_vsnprintf char *  str,
size_t  size,
const char *  format,
va_list  ap
 

Definition at line 149 of file dazuko_xp.c.

References DAZUKO_VSNPRINTF_PRINTSTRING, and NULL.

Referenced by dazuko_snprintf(), and xp_print().

static int get_ready_slot_condition void *  param  )  [static]
 

Definition at line 2020 of file dazuko_xp.c.

References call_xp_atomic_read(), dazuko_get_and_hold_ready_slot(), and NULL.

Referenced by dazuko_run_daemon_on_slotlist().

static int one_slot_state_not_condition void *  param  )  [static]
 

Definition at line 315 of file dazuko_xp.c.

References dazuko_slot_state().

Referenced by dazuko_get_an_access(), and dazuko_return_access().

static int two_slot_state_not_condition void *  param  )  [static]
 

Definition at line 321 of file dazuko_xp.c.

References dazuko_slot_state().

Referenced by dazuko_run_daemon_on_slotlist().


Variable Documentation

char access_mask = 7 [static]
 

Definition at line 133 of file dazuko_xp.c.

Referenced by dazuko_handle_request(), dazuko_set_option(), and dazuko_sys_check().

struct xp_atomic active [static]
 

Definition at line 140 of file dazuko_xp.c.

struct path* excl_paths = NULL [static]
 

Definition at line 136 of file dazuko_xp.c.

struct hash* hash = NULL [static]
 

Definition at line 137 of file dazuko_xp.c.

struct path* incl_paths = NULL [static]
 

Definition at line 135 of file dazuko_xp.c.

struct xp_rwlock lock_hash [static]
 

Definition at line 138 of file dazuko_xp.c.

struct xp_rwlock lock_lists [static]
 

Definition at line 139 of file dazuko_xp.c.

struct xp_mutex mutex_unique_count [static]
 

Definition at line 141 of file dazuko_xp.c.

struct slot_list_container slot_lists[NUM_SLOT_LISTS] [static]
 

Definition at line 134 of file dazuko_xp.c.

int unique_count = 1 [static]
 

Definition at line 132 of file dazuko_xp.c.

Referenced by dazuko_get_new_unique().

struct xp_queue wait_daemon_waiting_for_free [static]
 

Definition at line 146 of file dazuko_xp.c.

struct xp_queue wait_daemon_waiting_for_work [static]
 

Definition at line 144 of file dazuko_xp.c.

struct xp_queue wait_kernel_waiting_for_free_slot [static]
 

Definition at line 143 of file dazuko_xp.c.

struct xp_queue wait_kernel_waiting_while_daemon_works [static]
 

Definition at line 145 of file dazuko_xp.c.


Generated on Fri Jun 17 09:45:29 2005 for RSBAC by  doxygen 1.4.2