patch-2.1.100 linux/ipc/msg.c

Next file: linux/ipc/sem.c
Previous file: linux/include/scsi/scsi_ioctl.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.99/linux/ipc/msg.c linux/ipc/msg.c
@@ -477,9 +477,10 @@
 	case IPC_SET:
 		err = -EPERM;
 		if (current->euid != ipcp->cuid && 
-		    current->euid != ipcp->uid && !suser())
+		    current->euid != ipcp->uid && !capable(CAP_SYS_ADMIN))
+		    /* We _could_ check for CAP_CHOWN above, but we don't */
 			goto out;
-		if (tbuf.msg_qbytes > MSGMNB && !suser())
+		if (tbuf.msg_qbytes > MSGMNB && !capable(CAP_SYS_RESOURCE))
 			goto out;
 		msq->msg_qbytes = tbuf.msg_qbytes;
 		ipcp->uid = tbuf.msg_perm.uid;
@@ -492,7 +493,7 @@
 	case IPC_RMID:
 		err = -EPERM;
 		if (current->euid != ipcp->cuid && 
-		    current->euid != ipcp->uid && !suser())
+		    current->euid != ipcp->uid && !capable(CAP_SYS_ADMIN))
 			goto out;
 
 		freeque (id); 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov