int xfs_fhtovp(struct mount * mp, struct fid * fhp, struct mbuf * nam, struct vnode ** vpp, int *exflagsp, struct ucred ** credanonp) { static struct ucred fhtovpcred; int error; /* XXX: Should see if we is exported to this client */ #if 0 np = vfs_export_lookup(mp, &ump->um_export, nam); if (np == NULL) return EACCES; #endif error = common_fhtovp(mp, fhp, vpp); if (error == 0) { fhtovpcred.cr_uid = 0; fhtovpcred.cr_gid = 0; fhtovpcred.cr_ngroups = 0; #ifdef MNT_EXPUBLIC *exflagsp = MNT_EXPUBLIC; #else *exflagsp = 0; #endif *credanonp = &fhtovpcred; } return error; }
/* * Verify a remote client has export rights and return these rights via. * exflagsp and credanonp. */ int ufs_check_export(struct mount *mp, struct mbuf *nam, int *exflagsp, struct ucred **credanonp) { struct netcred *np; struct ufsmount *ump = VFSTOUFS(mp); /* * Get the export permission structure for this <mp, client> tuple. */ np = vfs_export_lookup(mp, &ump->um_export, nam); if (np == NULL) return (EACCES); *exflagsp = np->netc_exflags; *credanonp = &np->netc_anon; return (0); }
/* * Verify a remote client has export rights and return these rights via. * exflagsp and credanonp. */ static int ntfs_checkexp(struct mount *mp, struct sockaddr *nam, int *exflagsp, struct ucred **credanonp) { struct netcred *np; struct ntfsmount *ntm = VFSTONTFS(mp); /* * Get the export permission structure for this <mp, client> tuple. */ np = vfs_export_lookup(mp, &ntm->ntm_export, nam); if (np == NULL) return (EACCES); *exflagsp = np->netc_exflags; *credanonp = &np->netc_anon; return (0); }
int xfs_checkexp (struct mount *mp, #ifdef __FreeBSD__ struct sockaddr *nam, #else struct mbuf *nam, #endif int *exflagsp, struct ucred **credanonp) { NNPFSDEB(XDEBVFOPS, ("xfs_checkexp\n")); #if 0 np = vfs_export_lookup(mp, &ump->um_export, nam); if (np == NULL) return EACCES; #endif return 0; }
int vfs_stdcheckexp(struct mount *mp, struct sockaddr *nam, int *extflagsp, struct ucred **credanonp, int *numsecflavors, int **secflavors) { struct netcred *np; lockmgr(&mp->mnt_explock, LK_SHARED, NULL); np = vfs_export_lookup(mp, nam); if (np == NULL) { lockmgr(&mp->mnt_explock, LK_RELEASE, NULL); *credanonp = NULL; return (EACCES); } *extflagsp = np->netc_exflags; if ((*credanonp = np->netc_anon) != NULL) crhold(*credanonp); if (numsecflavors) *numsecflavors = np->netc_numsecflavors; if (secflavors) *secflavors = np->netc_secflavors; lockmgr(&mp->mnt_explock, LK_RELEASE, NULL); return (0); }