patch-2.1.72 linux/ipc/msg.c

Next file: linux/ipc/sem.c
Previous file: linux/init/main.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.71/linux/ipc/msg.c linux/ipc/msg.c
@@ -669,8 +669,8 @@
 		goto out;
 	case IPC_SET:
 		err = -EPERM;
-		if (!suser() && current->euid != ipcp->cuid && 
-		    current->euid != ipcp->uid)
+		if (current->euid != ipcp->cuid && 
+		    current->euid != ipcp->uid && !suser())
 			goto out;
 		if (tbuf.msg_qbytes > MSGMNB && !suser())
 			goto out;
@@ -684,8 +684,8 @@
 		goto out;
 	case IPC_RMID:
 		err = -EPERM;
-		if (!suser() && current->euid != ipcp->cuid && 
-		    current->euid != ipcp->uid)
+		if (current->euid != ipcp->cuid && 
+		    current->euid != ipcp->uid && !suser())
 			goto out;
 		/*
 		 * There is only one kerneld message queue,

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