Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 39735
b: refs/heads/master
c: dc730e1
h: refs/heads/master
i:
  39733: 4a0f65f
  39731: ae5e8b5
  39727: c3ff6dd
v: v3
  • Loading branch information
J. Bruce Fields authored and Linus Torvalds committed Oct 17, 2006
1 parent 1180206 commit 4955a0d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e956edd0523b6b48ed367c63b0c82d8f4c447a58
refs/heads/master: dc730e173785e29b297aa605786c94adaffe2544
12 changes: 5 additions & 7 deletions trunk/fs/nfsd/nfs4proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,18 @@ fh_dup2(struct svc_fh *dst, struct svc_fh *src)
}

static int
do_open_permission(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_open *open)
do_open_permission(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_open *open, int accmode)
{
int accmode, status;
int status;

if (open->op_truncate &&
!(open->op_share_access & NFS4_SHARE_ACCESS_WRITE))
return nfserr_inval;

accmode = MAY_NOP;
if (open->op_share_access & NFS4_SHARE_ACCESS_READ)
accmode = MAY_READ;
accmode |= MAY_READ;
if (open->op_share_deny & NFS4_SHARE_ACCESS_WRITE)
accmode |= (MAY_WRITE | MAY_TRUNC);
accmode |= MAY_OWNER_OVERRIDE;

status = fh_verify(rqstp, current_fh, S_IFREG, accmode);

Expand Down Expand Up @@ -124,7 +122,7 @@ do_open_lookup(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_o
&resfh.fh_handle.fh_base,
resfh.fh_handle.fh_size);

status = do_open_permission(rqstp, current_fh, open);
status = do_open_permission(rqstp, current_fh, open, MAY_NOP);
}

fh_put(&resfh);
Expand Down Expand Up @@ -155,7 +153,7 @@ do_open_fhandle(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_
open->op_truncate = (open->op_iattr.ia_valid & ATTR_SIZE) &&
(open->op_iattr.ia_size == 0);

status = do_open_permission(rqstp, current_fh, open);
status = do_open_permission(rqstp, current_fh, open, MAY_OWNER_OVERRIDE);

return status;
}
Expand Down

0 comments on commit 4955a0d

Please sign in to comment.