This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / ipc / util.c
index dbaf6d5..41310d6 100644 (file)
@@ -28,8 +28,6 @@
 
 #include <asm/unistd.h>
 
-#include <asm/unistd.h>
-
 #include "util.h"
 
 /**
@@ -399,8 +397,11 @@ int ipcperms (struct kern_ipc_perm *ipcp, short flag)
                granted_mode >>= 3;
        /* is there some bit set in requested_mode but not in granted_mode? */
        if ((requested_mode & ~granted_mode & 0007) && 
-           !capable(CAP_IPC_OWNER))
-               return -1;
+           !capable(CAP_IPC_OWNER)) {
+               if (!can_do_mlock())  {
+                       return -1;
+               }
+       }       
 
        return security_ipc_permission(ipcp, flag);
 }