Commit 7e40145e authored by Al Viro's avatar Al Viro

->permission() sanitizing: don't pass flags to ->check_acl()

not used in the instances anymore.
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 9c2c7039
...@@ -52,7 +52,7 @@ ata *); ...@@ -52,7 +52,7 @@ ata *);
void (*put_link) (struct dentry *, struct nameidata *, void *); void (*put_link) (struct dentry *, struct nameidata *, void *);
void (*truncate) (struct inode *); void (*truncate) (struct inode *);
int (*permission) (struct inode *, int, unsigned int); int (*permission) (struct inode *, int, unsigned int);
int (*check_acl)(struct inode *, int, unsigned int); int (*check_acl)(struct inode *, int);
int (*setattr) (struct dentry *, struct iattr *); int (*setattr) (struct dentry *, struct iattr *);
int (*getattr) (struct vfsmount *, struct dentry *, struct kstat *); int (*getattr) (struct vfsmount *, struct dentry *, struct kstat *);
int (*setxattr) (struct dentry *, const char *,const void *,size_t,int); int (*setxattr) (struct dentry *, const char *,const void *,size_t,int);
......
...@@ -334,7 +334,7 @@ struct inode_operations { ...@@ -334,7 +334,7 @@ struct inode_operations {
void (*put_link) (struct dentry *, struct nameidata *, void *); void (*put_link) (struct dentry *, struct nameidata *, void *);
void (*truncate) (struct inode *); void (*truncate) (struct inode *);
int (*permission) (struct inode *, int, unsigned int); int (*permission) (struct inode *, int, unsigned int);
int (*check_acl)(struct inode *, int, unsigned int); int (*check_acl)(struct inode *, int);
int (*setattr) (struct dentry *, struct iattr *); int (*setattr) (struct dentry *, struct iattr *);
int (*getattr) (struct vfsmount *mnt, struct dentry *, struct kstat *); int (*getattr) (struct vfsmount *mnt, struct dentry *, struct kstat *);
int (*setxattr) (struct dentry *, const char *,const void *,size_t,int); int (*setxattr) (struct dentry *, const char *,const void *,size_t,int);
......
...@@ -96,7 +96,7 @@ static struct posix_acl *v9fs_get_cached_acl(struct inode *inode, int type) ...@@ -96,7 +96,7 @@ static struct posix_acl *v9fs_get_cached_acl(struct inode *inode, int type)
return acl; return acl;
} }
int v9fs_check_acl(struct inode *inode, int mask, unsigned int flags) int v9fs_check_acl(struct inode *inode, int mask)
{ {
struct posix_acl *acl; struct posix_acl *acl;
struct v9fs_session_info *v9ses; struct v9fs_session_info *v9ses;
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#ifdef CONFIG_9P_FS_POSIX_ACL #ifdef CONFIG_9P_FS_POSIX_ACL
extern int v9fs_get_acl(struct inode *, struct p9_fid *); extern int v9fs_get_acl(struct inode *, struct p9_fid *);
extern int v9fs_check_acl(struct inode *inode, int mask, unsigned int flags); extern int v9fs_check_acl(struct inode *inode, int mask);
extern int v9fs_acl_chmod(struct dentry *); extern int v9fs_acl_chmod(struct dentry *);
extern int v9fs_set_create_acl(struct dentry *, extern int v9fs_set_create_acl(struct dentry *,
struct posix_acl *, struct posix_acl *); struct posix_acl *, struct posix_acl *);
......
...@@ -195,7 +195,7 @@ static int btrfs_xattr_acl_set(struct dentry *dentry, const char *name, ...@@ -195,7 +195,7 @@ static int btrfs_xattr_acl_set(struct dentry *dentry, const char *name,
return ret; return ret;
} }
int btrfs_check_acl(struct inode *inode, int mask, unsigned int flags) int btrfs_check_acl(struct inode *inode, int mask)
{ {
int error = -EAGAIN; int error = -EAGAIN;
......
...@@ -2642,7 +2642,7 @@ do { \ ...@@ -2642,7 +2642,7 @@ do { \
/* acl.c */ /* acl.c */
#ifdef CONFIG_BTRFS_FS_POSIX_ACL #ifdef CONFIG_BTRFS_FS_POSIX_ACL
int btrfs_check_acl(struct inode *inode, int mask, unsigned int flags); int btrfs_check_acl(struct inode *inode, int mask);
#else #else
#define btrfs_check_acl NULL #define btrfs_check_acl NULL
#endif #endif
......
...@@ -232,7 +232,7 @@ ext2_set_acl(struct inode *inode, int type, struct posix_acl *acl) ...@@ -232,7 +232,7 @@ ext2_set_acl(struct inode *inode, int type, struct posix_acl *acl)
} }
int int
ext2_check_acl(struct inode *inode, int mask, unsigned int flags) ext2_check_acl(struct inode *inode, int mask)
{ {
struct posix_acl *acl; struct posix_acl *acl;
......
...@@ -54,7 +54,7 @@ static inline int ext2_acl_count(size_t size) ...@@ -54,7 +54,7 @@ static inline int ext2_acl_count(size_t size)
#ifdef CONFIG_EXT2_FS_POSIX_ACL #ifdef CONFIG_EXT2_FS_POSIX_ACL
/* acl.c */ /* acl.c */
extern int ext2_check_acl (struct inode *, int, unsigned int); extern int ext2_check_acl (struct inode *, int);
extern int ext2_acl_chmod (struct inode *); extern int ext2_acl_chmod (struct inode *);
extern int ext2_init_acl (struct inode *, struct inode *); extern int ext2_init_acl (struct inode *, struct inode *);
......
...@@ -240,7 +240,7 @@ ext3_set_acl(handle_t *handle, struct inode *inode, int type, ...@@ -240,7 +240,7 @@ ext3_set_acl(handle_t *handle, struct inode *inode, int type,
} }
int int
ext3_check_acl(struct inode *inode, int mask, unsigned int flags) ext3_check_acl(struct inode *inode, int mask)
{ {
struct posix_acl *acl; struct posix_acl *acl;
......
...@@ -54,7 +54,7 @@ static inline int ext3_acl_count(size_t size) ...@@ -54,7 +54,7 @@ static inline int ext3_acl_count(size_t size)
#ifdef CONFIG_EXT3_FS_POSIX_ACL #ifdef CONFIG_EXT3_FS_POSIX_ACL
/* acl.c */ /* acl.c */
extern int ext3_check_acl (struct inode *, int, unsigned int); extern int ext3_check_acl (struct inode *, int);
extern int ext3_acl_chmod (struct inode *); extern int ext3_acl_chmod (struct inode *);
extern int ext3_init_acl (handle_t *, struct inode *, struct inode *); extern int ext3_init_acl (handle_t *, struct inode *, struct inode *);
......
...@@ -238,7 +238,7 @@ ext4_set_acl(handle_t *handle, struct inode *inode, int type, ...@@ -238,7 +238,7 @@ ext4_set_acl(handle_t *handle, struct inode *inode, int type,
} }
int int
ext4_check_acl(struct inode *inode, int mask, unsigned int flags) ext4_check_acl(struct inode *inode, int mask)
{ {
struct posix_acl *acl; struct posix_acl *acl;
......
...@@ -54,7 +54,7 @@ static inline int ext4_acl_count(size_t size) ...@@ -54,7 +54,7 @@ static inline int ext4_acl_count(size_t size)
#ifdef CONFIG_EXT4_FS_POSIX_ACL #ifdef CONFIG_EXT4_FS_POSIX_ACL
/* acl.c */ /* acl.c */
extern int ext4_check_acl(struct inode *, int, unsigned int); extern int ext4_check_acl(struct inode *, int);
extern int ext4_acl_chmod(struct inode *); extern int ext4_acl_chmod(struct inode *);
extern int ext4_init_acl(handle_t *, struct inode *, struct inode *); extern int ext4_init_acl(handle_t *, struct inode *, struct inode *);
......
...@@ -190,7 +190,7 @@ generic_acl_chmod(struct inode *inode) ...@@ -190,7 +190,7 @@ generic_acl_chmod(struct inode *inode)
} }
int int
generic_check_acl(struct inode *inode, int mask, unsigned int flags) generic_check_acl(struct inode *inode, int mask)
{ {
if (mask & MAY_NOT_BLOCK) { if (mask & MAY_NOT_BLOCK) {
if (!negative_cached_acl(inode, ACL_TYPE_ACCESS)) if (!negative_cached_acl(inode, ACL_TYPE_ACCESS))
......
...@@ -75,7 +75,7 @@ static struct posix_acl *gfs2_acl_get(struct gfs2_inode *ip, int type) ...@@ -75,7 +75,7 @@ static struct posix_acl *gfs2_acl_get(struct gfs2_inode *ip, int type)
* Returns: errno * Returns: errno
*/ */
int gfs2_check_acl(struct inode *inode, int mask, unsigned int flags) int gfs2_check_acl(struct inode *inode, int mask)
{ {
struct posix_acl *acl; struct posix_acl *acl;
int error; int error;
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#define GFS2_POSIX_ACL_DEFAULT "posix_acl_default" #define GFS2_POSIX_ACL_DEFAULT "posix_acl_default"
#define GFS2_ACL_MAX_ENTRIES 25 #define GFS2_ACL_MAX_ENTRIES 25
extern int gfs2_check_acl(struct inode *inode, int mask, unsigned int); extern int gfs2_check_acl(struct inode *inode, int mask);
extern int gfs2_acl_create(struct gfs2_inode *dip, struct inode *inode); extern int gfs2_acl_create(struct gfs2_inode *dip, struct inode *inode);
extern int gfs2_acl_chmod(struct gfs2_inode *ip, struct iattr *attr); extern int gfs2_acl_chmod(struct gfs2_inode *ip, struct iattr *attr);
extern const struct xattr_handler gfs2_xattr_system_handler; extern const struct xattr_handler gfs2_xattr_system_handler;
......
...@@ -259,7 +259,7 @@ static int jffs2_set_acl(struct inode *inode, int type, struct posix_acl *acl) ...@@ -259,7 +259,7 @@ static int jffs2_set_acl(struct inode *inode, int type, struct posix_acl *acl)
return rc; return rc;
} }
int jffs2_check_acl(struct inode *inode, int mask, unsigned int flags) int jffs2_check_acl(struct inode *inode, int mask)
{ {
struct posix_acl *acl; struct posix_acl *acl;
int rc; int rc;
......
...@@ -26,7 +26,7 @@ struct jffs2_acl_header { ...@@ -26,7 +26,7 @@ struct jffs2_acl_header {
#ifdef CONFIG_JFFS2_FS_POSIX_ACL #ifdef CONFIG_JFFS2_FS_POSIX_ACL
extern int jffs2_check_acl(struct inode *, int, unsigned int); extern int jffs2_check_acl(struct inode *, int);
extern int jffs2_acl_chmod(struct inode *); extern int jffs2_acl_chmod(struct inode *);
extern int jffs2_init_acl_pre(struct inode *, struct inode *, int *); extern int jffs2_init_acl_pre(struct inode *, struct inode *, int *);
extern int jffs2_init_acl_post(struct inode *); extern int jffs2_init_acl_post(struct inode *);
......
...@@ -114,7 +114,7 @@ static int jfs_set_acl(tid_t tid, struct inode *inode, int type, ...@@ -114,7 +114,7 @@ static int jfs_set_acl(tid_t tid, struct inode *inode, int type,
return rc; return rc;
} }
int jfs_check_acl(struct inode *inode, int mask, unsigned int flags) int jfs_check_acl(struct inode *inode, int mask)
{ {
struct posix_acl *acl; struct posix_acl *acl;
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#ifdef CONFIG_JFS_POSIX_ACL #ifdef CONFIG_JFS_POSIX_ACL
int jfs_check_acl(struct inode *, int, unsigned int flags); int jfs_check_acl(struct inode *, int);
int jfs_init_acl(tid_t, struct inode *, struct inode *); int jfs_init_acl(tid_t, struct inode *, struct inode *);
int jfs_acl_chmod(struct inode *inode); int jfs_acl_chmod(struct inode *inode);
......
...@@ -176,9 +176,9 @@ EXPORT_SYMBOL(putname); ...@@ -176,9 +176,9 @@ EXPORT_SYMBOL(putname);
/* /*
* This does basic POSIX ACL permission checking * This does basic POSIX ACL permission checking
*/ */
static int acl_permission_check(struct inode *inode, int mask, unsigned int flags) static int acl_permission_check(struct inode *inode, int mask)
{ {
int (*check_acl)(struct inode *inode, int mask, unsigned int flags); int (*check_acl)(struct inode *inode, int mask);
unsigned int mode = inode->i_mode; unsigned int mode = inode->i_mode;
mask &= MAY_READ | MAY_WRITE | MAY_EXEC | MAY_NOT_BLOCK; mask &= MAY_READ | MAY_WRITE | MAY_EXEC | MAY_NOT_BLOCK;
...@@ -191,7 +191,7 @@ static int acl_permission_check(struct inode *inode, int mask, unsigned int flag ...@@ -191,7 +191,7 @@ static int acl_permission_check(struct inode *inode, int mask, unsigned int flag
else { else {
check_acl = inode->i_op->check_acl; check_acl = inode->i_op->check_acl;
if (IS_POSIXACL(inode) && (mode & S_IRWXG) && check_acl) { if (IS_POSIXACL(inode) && (mode & S_IRWXG) && check_acl) {
int error = check_acl(inode, mask, flags); int error = check_acl(inode, mask);
if (error != -EAGAIN) if (error != -EAGAIN)
return error; return error;
} }
...@@ -231,7 +231,7 @@ int generic_permission(struct inode *inode, int mask, unsigned int flags) ...@@ -231,7 +231,7 @@ int generic_permission(struct inode *inode, int mask, unsigned int flags)
/* /*
* Do the basic POSIX ACL permission checks. * Do the basic POSIX ACL permission checks.
*/ */
ret = acl_permission_check(inode, mask, flags); ret = acl_permission_check(inode, mask);
if (ret != -EACCES) if (ret != -EACCES)
return ret; return ret;
...@@ -327,7 +327,7 @@ static inline int exec_permission(struct inode *inode, unsigned int flags) ...@@ -327,7 +327,7 @@ static inline int exec_permission(struct inode *inode, unsigned int flags)
if (likely(!ret)) if (likely(!ret))
goto ok; goto ok;
} else { } else {
ret = acl_permission_check(inode, mask, flags); ret = acl_permission_check(inode, mask);
if (likely(!ret)) if (likely(!ret))
goto ok; goto ok;
if (ret != -EACCES) if (ret != -EACCES)
......
...@@ -290,7 +290,7 @@ static int ocfs2_set_acl(handle_t *handle, ...@@ -290,7 +290,7 @@ static int ocfs2_set_acl(handle_t *handle,
return ret; return ret;
} }
int ocfs2_check_acl(struct inode *inode, int mask, unsigned int flags) int ocfs2_check_acl(struct inode *inode, int mask)
{ {
struct ocfs2_super *osb; struct ocfs2_super *osb;
struct buffer_head *di_bh = NULL; struct buffer_head *di_bh = NULL;
......
...@@ -26,7 +26,7 @@ struct ocfs2_acl_entry { ...@@ -26,7 +26,7 @@ struct ocfs2_acl_entry {
__le32 e_id; __le32 e_id;
}; };
extern int ocfs2_check_acl(struct inode *, int, unsigned int); extern int ocfs2_check_acl(struct inode *, int);
extern int ocfs2_acl_chmod(struct inode *); extern int ocfs2_acl_chmod(struct inode *);
extern int ocfs2_init_acl(handle_t *, struct inode *, struct inode *, extern int ocfs2_init_acl(handle_t *, struct inode *, struct inode *,
struct buffer_head *, struct buffer_head *, struct buffer_head *, struct buffer_head *,
......
...@@ -868,7 +868,7 @@ ssize_t reiserfs_listxattr(struct dentry * dentry, char *buffer, size_t size) ...@@ -868,7 +868,7 @@ ssize_t reiserfs_listxattr(struct dentry * dentry, char *buffer, size_t size)
return err; return err;
} }
int reiserfs_check_acl(struct inode *inode, int mask, unsigned int flags) int reiserfs_check_acl(struct inode *inode, int mask)
{ {
struct posix_acl *acl; struct posix_acl *acl;
int error = -EAGAIN; /* do regular unix permission checks by default */ int error = -EAGAIN; /* do regular unix permission checks by default */
......
...@@ -219,7 +219,7 @@ xfs_set_acl(struct inode *inode, int type, struct posix_acl *acl) ...@@ -219,7 +219,7 @@ xfs_set_acl(struct inode *inode, int type, struct posix_acl *acl)
} }
int int
xfs_check_acl(struct inode *inode, int mask, unsigned int flags) xfs_check_acl(struct inode *inode, int mask)
{ {
struct xfs_inode *ip; struct xfs_inode *ip;
struct posix_acl *acl; struct posix_acl *acl;
......
...@@ -42,7 +42,7 @@ struct xfs_acl { ...@@ -42,7 +42,7 @@ struct xfs_acl {
#define SGI_ACL_DEFAULT_SIZE (sizeof(SGI_ACL_DEFAULT)-1) #define SGI_ACL_DEFAULT_SIZE (sizeof(SGI_ACL_DEFAULT)-1)
#ifdef CONFIG_XFS_POSIX_ACL #ifdef CONFIG_XFS_POSIX_ACL
extern int xfs_check_acl(struct inode *inode, int mask, unsigned int flags); extern int xfs_check_acl(struct inode *inode, int mask);
extern struct posix_acl *xfs_get_acl(struct inode *inode, int type); extern struct posix_acl *xfs_get_acl(struct inode *inode, int type);
extern int xfs_inherit_acl(struct inode *inode, struct posix_acl *default_acl); extern int xfs_inherit_acl(struct inode *inode, struct posix_acl *default_acl);
extern int xfs_acl_chmod(struct inode *inode); extern int xfs_acl_chmod(struct inode *inode);
......
...@@ -1579,7 +1579,7 @@ struct inode_operations { ...@@ -1579,7 +1579,7 @@ struct inode_operations {
struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *); struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *);
void * (*follow_link) (struct dentry *, struct nameidata *); void * (*follow_link) (struct dentry *, struct nameidata *);
int (*permission) (struct inode *, int, unsigned int); int (*permission) (struct inode *, int, unsigned int);
int (*check_acl)(struct inode *, int, unsigned int); int (*check_acl)(struct inode *, int);
int (*readlink) (struct dentry *, char __user *,int); int (*readlink) (struct dentry *, char __user *,int);
void (*put_link) (struct dentry *, struct nameidata *, void *); void (*put_link) (struct dentry *, struct nameidata *, void *);
......
...@@ -10,6 +10,6 @@ extern const struct xattr_handler generic_acl_default_handler; ...@@ -10,6 +10,6 @@ extern const struct xattr_handler generic_acl_default_handler;
int generic_acl_init(struct inode *, struct inode *); int generic_acl_init(struct inode *, struct inode *);
int generic_acl_chmod(struct inode *); int generic_acl_chmod(struct inode *);
int generic_check_acl(struct inode *inode, int mask, unsigned int flags); int generic_check_acl(struct inode *inode, int mask);
#endif /* LINUX_GENERIC_ACL_H */ #endif /* LINUX_GENERIC_ACL_H */
...@@ -45,7 +45,7 @@ int reiserfs_permission(struct inode *inode, int mask, unsigned int flags); ...@@ -45,7 +45,7 @@ int reiserfs_permission(struct inode *inode, int mask, unsigned int flags);
#ifdef CONFIG_REISERFS_FS_XATTR #ifdef CONFIG_REISERFS_FS_XATTR
#define has_xattr_dir(inode) (REISERFS_I(inode)->i_flags & i_has_xattr_dir) #define has_xattr_dir(inode) (REISERFS_I(inode)->i_flags & i_has_xattr_dir)
int reiserfs_check_acl(struct inode *inode, int mask, unsigned int flags); int reiserfs_check_acl(struct inode *inode, int mask);
ssize_t reiserfs_getxattr(struct dentry *dentry, const char *name, ssize_t reiserfs_getxattr(struct dentry *dentry, const char *name,
void *buffer, size_t size); void *buffer, size_t size);
int reiserfs_setxattr(struct dentry *dentry, const char *name, int reiserfs_setxattr(struct dentry *dentry, const char *name,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment