mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
IPC: introduce ipc_update_perm()
The IPC_SET command performs the same permission setting for all IPCs. This patch introduces a common ipc_update_perm() function to update these permissions and makes use of it for all IPCs. Signed-off-by: Pierre Peiffer <[email protected]> Acked-by: Serge Hallyn <[email protected]> Cc: Nadia Derbey <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
016d7132f2
commit
8f4a3809c1
5 changed files with 17 additions and 12 deletions
|
|
@ -656,10 +656,7 @@ static int shmctl_down(struct ipc_namespace *ns, int shmid, int cmd,
|
|||
do_shm_rmid(ns, ipcp);
|
||||
goto out_up;
|
||||
case IPC_SET:
|
||||
ipcp->uid = shmid64.shm_perm.uid;
|
||||
ipcp->gid = shmid64.shm_perm.gid;
|
||||
ipcp->mode = (ipcp->mode & ~S_IRWXUGO)
|
||||
| (shmid64.shm_perm.mode & S_IRWXUGO);
|
||||
ipc_update_perm(&shmid64.shm_perm, ipcp);
|
||||
shp->shm_ctim = get_seconds();
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
Loading…
Reference in a new issue