aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorWeston Andros Adamson <dros@netapp.com>2012-09-10 14:00:46 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-10-01 18:20:11 -0400
commit6168f62cbde8dcf4f58255794efbcdb8df603959 (patch)
tree897bac0b7539172aa171365337d964f7984b1a80 /include/linux
parent57a51048da742c764b6ce5d028c7f334ae04d363 (diff)
NFSv4: Add ACCESS operation to OPEN compound
The OPEN operation has no way to differentiate an open for read and an open for execution - both look like read to the server. This allowed users to read files that didn't have READ access but did have EXEC access, which is obviously wrong. This patch adds an ACCESS call to the OPEN compound to handle the difference between OPENs for reading and execution. Since we're going through the trouble of calling ACCESS, we check all possible access bits and cache the results hopefully avoiding an ACCESS call in the future. Signed-off-by: Weston Andros Adamson <dros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/nfs_fs.h2
-rw-r--r--include/linux/nfs_xdr.h3
2 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 383f3313f053..334a2f5f6bf1 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -360,6 +360,8 @@ extern int nfs_refresh_inode(struct inode *, struct nfs_fattr *);
360extern int nfs_post_op_update_inode(struct inode *inode, struct nfs_fattr *fattr); 360extern int nfs_post_op_update_inode(struct inode *inode, struct nfs_fattr *fattr);
361extern int nfs_post_op_update_inode_force_wcc(struct inode *inode, struct nfs_fattr *fattr); 361extern int nfs_post_op_update_inode_force_wcc(struct inode *inode, struct nfs_fattr *fattr);
362extern int nfs_getattr(struct vfsmount *, struct dentry *, struct kstat *); 362extern int nfs_getattr(struct vfsmount *, struct dentry *, struct kstat *);
363extern void nfs_access_add_cache(struct inode *, struct nfs_access_entry *);
364extern void nfs_access_set_mask(struct nfs_access_entry *, u32);
363extern int nfs_permission(struct inode *, int); 365extern int nfs_permission(struct inode *, int);
364extern int nfs_open(struct inode *, struct file *); 366extern int nfs_open(struct inode *, struct file *);
365extern int nfs_release(struct inode *, struct file *); 367extern int nfs_release(struct inode *, struct file *);
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 5da789fdf25b..655490dae953 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -334,6 +334,7 @@ struct nfs_openargs {
334 struct nfs_seqid * seqid; 334 struct nfs_seqid * seqid;
335 int open_flags; 335 int open_flags;
336 fmode_t fmode; 336 fmode_t fmode;
337 u32 access;
337 __u64 clientid; 338 __u64 clientid;
338 struct stateowner_id id; 339 struct stateowner_id id;
339 union { 340 union {
@@ -368,6 +369,8 @@ struct nfs_openres {
368 struct nfs4_string *owner; 369 struct nfs4_string *owner;
369 struct nfs4_string *group_owner; 370 struct nfs4_string *group_owner;
370 struct nfs4_sequence_res seq_res; 371 struct nfs4_sequence_res seq_res;
372 __u32 access_supported;
373 __u32 access_result;
371}; 374};
372 375
373/* 376/*