|
@@ -850,14 +850,9 @@ static int tomoyo_update_manager_entry(const char *manager,
|
|
policy_list[TOMOYO_ID_MANAGER],
|
|
policy_list[TOMOYO_ID_MANAGER],
|
|
};
|
|
};
|
|
int error = is_delete ? -ENOENT : -ENOMEM;
|
|
int error = is_delete ? -ENOENT : -ENOMEM;
|
|
- if (tomoyo_domain_def(manager)) {
|
|
|
|
- if (!tomoyo_correct_domain(manager))
|
|
|
|
- return -EINVAL;
|
|
|
|
- e.is_domain = true;
|
|
|
|
- } else {
|
|
|
|
- if (!tomoyo_correct_path(manager))
|
|
|
|
- return -EINVAL;
|
|
|
|
- }
|
|
|
|
|
|
+ if (!tomoyo_correct_domain(manager) &&
|
|
|
|
+ !tomoyo_correct_word(manager))
|
|
|
|
+ return -EINVAL;
|
|
e.manager = tomoyo_get_name(manager);
|
|
e.manager = tomoyo_get_name(manager);
|
|
if (e.manager) {
|
|
if (e.manager) {
|
|
error = tomoyo_update_policy(&e.head, sizeof(e), ¶m,
|
|
error = tomoyo_update_policy(&e.head, sizeof(e), ¶m,
|
|
@@ -932,23 +927,14 @@ static bool tomoyo_manager(void)
|
|
return true;
|
|
return true;
|
|
if (!tomoyo_manage_by_non_root && (task->cred->uid || task->cred->euid))
|
|
if (!tomoyo_manage_by_non_root && (task->cred->uid || task->cred->euid))
|
|
return false;
|
|
return false;
|
|
- list_for_each_entry_rcu(ptr, &tomoyo_kernel_namespace.
|
|
|
|
- policy_list[TOMOYO_ID_MANAGER], head.list) {
|
|
|
|
- if (!ptr->head.is_deleted && ptr->is_domain
|
|
|
|
- && !tomoyo_pathcmp(domainname, ptr->manager)) {
|
|
|
|
- found = true;
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if (found)
|
|
|
|
- return true;
|
|
|
|
exe = tomoyo_get_exe();
|
|
exe = tomoyo_get_exe();
|
|
if (!exe)
|
|
if (!exe)
|
|
return false;
|
|
return false;
|
|
list_for_each_entry_rcu(ptr, &tomoyo_kernel_namespace.
|
|
list_for_each_entry_rcu(ptr, &tomoyo_kernel_namespace.
|
|
policy_list[TOMOYO_ID_MANAGER], head.list) {
|
|
policy_list[TOMOYO_ID_MANAGER], head.list) {
|
|
- if (!ptr->head.is_deleted && !ptr->is_domain
|
|
|
|
- && !strcmp(exe, ptr->manager->name)) {
|
|
|
|
|
|
+ if (!ptr->head.is_deleted &&
|
|
|
|
+ (!tomoyo_pathcmp(domainname, ptr->manager) ||
|
|
|
|
+ !strcmp(exe, ptr->manager->name))) {
|
|
found = true;
|
|
found = true;
|
|
break;
|
|
break;
|
|
}
|
|
}
|