1/*- 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Rick Macklem at The University of Guelph. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 18 unchanged lines hidden (view full) --- 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * 32 */ 33 34#include <sys/cdefs.h> |
35__FBSDID("$FreeBSD: head/sys/fs/nfsserver/nfs_nfsdport.c 241896 2012-10-22 17:50:54Z kib $"); |
36 37#include <sys/capability.h> 38 39/* 40 * Functions that perform the vfs operations required by the routines in 41 * nfsd_serv.c. It is hoped that this change will make the server more 42 * portable. 43 */ --- 2011 unchanged lines hidden (view full) --- 2055 LK_RETRY; 2056 cn.cn_cred = 2057 nd->nd_cred; 2058 cn.cn_thread = p; 2059 } 2060 cn.cn_nameptr = dp->d_name; 2061 cn.cn_namelen = nlen; 2062 cn.cn_flags = ISLASTCN | |
2063 NOFOLLOW | LOCKLEAF; |
2064 if (nlen == 2 && 2065 dp->d_name[0] == '.' && 2066 dp->d_name[1] == '.') 2067 cn.cn_flags |= 2068 ISDOTDOT; 2069 if (NFSVOPLOCK(vp, LK_SHARED) 2070 != 0) { 2071 nd->nd_repstat = EPERM; --- 569 unchanged lines hidden (view full) --- 2641nfsvno_fhtovp(struct mount *mp, fhandle_t *fhp, struct sockaddr *nam, 2642 int lktype, struct vnode **vpp, struct nfsexstuff *exp, 2643 struct ucred **credp) 2644{ 2645 int i, error, *secflavors; 2646 2647 *credp = NULL; 2648 exp->nes_numsecflavor = 0; |
2649 error = VFS_FHTOVP(mp, &fhp->fh_fid, lktype, vpp); |
2650 if (error != 0) 2651 /* Make sure the server replies ESTALE to the client. */ 2652 error = ESTALE; 2653 if (nam && !error) { 2654 error = VFS_CHECKEXP(mp, nam, &exp->nes_exflag, credp, 2655 &exp->nes_numsecflavor, &secflavors); 2656 if (error) { 2657 if (nfs_rootfhset) { --- 158 unchanged lines hidden (view full) --- 2816 else if (error == 0) { 2817 if (nfsexargp->fspec == NULL) { 2818 error = EPERM; 2819 goto out; 2820 } 2821 /* 2822 * If fspec != NULL, this is the v4root path. 2823 */ |
2824 NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, |
2825 nfsexargp->fspec, p); 2826 if ((error = namei(&nd)) != 0) 2827 goto out; 2828 error = nfsvno_getfh(nd.ni_vp, &fh, p); 2829 vrele(nd.ni_vp); 2830 if (!error) { 2831 nfs_rootfh.nfsrvfh_len = NFSX_MYFH; 2832 NFSBCOPY((caddr_t)&fh, --- 536 unchanged lines hidden --- |