diff options
Diffstat (limited to 'fs/nfsd/vfs.c')
-rw-r--r-- | fs/nfsd/vfs.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index 0f4481e0502d..18060bed5267 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c | |||
@@ -1516,7 +1516,6 @@ nfsd_symlink(struct svc_rqst *rqstp, struct svc_fh *fhp, | |||
1516 | struct dentry *dentry, *dnew; | 1516 | struct dentry *dentry, *dnew; |
1517 | __be32 err, cerr; | 1517 | __be32 err, cerr; |
1518 | int host_err; | 1518 | int host_err; |
1519 | umode_t mode; | ||
1520 | 1519 | ||
1521 | err = nfserr_noent; | 1520 | err = nfserr_noent; |
1522 | if (!flen || !plen) | 1521 | if (!flen || !plen) |
@@ -1535,11 +1534,6 @@ nfsd_symlink(struct svc_rqst *rqstp, struct svc_fh *fhp, | |||
1535 | if (IS_ERR(dnew)) | 1534 | if (IS_ERR(dnew)) |
1536 | goto out_nfserr; | 1535 | goto out_nfserr; |
1537 | 1536 | ||
1538 | mode = S_IALLUGO; | ||
1539 | /* Only the MODE ATTRibute is even vaguely meaningful */ | ||
1540 | if (iap && (iap->ia_valid & ATTR_MODE)) | ||
1541 | mode = iap->ia_mode & S_IALLUGO; | ||
1542 | |||
1543 | host_err = mnt_want_write(fhp->fh_export->ex_path.mnt); | 1537 | host_err = mnt_want_write(fhp->fh_export->ex_path.mnt); |
1544 | if (host_err) | 1538 | if (host_err) |
1545 | goto out_nfserr; | 1539 | goto out_nfserr; |
@@ -1551,11 +1545,11 @@ nfsd_symlink(struct svc_rqst *rqstp, struct svc_fh *fhp, | |||
1551 | else { | 1545 | else { |
1552 | strncpy(path_alloced, path, plen); | 1546 | strncpy(path_alloced, path, plen); |
1553 | path_alloced[plen] = 0; | 1547 | path_alloced[plen] = 0; |
1554 | host_err = vfs_symlink(dentry->d_inode, dnew, path_alloced, mode); | 1548 | host_err = vfs_symlink(dentry->d_inode, dnew, path_alloced); |
1555 | kfree(path_alloced); | 1549 | kfree(path_alloced); |
1556 | } | 1550 | } |
1557 | } else | 1551 | } else |
1558 | host_err = vfs_symlink(dentry->d_inode, dnew, path, mode); | 1552 | host_err = vfs_symlink(dentry->d_inode, dnew, path); |
1559 | 1553 | ||
1560 | if (!host_err) { | 1554 | if (!host_err) { |
1561 | if (EX_ISSYNC(fhp->fh_export)) | 1555 | if (EX_ISSYNC(fhp->fh_export)) |
@@ -1959,12 +1953,12 @@ nfsd_permission(struct svc_rqst *rqstp, struct svc_export *exp, | |||
1959 | return 0; | 1953 | return 0; |
1960 | 1954 | ||
1961 | /* This assumes NFSD_MAY_{READ,WRITE,EXEC} == MAY_{READ,WRITE,EXEC} */ | 1955 | /* This assumes NFSD_MAY_{READ,WRITE,EXEC} == MAY_{READ,WRITE,EXEC} */ |
1962 | err = permission(inode, acc & (MAY_READ|MAY_WRITE|MAY_EXEC), NULL); | 1956 | err = inode_permission(inode, acc & (MAY_READ|MAY_WRITE|MAY_EXEC)); |
1963 | 1957 | ||
1964 | /* Allow read access to binaries even when mode 111 */ | 1958 | /* Allow read access to binaries even when mode 111 */ |
1965 | if (err == -EACCES && S_ISREG(inode->i_mode) && | 1959 | if (err == -EACCES && S_ISREG(inode->i_mode) && |
1966 | acc == (NFSD_MAY_READ | NFSD_MAY_OWNER_OVERRIDE)) | 1960 | acc == (NFSD_MAY_READ | NFSD_MAY_OWNER_OVERRIDE)) |
1967 | err = permission(inode, MAY_EXEC, NULL); | 1961 | err = inode_permission(inode, MAY_EXEC); |
1968 | 1962 | ||
1969 | return err? nfserrno(err) : 0; | 1963 | return err? nfserrno(err) : 0; |
1970 | } | 1964 | } |