patch-2.6.6-vs1.9.0
[linux-2.6.git] / ipc / util.c
index f74c5ee..310ccc5 100644 (file)
@@ -103,8 +103,10 @@ int ipc_findkey(struct ipc_ids* ids, key_t key)
         */
        for (id = 0; id <= max_id; id++) {
                p = ids->entries[id].p;
-               if(p==NULL)
+               if (p==NULL)
                        continue;
+               if (!vx_check(p->xid, VX_IDENT))
+                       continue;       
                if (key == p->key)
                        return id;
        }
@@ -367,6 +369,8 @@ int ipcperms (struct kern_ipc_perm *ipcp, short flag)
 {      /* flag will most probably be 0 or S_...UGO from <linux/stat.h> */
        int requested_mode, granted_mode;
 
+       if (!vx_check(ipcp->xid, VX_ADMIN|VX_IDENT)) /* maybe just VX_IDENT? */
+               return -1;
        requested_mode = (flag >> 6) | (flag >> 3) | flag;
        granted_mode = ipcp->mode;
        if (current->euid == ipcp->cuid || current->euid == ipcp->uid)