]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - fs/namei.c
security: make LSMs explicitly mask off permissions
[net-next-2.6.git] / fs / namei.c
index 48e1f60520ea51d64f1802bda2b1d832249e4067..42d2d28fb827c41f5aad101e0faa340ac2dfa332 100644 (file)
@@ -282,8 +282,7 @@ int inode_permission(struct inode *inode, int mask)
        if (retval)
                return retval;
 
-       return security_inode_permission(inode,
-                       mask & (MAY_READ|MAY_WRITE|MAY_EXEC|MAY_APPEND));
+       return security_inode_permission(inode, mask);
 }
 
 /**
@@ -1484,8 +1483,7 @@ static int handle_truncate(struct path *path)
         */
        error = locks_verify_locked(inode);
        if (!error)
-               error = security_path_truncate(path, 0,
-                                      ATTR_MTIME|ATTR_CTIME|ATTR_OPEN);
+               error = security_path_truncate(path);
        if (!error) {
                error = do_truncate(path->dentry, 0,
                                    ATTR_MTIME|ATTR_CTIME|ATTR_OPEN,
@@ -1621,6 +1619,7 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
        case LAST_DOTDOT:
                follow_dotdot(nd);
                dir = nd->path.dentry;
+       case LAST_DOT:
                if (nd->path.mnt->mnt_sb->s_type->fs_flags & FS_REVAL_DOT) {
                        if (!dir->d_op->d_revalidate(dir, nd)) {
                                error = -ESTALE;
@@ -1628,7 +1627,6 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
                        }
                }
                /* fallthrough */
-       case LAST_DOT:
        case LAST_ROOT:
                if (open_flag & O_CREAT)
                        goto exit;