예제 #1
0
/**
 * tomoyo_check_env_acl - Check permission for environment variable's name.
 *
 * @r:   Pointer to "struct tomoyo_request_info".
 * @ptr: Pointer to "struct tomoyo_acl_info".
 *
 * Returns true if granted, false otherwise.
 */
static bool tomoyo_check_env_acl(struct tomoyo_request_info *r,
				 const struct tomoyo_acl_info *ptr)
{
	const struct tomoyo_env_acl *acl =
		container_of(ptr, typeof(*acl), head);

	return tomoyo_path_matches_pattern(r->param.environ.name, acl->env);
}
예제 #2
0
const struct tomoyo_path_info *
tomoyo_compare_name_union(const struct tomoyo_path_info *name,
			  const struct tomoyo_name_union *ptr)
{
	if (ptr->group)
		return tomoyo_path_matches_group(name, ptr->group);
	if (tomoyo_path_matches_pattern(name, ptr->filename))
		return ptr->filename;
	return NULL;
}