diff options
author | attilio <attilio@FreeBSD.org> | 2013-03-02 14:48:41 +0000 |
---|---|---|
committer | attilio <attilio@FreeBSD.org> | 2013-03-02 14:48:41 +0000 |
commit | e98f58faf63a90d85e0e2ad78353915f9615a4eb (patch) | |
tree | b9feaa4bea034f2e9d11c7eb34aa95c672a3a86b /sys/fs/nfsserver | |
parent | bcc31f462ba76b89e3789cb24393126466e3775d (diff) | |
parent | 5d33901b24a0ca4496b12ca2299df4b62dfdfd35 (diff) | |
download | FreeBSD-src-e98f58faf63a90d85e0e2ad78353915f9615a4eb.zip FreeBSD-src-e98f58faf63a90d85e0e2ad78353915f9615a4eb.tar.gz |
MFC
Diffstat (limited to 'sys/fs/nfsserver')
-rw-r--r-- | sys/fs/nfsserver/nfs_nfsdport.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index 7f98201..d5cc979 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -2767,7 +2767,7 @@ out: /* * glue for fp. */ -int +static int fp_getfvp(struct thread *p, int fd, struct file **fpp, struct vnode **vpp) { struct filedesc *fdp; @@ -2775,8 +2775,8 @@ fp_getfvp(struct thread *p, int fd, struct file **fpp, struct vnode **vpp) int error = 0; fdp = p->td_proc->p_fd; - if (fd >= fdp->fd_nfiles || - (fp = fdp->fd_ofiles[fd]) == NULL) { + if (fd < 0 || fd >= fdp->fd_nfiles || + (fp = fdp->fd_ofiles[fd].fde_file) == NULL) { error = EBADF; goto out; } @@ -3041,7 +3041,7 @@ nfssvc_nfsd(struct thread *td, struct nfssvc_args *uap) * pretend that we need them all. It is better to be too * careful than too reckless. */ - if ((error = fget(td, sockarg.sock, CAP_SOCK_ALL, &fp)) != 0) + if ((error = fget(td, sockarg.sock, CAP_SOCK_SERVER, &fp)) != 0) goto out; if (fp->f_type != DTYPE_SOCKET) { fdrop(fp, td); |