#include <linux/slab.h>
#include "common.h"
Go to the source code of this file.
|
| DEFINE_MUTEX (tomoyo_policy_lock) |
|
void | tomoyo_convert_time (time_t time, struct tomoyo_time *stamp) |
|
bool | tomoyo_permstr (const char *string, const char *keyword) |
|
char * | tomoyo_read_token (struct tomoyo_acl_param *param) |
|
struct tomoyo_path_info * | tomoyo_get_domainname (struct tomoyo_acl_param *param) |
|
u8 | tomoyo_parse_ulong (unsigned long *result, char **str) |
|
void | tomoyo_print_ulong (char *buffer, const int buffer_len, const unsigned long value, const u8 type) |
|
bool | tomoyo_parse_name_union (struct tomoyo_acl_param *param, struct tomoyo_name_union *ptr) |
|
bool | tomoyo_parse_number_union (struct tomoyo_acl_param *param, struct tomoyo_number_union *ptr) |
|
bool | tomoyo_str_starts (char **src, const char *find) |
|
void | tomoyo_normalize_line (unsigned char *buffer) |
|
bool | tomoyo_correct_word (const char *string) |
|
bool | tomoyo_correct_path (const char *filename) |
|
bool | tomoyo_correct_domain (const unsigned char *domainname) |
|
bool | tomoyo_domain_def (const unsigned char *buffer) |
|
struct tomoyo_domain_info * | tomoyo_find_domain (const char *domainname) |
|
void | tomoyo_fill_path_info (struct tomoyo_path_info *ptr) |
|
bool | tomoyo_path_matches_pattern (const struct tomoyo_path_info *filename, const struct tomoyo_path_info *pattern) |
|
const char * | tomoyo_get_exe (void) |
|
int | tomoyo_get_mode (const struct tomoyo_policy_namespace *ns, const u8 profile, const u8 index) |
|
int | tomoyo_init_request_info (struct tomoyo_request_info *r, struct tomoyo_domain_info *domain, const u8 index) |
|
bool | tomoyo_domain_quota_is_ok (struct tomoyo_request_info *r) |
|
tomoyo_convert_time - Convert time_t to YYYY/MM/DD hh/mm/ss.
: Seconds since 1970/01/01 00:00:00. : Pointer to "struct tomoyo_time".
Returns nothing.
This function does not handle Y2038 problem.
Definition at line 90 of file util.c.
tomoyo_correct_domain - Check whether the given domainname follows the naming rules.
: The domainname to check.
Returns true if follows the naming rules, false otherwise.
Definition at line 545 of file util.c.
tomoyo_correct_path - Validate a pathname.
: The pathname to check.
Check whether the given pathname follows the naming rules. Returns true if follows the naming rules, false otherwise.
Definition at line 533 of file util.c.
tomoyo_correct_word - Validate a string.
: The string to check.
Check whether the given string follows the naming rules. Returns true if follows the naming rules, false otherwise.
Definition at line 520 of file util.c.
tomoyo_domain_def - Check whether the given token can be a domainname.
: The token to check.
Returns true if possibly be a domainname, false otherwise.
Definition at line 571 of file util.c.
tomoyo_domain_quota_is_ok - Check for domain's quota.
: Pointer to "struct tomoyo_request_info".
Returns true if the domain is not exceeded quota, false otherwise.
Caller holds tomoyo_read_lock().
Definition at line 1023 of file util.c.
tomoyo_fill_path_info - Fill in "struct tomoyo_path_info" members.
: Pointer to "struct tomoyo_path_info" to fill in.
The caller sets "struct tomoyo_path_info"->name.
Definition at line 661 of file util.c.
tomoyo_find_domain - Find a domain by the given name.
: The domainname to find.
Returns pointer to "struct tomoyo_domain_info" if found, NULL otherwise.
Caller holds tomoyo_read_lock().
Definition at line 597 of file util.c.
tomoyo_get_domainname - Read a domainname from a line.
- Parameters
-
| Pointer to "struct tomoyo_acl_param". |
Returns a domainname on success, NULL otherwise.
Definition at line 169 of file util.c.
tomoyo_get_exe - Get tomoyo_realpath() of current process.
Returns the tomoyo_realpath() of current process on success, NULL otherwise.
This function uses kzalloc(), so the caller must call kfree() if this function didn't return NULL.
Definition at line 949 of file util.c.
tomoyo_get_mode - Get MAC mode.
: Pointer to "struct tomoyo_policy_namespace". : Profile number. : Index number of functionality.
Returns mode.
Definition at line 972 of file util.c.
tomoyo_init_request_info - Initialize "struct tomoyo_request_info" members.
: Pointer to "struct tomoyo_request_info" to initialize. : Pointer to "struct tomoyo_domain_info". NULL for tomoyo_domain(). : Index number of functionality.
Returns mode.
Definition at line 999 of file util.c.
void tomoyo_normalize_line |
( |
unsigned char * |
buffer | ) |
|
tomoyo_normalize_line - Format string.
: The line to normalize.
Leading and trailing whitespaces are removed. Multiple whitespaces are packed into single space.
Returns nothing.
Definition at line 414 of file util.c.
tomoyo_parse_name_union - Parse a tomoyo_name_union.
- Parameters
-
| Pointer to "struct tomoyo_acl_param". : Pointer to "struct tomoyo_name_union". |
Returns true on success, false otherwise.
Definition at line 257 of file util.c.
tomoyo_parse_number_union - Parse a tomoyo_number_union.
- Parameters
-
| Pointer to "struct tomoyo_acl_param". : Pointer to "struct tomoyo_number_union". |
Returns true on success, false otherwise.
Definition at line 281 of file util.c.
u8 tomoyo_parse_ulong |
( |
unsigned long * |
result, |
|
|
char ** |
str |
|
) |
| |
tomoyo_parse_ulong - Parse an "unsigned long" value.
- Returns
- : Pointer to "unsigned long". : Pointer to string to parse.
Returns one of values in "enum tomoyo_value_type".
The is updated to point the first character after the value on success.
Definition at line 197 of file util.c.
/ '/' + 'One or more repetitions of dir/' (e.g. /dir/ /dir/dir/ /dir/dir/dir/ ).
Definition at line 920 of file util.c.
tomoyo_permstr - Find permission keywords.
: String representation for permissions in foo/bar/buz format. : Keyword to find from /
Returns ture if was found in , false otherwise.
This function assumes that strncmp(w1, w2, strlen(w1)) != 0 if w1 != w2.
Definition at line 131 of file util.c.
tomoyo_print_ulong - Print an "unsigned long" value.
: Pointer to buffer. : Size of . : An "unsigned long" value. : Type of .
Returns nothing.
Definition at line 236 of file util.c.
tomoyo_read_token - Read a word from a line.
- Parameters
-
| Pointer to "struct tomoyo_acl_param". |
Returns a word on success, "" otherwise.
To allow the caller to skip NULL check, this function returns "" rather than NULL if there is no more words to read.
Definition at line 149 of file util.c.
tomoyo_str_starts - Check whether the given string starts with the given keyword.
: Pointer to pointer to the string. : Pointer to the keyword.
Returns true if starts with , false otherwise.
The is updated to point the first character after the if starts with .
Definition at line 392 of file util.c.
bool tomoyo_policy_loaded |