Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.1.100 /ipc/shm.c

Filename:/ipc/shm.c
Lines Added:6
Lines Deleted:4
Also changed in: (Previous) 2.1.92  2.1.89  2.1.72  2.1.54  2.1.45  2.1.37 
(Following) 2.1.106  2.1.115  2.1.118  2.1.125  2.1.126  2.1.130 

Location
[  2.1.100
  [  ipc
     o  shm.c

Patch

diff -u --recursive --new-file v2.1.99/linux/ipc/shm.c linux/ipc/shm.c
--- v2.1.99/linux/ipc/shm.c   Wed Apr  1 20:11:54 1998
+++ linux/ipc/shm.c   Wed May  6 10:56:06 1998
@@ -306,7 +306,7 @@
    switch (cmd) {
    case SHM_UNLOCK:
       err = -EPERM;
-      if (!suser())
+      if (!capable(CAP_IPC_LOCK))
          goto out;
       err = -EINVAL;
       if (!(ipcp->mode & SHM_LOCKED))
@@ -318,7 +318,7 @@
 /* Should the pages be faulted in here or leave it to user? */
 /* need to determine interaction with current->swappable */
       err = -EPERM;
-      if (!suser())
+      if (!capable(CAP_IPC_LOCK))
          goto out;
       err = -EINVAL;
       if (ipcp->mode & SHM_LOCKED)
@@ -347,7 +347,8 @@
       break;
    case IPC_SET:
       if (current->euid == shp->shm_perm.uid ||
-          current->euid == shp->shm_perm.cuid || suser()) {
+          current->euid == shp->shm_perm.cuid || 
+          capable(CAP_SYS_ADMIN)) {
          ipcp->uid = tbuf.shm_perm.uid;
          ipcp->gid = tbuf.shm_perm.gid;
          ipcp->mode = (ipcp->mode & ~S_IRWXUGO)
@@ -359,7 +360,8 @@
       goto out;
    case IPC_RMID:
       if (current->euid == shp->shm_perm.uid ||
-          current->euid == shp->shm_perm.cuid || suser()) {
+          current->euid == shp->shm_perm.cuid || 
+          capable(CAP_SYS_ADMIN)) {
          shp->shm_perm.mode |= SHM_DEST;
          if (shp->shm_nattch <= 0)
             killseg (id);


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.