1583 |
bool is_delete = false; |
bool is_delete = false; |
1584 |
bool is_select = false; |
bool is_select = false; |
1585 |
unsigned int profile; |
unsigned int profile; |
1586 |
struct ccs_condition_list *cond = NULL; |
struct ccs_condition *cond = NULL; |
1587 |
char *cp; |
char *cp; |
1588 |
int error; |
int error; |
1589 |
if (ccs_str_starts(&data, KEYWORD_DELETE)) |
if (ccs_str_starts(&data, KEYWORD_DELETE)) |
1660 |
* |
* |
1661 |
* @head: Pointer to "struct ccs_io_buffer". |
* @head: Pointer to "struct ccs_io_buffer". |
1662 |
* @ptr: Pointer to "struct ccs_single_path_acl_record". |
* @ptr: Pointer to "struct ccs_single_path_acl_record". |
1663 |
* @cond: Pointer to "struct ccs_condition_list". May be NULL. |
* @cond: Pointer to "struct ccs_condition". May be NULL. |
1664 |
* |
* |
1665 |
* Returns true on success, false otherwise. |
* Returns true on success, false otherwise. |
1666 |
*/ |
*/ |
1667 |
static bool ccs_print_single_path_acl(struct ccs_io_buffer *head, |
static bool ccs_print_single_path_acl(struct ccs_io_buffer *head, |
1668 |
struct ccs_single_path_acl_record *ptr, |
struct ccs_single_path_acl_record *ptr, |
1669 |
const struct ccs_condition_list *cond) |
const struct ccs_condition *cond) |
1670 |
{ |
{ |
1671 |
int pos; |
int pos; |
1672 |
u8 bit; |
u8 bit; |
1709 |
* |
* |
1710 |
* @head: Pointer to "struct ccs_io_buffer". |
* @head: Pointer to "struct ccs_io_buffer". |
1711 |
* @ptr: Pointer to "struct ccs_double_path_acl_record". |
* @ptr: Pointer to "struct ccs_double_path_acl_record". |
1712 |
* @cond: Pointer to "struct ccs_condition_list". May be NULL. |
* @cond: Pointer to "struct ccs_condition". May be NULL. |
1713 |
* |
* |
1714 |
* Returns true on success, false otherwise. |
* Returns true on success, false otherwise. |
1715 |
*/ |
*/ |
1716 |
static bool ccs_print_double_path_acl(struct ccs_io_buffer *head, |
static bool ccs_print_double_path_acl(struct ccs_io_buffer *head, |
1717 |
struct ccs_double_path_acl_record *ptr, |
struct ccs_double_path_acl_record *ptr, |
1718 |
const struct ccs_condition_list *cond) |
const struct ccs_condition *cond) |
1719 |
{ |
{ |
1720 |
int pos; |
int pos; |
1721 |
const char *atmark1 = ""; |
const char *atmark1 = ""; |
1760 |
* |
* |
1761 |
* @head: Pointer to "struct ccs_io_buffer". |
* @head: Pointer to "struct ccs_io_buffer". |
1762 |
* @ptr: Pointer to "struct ccs_ioctl_acl_record". |
* @ptr: Pointer to "struct ccs_ioctl_acl_record". |
1763 |
* @cond: Pointer to "struct ccs_condition_list". May be NULL. |
* @cond: Pointer to "struct ccs_condition". May be NULL. |
1764 |
* |
* |
1765 |
* Returns true on success, false otherwise. |
* Returns true on success, false otherwise. |
1766 |
*/ |
*/ |
1767 |
static bool ccs_print_ioctl_acl(struct ccs_io_buffer *head, |
static bool ccs_print_ioctl_acl(struct ccs_io_buffer *head, |
1768 |
struct ccs_ioctl_acl_record *ptr, |
struct ccs_ioctl_acl_record *ptr, |
1769 |
const struct ccs_condition_list *cond) |
const struct ccs_condition *cond) |
1770 |
{ |
{ |
1771 |
int pos = head->read_avail; |
int pos = head->read_avail; |
1772 |
const char *atmark = ""; |
const char *atmark = ""; |
1798 |
* |
* |
1799 |
* @head: Pointer to "struct ccs_io_buffer". |
* @head: Pointer to "struct ccs_io_buffer". |
1800 |
* @ptr: Pointer to "struct ccs_argv0_acl_record". |
* @ptr: Pointer to "struct ccs_argv0_acl_record". |
1801 |
* @cond: Pointer to "struct ccs_condition_list". May be NULL. |
* @cond: Pointer to "struct ccs_condition". May be NULL. |
1802 |
* |
* |
1803 |
* Returns true on success, false otherwise. |
* Returns true on success, false otherwise. |
1804 |
*/ |
*/ |
1805 |
static bool ccs_print_argv0_acl(struct ccs_io_buffer *head, |
static bool ccs_print_argv0_acl(struct ccs_io_buffer *head, |
1806 |
struct ccs_argv0_acl_record *ptr, |
struct ccs_argv0_acl_record *ptr, |
1807 |
const struct ccs_condition_list *cond) |
const struct ccs_condition *cond) |
1808 |
{ |
{ |
1809 |
int pos = head->read_avail; |
int pos = head->read_avail; |
1810 |
if (!ccs_io_printf(head, KEYWORD_ALLOW_ARGV0 "%s %s", |
if (!ccs_io_printf(head, KEYWORD_ALLOW_ARGV0 "%s %s", |
1823 |
* |
* |
1824 |
* @head: Pointer to "struct ccs_io_buffer". |
* @head: Pointer to "struct ccs_io_buffer". |
1825 |
* @ptr: Pointer to "struct ccs_env_acl_record". |
* @ptr: Pointer to "struct ccs_env_acl_record". |
1826 |
* @cond: Pointer to "struct ccs_condition_list". May be NULL. |
* @cond: Pointer to "struct ccs_condition". May be NULL. |
1827 |
* |
* |
1828 |
* Returns true on success, false otherwise. |
* Returns true on success, false otherwise. |
1829 |
*/ |
*/ |
1830 |
static bool ccs_print_env_acl(struct ccs_io_buffer *head, |
static bool ccs_print_env_acl(struct ccs_io_buffer *head, |
1831 |
struct ccs_env_acl_record *ptr, |
struct ccs_env_acl_record *ptr, |
1832 |
const struct ccs_condition_list *cond) |
const struct ccs_condition *cond) |
1833 |
{ |
{ |
1834 |
int pos = head->read_avail; |
int pos = head->read_avail; |
1835 |
if (!ccs_io_printf(head, KEYWORD_ALLOW_ENV "%s", ptr->env->name)) |
if (!ccs_io_printf(head, KEYWORD_ALLOW_ENV "%s", ptr->env->name)) |
1847 |
* |
* |
1848 |
* @head: Pointer to "struct ccs_io_buffer". |
* @head: Pointer to "struct ccs_io_buffer". |
1849 |
* @ptr: Pointer to "struct ccs_capability_acl_record". |
* @ptr: Pointer to "struct ccs_capability_acl_record". |
1850 |
* @cond: Pointer to "struct ccs_condition_list". May be NULL. |
* @cond: Pointer to "struct ccs_condition". May be NULL. |
1851 |
* |
* |
1852 |
* Returns true on success, false otherwise. |
* Returns true on success, false otherwise. |
1853 |
*/ |
*/ |
1854 |
static bool ccs_print_capability_acl(struct ccs_io_buffer *head, |
static bool ccs_print_capability_acl(struct ccs_io_buffer *head, |
1855 |
struct ccs_capability_acl_record *ptr, |
struct ccs_capability_acl_record *ptr, |
1856 |
const struct ccs_condition_list *cond) |
const struct ccs_condition *cond) |
1857 |
{ |
{ |
1858 |
int pos = head->read_avail; |
int pos = head->read_avail; |
1859 |
if (!ccs_io_printf(head, KEYWORD_ALLOW_CAPABILITY "%s", |
if (!ccs_io_printf(head, KEYWORD_ALLOW_CAPABILITY "%s", |
1938 |
* |
* |
1939 |
* @head: Pointer to "struct ccs_io_buffer". |
* @head: Pointer to "struct ccs_io_buffer". |
1940 |
* @ptr: Pointer to "struct ccs_ip_network_acl_record". |
* @ptr: Pointer to "struct ccs_ip_network_acl_record". |
1941 |
* @cond: Pointer to "struct ccs_condition_list". May be NULL. |
* @cond: Pointer to "struct ccs_condition". May be NULL. |
1942 |
* |
* |
1943 |
* Returns true on success, false otherwise. |
* Returns true on success, false otherwise. |
1944 |
*/ |
*/ |
1945 |
static bool ccs_print_network_acl(struct ccs_io_buffer *head, |
static bool ccs_print_network_acl(struct ccs_io_buffer *head, |
1946 |
struct ccs_ip_network_acl_record *ptr, |
struct ccs_ip_network_acl_record *ptr, |
1947 |
const struct ccs_condition_list *cond) |
const struct ccs_condition *cond) |
1948 |
{ |
{ |
1949 |
int pos = head->read_avail; |
int pos = head->read_avail; |
1950 |
if (!ccs_io_printf(head, KEYWORD_ALLOW_NETWORK "%s ", |
if (!ccs_io_printf(head, KEYWORD_ALLOW_NETWORK "%s ", |
1979 |
* |
* |
1980 |
* @head: Pointer to "struct ccs_io_buffer". |
* @head: Pointer to "struct ccs_io_buffer". |
1981 |
* @ptr: Pointer to "struct signale_acl_record". |
* @ptr: Pointer to "struct signale_acl_record". |
1982 |
* @cond: Pointer to "struct ccs_condition_list". May be NULL. |
* @cond: Pointer to "struct ccs_condition". May be NULL. |
1983 |
* |
* |
1984 |
* Returns true on success, false otherwise. |
* Returns true on success, false otherwise. |
1985 |
*/ |
*/ |
1986 |
static bool ccs_print_signal_acl(struct ccs_io_buffer *head, |
static bool ccs_print_signal_acl(struct ccs_io_buffer *head, |
1987 |
struct ccs_signal_acl_record *ptr, |
struct ccs_signal_acl_record *ptr, |
1988 |
const struct ccs_condition_list *cond) |
const struct ccs_condition *cond) |
1989 |
{ |
{ |
1990 |
int pos = head->read_avail; |
int pos = head->read_avail; |
1991 |
if (!ccs_io_printf(head, KEYWORD_ALLOW_SIGNAL "%u %s", |
if (!ccs_io_printf(head, KEYWORD_ALLOW_SIGNAL "%u %s", |
2027 |
static bool ccs_print_entry(struct ccs_io_buffer *head, |
static bool ccs_print_entry(struct ccs_io_buffer *head, |
2028 |
struct ccs_acl_info *ptr) |
struct ccs_acl_info *ptr) |
2029 |
{ |
{ |
2030 |
const struct ccs_condition_list *cond = ptr->cond; |
const struct ccs_condition *cond = ptr->cond; |
2031 |
const u8 acl_type = ptr->type; |
const u8 acl_type = ptr->type; |
2032 |
if (acl_type & ACL_DELETED) |
if (acl_type & ACL_DELETED) |
2033 |
return true; |
return true; |