summaryrefslogtreecommitdiffstats
path: root/sys/nfsserver
diff options
context:
space:
mode:
Diffstat (limited to 'sys/nfsserver')
-rw-r--r--sys/nfsserver/nfs_srvsubs.c5
-rw-r--r--sys/nfsserver/nfs_syscalls.c41
2 files changed, 4 insertions, 42 deletions
diff --git a/sys/nfsserver/nfs_srvsubs.c b/sys/nfsserver/nfs_srvsubs.c
index 0ed9e22..7fd9d9d 100644
--- a/sys/nfsserver/nfs_srvsubs.c
+++ b/sys/nfsserver/nfs_srvsubs.c
@@ -1960,7 +1960,10 @@ nfsrv_fhtovp(fhp, lockflag, vpp, cred, slp, nam, rdonlyp, kerbflag, pubflag)
mp = vfs_getvfs(&fhp->fh_fsid);
if (!mp)
return (ESTALE);
- error = VFS_FHTOVP(mp, &fhp->fh_fid, nam, vpp, &exflags, &credanon);
+ error = VFS_CHECKEXP(mp, nam, &exflags, &credanon);
+ if (error)
+ return (error);
+ error = VFS_FHTOVP(mp, &fhp->fh_fid, vpp);
if (error)
return (error);
#ifdef MNT_EXNORESPORT
diff --git a/sys/nfsserver/nfs_syscalls.c b/sys/nfsserver/nfs_syscalls.c
index 210dde6..054950b 100644
--- a/sys/nfsserver/nfs_syscalls.c
+++ b/sys/nfsserver/nfs_syscalls.c
@@ -120,49 +120,8 @@ SYSCTL_INT(_vfs_nfs, OID_AUTO, gatherdelay_v3, CTLFLAG_RW, &nfsrvw_procrastinate
/*
* NFS server system calls
- * getfh() lives here too, but maybe should move to kern/vfs_syscalls.c
*/
-/*
- * Get file handle system call
- */
-#ifndef _SYS_SYSPROTO_H_
-struct getfh_args {
- char *fname;
- fhandle_t *fhp;
-};
-#endif
-int
-getfh(p, uap)
- struct proc *p;
- register struct getfh_args *uap;
-{
- register struct vnode *vp;
- fhandle_t fh;
- int error;
- struct nameidata nd;
-
- /*
- * Must be super user
- */
- error = suser(p);
- if(error)
- return (error);
- NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE, uap->fname, p);
- error = namei(&nd);
- if (error)
- return (error);
- vp = nd.ni_vp;
- bzero((caddr_t)&fh, sizeof(fh));
- fh.fh_fsid = vp->v_mount->mnt_stat.f_fsid;
- error = VFS_VPTOFH(vp, &fh.fh_fid);
- vput(vp);
- if (error)
- return (error);
- error = copyout((caddr_t)&fh, (caddr_t)uap->fhp, sizeof (fh));
- return (error);
-}
-
#endif /* NFS_NOSERVER */
/*
* Nfs server psuedo system call for the nfsd's
OpenPOWER on IntegriCloud