|
@@ -328,7 +328,7 @@ nfsd_setattr(struct svc_rqst *rqstp, struct svc_fh *fhp, struct iattr *iap,
|
|
/* The size case is special. It changes the file as well as the attributes. */
|
|
/* The size case is special. It changes the file as well as the attributes. */
|
|
if (iap->ia_valid & ATTR_SIZE) {
|
|
if (iap->ia_valid & ATTR_SIZE) {
|
|
if (iap->ia_size < inode->i_size) {
|
|
if (iap->ia_size < inode->i_size) {
|
|
- err = nfsd_permission(fhp->fh_export, dentry, MAY_TRUNC|MAY_OWNER_OVERRIDE);
|
|
|
|
|
|
+ err = nfsd_permission(rqstp, fhp->fh_export, dentry, MAY_TRUNC|MAY_OWNER_OVERRIDE);
|
|
if (err)
|
|
if (err)
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
@@ -616,7 +616,7 @@ nfsd_access(struct svc_rqst *rqstp, struct svc_fh *fhp, u32 *access, u32 *suppor
|
|
|
|
|
|
sresult |= map->access;
|
|
sresult |= map->access;
|
|
|
|
|
|
- err2 = nfsd_permission(export, dentry, map->how);
|
|
|
|
|
|
+ err2 = nfsd_permission(rqstp, export, dentry, map->how);
|
|
switch (err2) {
|
|
switch (err2) {
|
|
case nfs_ok:
|
|
case nfs_ok:
|
|
result |= map->access;
|
|
result |= map->access;
|
|
@@ -1043,7 +1043,7 @@ nfsd_read(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
|
|
__be32 err;
|
|
__be32 err;
|
|
|
|
|
|
if (file) {
|
|
if (file) {
|
|
- err = nfsd_permission(fhp->fh_export, fhp->fh_dentry,
|
|
|
|
|
|
+ err = nfsd_permission(rqstp, fhp->fh_export, fhp->fh_dentry,
|
|
MAY_READ|MAY_OWNER_OVERRIDE);
|
|
MAY_READ|MAY_OWNER_OVERRIDE);
|
|
if (err)
|
|
if (err)
|
|
goto out;
|
|
goto out;
|
|
@@ -1072,7 +1072,7 @@ nfsd_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
|
|
__be32 err = 0;
|
|
__be32 err = 0;
|
|
|
|
|
|
if (file) {
|
|
if (file) {
|
|
- err = nfsd_permission(fhp->fh_export, fhp->fh_dentry,
|
|
|
|
|
|
+ err = nfsd_permission(rqstp, fhp->fh_export, fhp->fh_dentry,
|
|
MAY_WRITE|MAY_OWNER_OVERRIDE);
|
|
MAY_WRITE|MAY_OWNER_OVERRIDE);
|
|
if (err)
|
|
if (err)
|
|
goto out;
|
|
goto out;
|
|
@@ -1801,7 +1801,8 @@ nfsd_statfs(struct svc_rqst *rqstp, struct svc_fh *fhp, struct kstatfs *stat)
|
|
* Check for a user's access permissions to this inode.
|
|
* Check for a user's access permissions to this inode.
|
|
*/
|
|
*/
|
|
__be32
|
|
__be32
|
|
-nfsd_permission(struct svc_export *exp, struct dentry *dentry, int acc)
|
|
|
|
|
|
+nfsd_permission(struct svc_rqst *rqstp, struct svc_export *exp,
|
|
|
|
+ struct dentry *dentry, int acc)
|
|
{
|
|
{
|
|
struct inode *inode = dentry->d_inode;
|
|
struct inode *inode = dentry->d_inode;
|
|
int err;
|
|
int err;
|
|
@@ -1832,7 +1833,7 @@ nfsd_permission(struct svc_export *exp, struct dentry *dentry, int acc)
|
|
*/
|
|
*/
|
|
if (!(acc & MAY_LOCAL_ACCESS))
|
|
if (!(acc & MAY_LOCAL_ACCESS))
|
|
if (acc & (MAY_WRITE | MAY_SATTR | MAY_TRUNC)) {
|
|
if (acc & (MAY_WRITE | MAY_SATTR | MAY_TRUNC)) {
|
|
- if (EX_RDONLY(exp) || IS_RDONLY(inode))
|
|
|
|
|
|
+ if (EX_RDONLY(exp, rqstp) || IS_RDONLY(inode))
|
|
return nfserr_rofs;
|
|
return nfserr_rofs;
|
|
if (/* (acc & MAY_WRITE) && */ IS_IMMUTABLE(inode))
|
|
if (/* (acc & MAY_WRITE) && */ IS_IMMUTABLE(inode))
|
|
return nfserr_perm;
|
|
return nfserr_perm;
|