summaryrefslogtreecommitdiffstats
path: root/sys/isofs
diff options
context:
space:
mode:
authoralfred <alfred@FreeBSD.org>1999-09-11 00:46:08 +0000
committeralfred <alfred@FreeBSD.org>1999-09-11 00:46:08 +0000
commitb9136a6115cbac97ab114f16b1aacf4eb20ad2c1 (patch)
tree783daf81f8570ef14570d4a5a6fc45f15ec1cbf5 /sys/isofs
parenta9f7b5ee698afe56d1167bfa395f23b1fff1730c (diff)
downloadFreeBSD-src-b9136a6115cbac97ab114f16b1aacf4eb20ad2c1.zip
FreeBSD-src-b9136a6115cbac97ab114f16b1aacf4eb20ad2c1.tar.gz
Seperate the export check in VFS_FHTOVP, exports are now checked via
VFS_CHECKEXP. Add fh(open|stat|stafs) syscalls to allow userland to query filesystems based on (network) filehandle. Obtained from: NetBSD
Diffstat (limited to 'sys/isofs')
-rw-r--r--sys/isofs/cd9660/cd9660_vfsops.c42
1 files changed, 27 insertions, 15 deletions
diff --git a/sys/isofs/cd9660/cd9660_vfsops.c b/sys/isofs/cd9660/cd9660_vfsops.c
index f81cb14..050e99e 100644
--- a/sys/isofs/cd9660/cd9660_vfsops.c
+++ b/sys/isofs/cd9660/cd9660_vfsops.c
@@ -68,8 +68,9 @@ static int cd9660_unmount __P((struct mount *, int, struct proc *));
static int cd9660_root __P((struct mount *, struct vnode **));
static int cd9660_statfs __P((struct mount *, struct statfs *, struct proc *));
static int cd9660_vget __P((struct mount *, ino_t, struct vnode **));
-static int cd9660_fhtovp __P((struct mount *, struct fid *, struct sockaddr *,
- struct vnode **, int *, struct ucred **));
+static int cd9660_fhtovp __P((struct mount *, struct fid *, struct vnode **));
+static int cd9660_checkexp __P((struct mount *, struct sockaddr *,
+ int *, struct ucred **));
static int cd9660_vptofh __P((struct vnode *, struct fid *));
static struct vfsops cd9660_vfsops = {
@@ -82,6 +83,7 @@ static struct vfsops cd9660_vfsops = {
vfs_stdsync,
cd9660_vget,
cd9660_fhtovp,
+ cd9660_checkexp,
cd9660_vptofh,
cd9660_init,
};
@@ -620,18 +622,13 @@ struct ifid {
/* ARGSUSED */
int
-cd9660_fhtovp(mp, fhp, nam, vpp, exflagsp, credanonp)
+cd9660_fhtovp(mp, fhp, vpp)
register struct mount *mp;
struct fid *fhp;
- struct sockaddr *nam;
struct vnode **vpp;
- int *exflagsp;
- struct ucred **credanonp;
{
struct ifid *ifhp = (struct ifid *)fhp;
register struct iso_node *ip;
- register struct netcred *np;
- register struct iso_mnt *imp = VFSTOISOFS(mp);
struct vnode *nvp;
int error;
@@ -640,13 +637,6 @@ cd9660_fhtovp(mp, fhp, nam, vpp, exflagsp, credanonp)
ifhp->ifid_ino, ifhp->ifid_start);
#endif
- /*
- * Get the export permission structure for this <mp, client> tuple.
- */
- np = vfs_export_lookup(mp, &imp->im_export, nam);
- if (np == NULL)
- return (EACCES);
-
if ((error = VFS_VGET(mp, ifhp->ifid_ino, &nvp)) != 0) {
*vpp = NULLVP;
return (error);
@@ -658,6 +648,28 @@ cd9660_fhtovp(mp, fhp, nam, vpp, exflagsp, credanonp)
return (ESTALE);
}
*vpp = nvp;
+ return (0);
+}
+
+int
+cd9660_checkexp(mp, nam, exflagsp, credanonp)
+ struct mount *mp;
+ struct sockaddr *nam;
+ int *exflagsp;
+ struct ucred **credanonp;
+{
+ register struct netcred *np;
+ register struct iso_mnt *imp;
+
+ imp = VFSTOISOFS(mp);
+
+ /*
+ * Get the export permission structure for this <mp, client> tuple.
+ */
+ np = vfs_export_lookup(mp, &imp->im_export, nam);
+ if (np == NULL)
+ return (EACCES);
+
*exflagsp = np->netc_exflags;
*credanonp = &np->netc_anon;
return (0);
OpenPOWER on IntegriCloud