patch-2.1.100 linux/ipc/sem.c

Next file: linux/ipc/shm.c
Previous file: linux/ipc/msg.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.99/linux/ipc/sem.c linux/ipc/sem.c
@@ -482,7 +482,8 @@
 			goto out;
 		break;
 	case IPC_RMID:
-		if (current->euid == ipcp->cuid || current->euid == ipcp->uid || suser()) {
+		if (current->euid == ipcp->cuid || 
+		    current->euid == ipcp->uid || capable(CAP_SYS_ADMIN)) {
 			freeary (id);
 			err = 0;
 			goto out;
@@ -540,7 +541,8 @@
 		update_queue(sma);
 		break;
 	case IPC_SET:
-		if (current->euid == ipcp->cuid || current->euid == ipcp->uid || suser()) {
+		if (current->euid == ipcp->cuid || 
+		    current->euid == ipcp->uid || capable(CAP_SYS_ADMIN)) {
 			ipcp->uid = tbuf.sem_perm.uid;
 			ipcp->gid = tbuf.sem_perm.gid;
 			ipcp->mode = (ipcp->mode & ~S_IRWXUGO)

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