Revert "shmctl(IPC_RMID): fix wrong owner/creator checking"

This reverts commit 8b5b075f4c.

The reverted commit modifies IPC_SET instead of IPC_RMID.
This commit is contained in:
NAKAMURA Gou
2016-03-28 15:54:35 +09:00
parent a2548f5421
commit a083e6c2bf

View File

@ -51,7 +51,6 @@
#include <limits.h>
#include <mc_perf_event.h>
#include <march.h>
#include <process.h>
/* Headers taken from kitten LWK */
#include <lwk/stddef.h>
@ -3809,8 +3808,7 @@ SYSCALL_DECLARE(shmctl)
dkprintf("shmctl(%#x,%d,%p): lookup: %d\n", shmid, cmd, buf, error);
return error;
}
if (!has_cap_sys_admin(thread)
&& (obj->ds.shm_perm.uid != proc->euid)
if ((obj->ds.shm_perm.uid != proc->euid)
&& (obj->ds.shm_perm.cuid != proc->euid)) {
shmobj_list_unlock();
dkprintf("shmctl(%#x,%d,%p): -EPERM\n", shmid, cmd, buf);