2113 |
* |
* |
2114 |
* Returns pointer to "struct ccs_condition" on success, NULL otherwise. |
* Returns pointer to "struct ccs_condition" on success, NULL otherwise. |
2115 |
*/ |
*/ |
2116 |
static struct ccs_condition *ccs_get_execute_condition(struct ccs_execve |
static struct ccs_condition *ccs_get_execute_condition(struct ccs_execve *ee) |
|
*ee) |
|
2117 |
{ |
{ |
2118 |
struct ccs_condition *cond; |
struct ccs_condition *cond; |
2119 |
char *buf; |
char *buf; |
2173 |
* |
* |
2174 |
* Returns pointer to "struct ccs_condition" on success, NULL otherwise. |
* Returns pointer to "struct ccs_condition" on success, NULL otherwise. |
2175 |
*/ |
*/ |
2176 |
static struct ccs_condition *ccs_get_symlink_condition(struct ccs_request_info |
static struct ccs_condition *ccs_get_symlink_condition |
2177 |
*r) |
(const struct ccs_request_info *r) |
2178 |
{ |
{ |
2179 |
struct ccs_condition *cond; |
struct ccs_condition *cond; |
2180 |
char *buf; |
char *buf; |
2229 |
/** |
/** |
2230 |
* ccs_supervisor - Ask for the supervisor's decision. |
* ccs_supervisor - Ask for the supervisor's decision. |
2231 |
* |
* |
2232 |
* @r: Pointer to "struct ccs_request_info". |
* @r: Pointer to "struct ccs_request_info". |
2233 |
* @fmt: The printf()'s format string, followed by parameters. |
* @fmt: The printf()'s format string, followed by parameters. |
2234 |
* |
* |
2235 |
* Returns 0 if the supervisor decided to permit the access request which |
* Returns 0 if the supervisor decided to permit the access request which |
2236 |
* violated the policy in enforcing mode, CCS_RETRY_REQUEST if the supervisor |
* violated the policy in enforcing mode, CCS_RETRY_REQUEST if the supervisor |
2264 |
vsnprintf(buffer, len - 1, fmt, args); |
vsnprintf(buffer, len - 1, fmt, args); |
2265 |
va_end(args); |
va_end(args); |
2266 |
ccs_normalize_line(buffer); |
ccs_normalize_line(buffer); |
2267 |
if (r->ee && !strncmp(buffer, "allow_execute ", 14)) |
if (r->param_type == CCS_TYPE_PATH_ACL && |
2268 |
|
r->param.path.operation == CCS_TYPE_EXECUTE) |
2269 |
cond = ccs_get_execute_condition(r->ee); |
cond = ccs_get_execute_condition(r->ee); |
2270 |
else if (r->obj && r->obj->symlink_target) |
else if (r->param_type == CCS_TYPE_PATH_ACL && |
2271 |
|
r->param.path.operation == CCS_TYPE_SYMLINK) |
2272 |
cond = ccs_get_symlink_condition(r); |
cond = ccs_get_symlink_condition(r); |
2273 |
else if ((current->ccs_flags & CCS_TASK_IS_EXECUTE_HANDLER)) { |
else if ((current->ccs_flags & CCS_TASK_IS_EXECUTE_HANDLER)) { |
2274 |
char str[] = "if task.type=execute_handler"; |
char str[] = "if task.type=execute_handler"; |