aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfsd')
-rw-r--r--fs/nfsd/nfsctl.c1
-rw-r--r--fs/nfsd/nfsfh.c2
-rw-r--r--fs/nfsd/vfs.c14
3 files changed, 6 insertions, 11 deletions
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index 1955a2702e60..c53e65f8f3a2 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -12,6 +12,7 @@
12#include <linux/time.h> 12#include <linux/time.h>
13#include <linux/errno.h> 13#include <linux/errno.h>
14#include <linux/fs.h> 14#include <linux/fs.h>
15#include <linux/namei.h>
15#include <linux/fcntl.h> 16#include <linux/fcntl.h>
16#include <linux/net.h> 17#include <linux/net.h>
17#include <linux/in.h> 18#include <linux/in.h>
diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c
index f45451eb1e38..ea37c96f0445 100644
--- a/fs/nfsd/nfsfh.c
+++ b/fs/nfsd/nfsfh.c
@@ -51,7 +51,7 @@ static int nfsd_acceptable(void *expv, struct dentry *dentry)
51 /* make sure parents give x permission to user */ 51 /* make sure parents give x permission to user */
52 int err; 52 int err;
53 parent = dget_parent(tdentry); 53 parent = dget_parent(tdentry);
54 err = permission(parent->d_inode, MAY_EXEC, NULL); 54 err = inode_permission(parent->d_inode, MAY_EXEC);
55 if (err < 0) { 55 if (err < 0) {
56 dput(parent); 56 dput(parent);
57 break; 57 break;
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}