X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=ipc%2Fshm.c;h=6e83b5f7137babae0ac0814de945fa086724860a;hb=9464c7cf61b9433057924c36e6e02f303a00e768;hp=13b6b8c1f952f7a46935cf79dac2c84a173326b5;hpb=41689045f6a3cbe0550e1d34e9cc20d2e8c432ba;p=linux-2.6.git diff --git a/ipc/shm.c b/ipc/shm.c index 13b6b8c1f..6e83b5f71 100644 --- a/ipc/shm.c +++ b/ipc/shm.c @@ -17,6 +17,7 @@ * Dustin Kirkland */ +#include #include #include #include @@ -655,7 +656,7 @@ asmlinkage long sys_shmctl (int shmid, int cmd, struct shmid_ds __user *buf) err = audit_ipc_obj(&(shp->shm_perm)); if (err) goto out_unlock_up; - err = audit_ipc_set_perm(0, setbuf.uid, setbuf.gid, setbuf.mode); + err = audit_ipc_set_perm(0, setbuf.uid, setbuf.gid, setbuf.mode, &(shp->shm_perm)); if (err) goto out_unlock_up; err=-EPERM; @@ -710,6 +711,7 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr) int err; unsigned long flags; unsigned long prot; + unsigned long o_flags; int acc_mode; void *user_addr; @@ -736,9 +738,11 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr) if (shmflg & SHM_RDONLY) { prot = PROT_READ; + o_flags = O_RDONLY; acc_mode = S_IRUGO; } else { prot = PROT_READ | PROT_WRITE; + o_flags = O_RDWR; acc_mode = S_IRUGO | S_IWUGO; } if (shmflg & SHM_EXEC) {