56 |
const struct path_info *dir_name; |
const struct path_info *dir_name; |
57 |
const struct path_info *fs_type; |
const struct path_info *fs_type; |
58 |
unsigned long flags; |
unsigned long flags; |
59 |
u8 is_deleted; |
bool is_deleted; |
60 |
}; |
}; |
61 |
|
|
62 |
/************************* MOUNT RESTRICTION HANDLER *************************/ |
/************************* MOUNT RESTRICTION HANDLER *************************/ |
70 |
|
|
71 |
static struct mount_entry *mount_list = NULL; |
static struct mount_entry *mount_list = NULL; |
72 |
|
|
73 |
static int AddMountACL(const char *dev_name, const char *dir_name, const char *fs_type, const unsigned long flags, const u8 is_delete) |
static int AddMountACL(const char *dev_name, const char *dir_name, const char *fs_type, const unsigned long flags, const bool is_delete) |
74 |
{ |
{ |
75 |
struct mount_entry *new_entry, *ptr; |
struct mount_entry *new_entry, *ptr; |
76 |
const struct path_info *fs, *dev, *dir; |
const struct path_info *fs, *dev, *dir; |
143 |
|
|
144 |
static int CheckMountPermission2(char *dev_name, char *dir_name, char *type, unsigned long flags) |
static int CheckMountPermission2(char *dev_name, char *dir_name, char *type, unsigned long flags) |
145 |
{ |
{ |
146 |
const u8 is_enforce = CheckCCSEnforce(CCS_SAKURA_RESTRICT_MOUNT); |
const bool is_enforce = CheckCCSEnforce(CCS_SAKURA_RESTRICT_MOUNT); |
147 |
int error = -EPERM; |
int error = -EPERM; |
148 |
if (!CheckCCSFlags(CCS_SAKURA_RESTRICT_MOUNT)) return 0; |
if (!CheckCCSFlags(CCS_SAKURA_RESTRICT_MOUNT)) return 0; |
149 |
if (!type) type = "<NULL>"; |
if (!type) type = "<NULL>"; |
311 |
} |
} |
312 |
EXPORT_SYMBOL(CheckMountPermission); |
EXPORT_SYMBOL(CheckMountPermission); |
313 |
|
|
314 |
int AddMountPolicy(char *data, const u8 is_delete) |
int AddMountPolicy(char *data, const bool is_delete) |
315 |
{ |
{ |
316 |
char *cp, *cp2; |
char *cp, *cp2; |
317 |
const char *fs, *dev, *dir; |
const char *fs, *dev, *dir; |