summaryrefslogtreecommitdiff
path: root/sys/nfs
diff options
context:
space:
mode:
authorassar <assar@cvs.openbsd.org>2000-02-07 04:57:20 +0000
committerassar <assar@cvs.openbsd.org>2000-02-07 04:57:20 +0000
commit6f7e6bffc9d5d686eb1bdf9b027266f64db28754 (patch)
tree1b456f9a4be5902545c6b6f0805e173ab4dc3195 /sys/nfs
parent3510e94919e26ce8c81fffcb220fc932c7d4aeb3 (diff)
update to use new checkexp vfs operation
Diffstat (limited to 'sys/nfs')
-rw-r--r--sys/nfs/nfs_subs.c9
-rw-r--r--sys/nfs/nfs_vfsops.c27
-rw-r--r--sys/nfs/nfsmount.h5
3 files changed, 29 insertions, 12 deletions
diff --git a/sys/nfs/nfs_subs.c b/sys/nfs/nfs_subs.c
index f4c6a736892..2c54e7632a6 100644
--- a/sys/nfs/nfs_subs.c
+++ b/sys/nfs/nfs_subs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_subs.c,v 1.27 1999/04/28 09:28:17 art Exp $ */
+/* $OpenBSD: nfs_subs.c,v 1.28 2000/02/07 04:57:17 assar Exp $ */
/* $NetBSD: nfs_subs.c,v 1.27.4.3 1996/07/08 20:34:24 jtc Exp $ */
/*
@@ -1690,7 +1690,7 @@ nfsm_srvfattr(nfsd, vap, fp)
/*
* nfsrv_fhtovp() - convert a fh to a vnode ptr (optionally locked)
* - look up fsid in mount list (if not found ret error)
- * - get vp and export rights by calling VFS_FHTOVP()
+ * - get vp and export rights by calling VFS_FHTOVP() and VFS_CHECKEXP()
* - if cred->cr_uid == 0 or MNT_EXPORTANON set it to credanon
* - if not lockflag unlock it with VOP_UNLOCK()
*/
@@ -1717,7 +1717,10 @@ nfsrv_fhtovp(fhp, lockflag, vpp, cred, slp, nam, rdonlyp, kerbflag)
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);
diff --git a/sys/nfs/nfs_vfsops.c b/sys/nfs/nfs_vfsops.c
index f2761453f5a..4b24082186e 100644
--- a/sys/nfs/nfs_vfsops.c
+++ b/sys/nfs/nfs_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_vfsops.c,v 1.29 2000/01/06 03:35:37 smurph Exp $ */
+/* $OpenBSD: nfs_vfsops.c,v 1.30 2000/02/07 04:57:17 assar Exp $ */
/* $NetBSD: nfs_vfsops.c,v 1.46.4.1 1996/05/25 22:40:35 fvdl Exp $ */
/*
@@ -74,6 +74,9 @@ extern int nfs_ticks;
int nfs_sysctl
__P((int *, u_int, void *, size_t *, void *, size_t, struct proc *));
+int nfs_checkexp
+ __P((struct mount *mp, struct mbuf *nam,
+ int *extflagsp, struct ucred **credanonp));
/*
* nfs vfs operations.
@@ -90,7 +93,8 @@ struct vfsops nfs_vfsops = {
nfs_fhtovp,
nfs_vptofh,
nfs_vfs_init,
- nfs_sysctl
+ nfs_sysctl,
+ nfs_checkexp
};
extern u_int32_t nfs_procids[NFS_NPROCS];
@@ -967,13 +971,10 @@ nfs_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp,
*/
/* ARGSUSED */
int
-nfs_fhtovp(mp, fhp, nam, vpp, exflagsp, credanonp)
+nfs_fhtovp(mp, fhp, vpp)
register struct mount *mp;
struct fid *fhp;
- struct mbuf *nam;
struct vnode **vpp;
- int *exflagsp;
- struct ucred **credanonp;
{
return (EINVAL);
@@ -1021,3 +1022,17 @@ nfs_quotactl(mp, cmd, uid, arg, p)
return (EOPNOTSUPP);
}
+
+/*
+ * check export permission, not supported
+ */
+/* ARGUSED */
+int
+nfs_checkexp(mp, nam, exflagsp, credanonp)
+ register struct mount *mp;
+ struct mbuf *nam;
+ int *exflagsp;
+ struct ucred **credanonp;
+{
+ return (EOPNOTSUPP);
+}
diff --git a/sys/nfs/nfsmount.h b/sys/nfs/nfsmount.h
index 3a76ef3123a..847aa753f1a 100644
--- a/sys/nfs/nfsmount.h
+++ b/sys/nfs/nfsmount.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfsmount.h,v 1.6 1999/06/10 05:55:15 millert Exp $ */
+/* $OpenBSD: nfsmount.h,v 1.7 2000/02/07 04:57:17 assar Exp $ */
/* $NetBSD: nfsmount.h,v 1.10 1996/02/18 11:54:03 fvdl Exp $ */
/*
@@ -116,8 +116,7 @@ int nfs_statfs __P((struct mount *mp, struct statfs *sbp, struct proc *p));
int nfs_sync __P((struct mount *mp, int waitfor, struct ucred *cred,
struct proc *p));
int nfs_vget __P((struct mount *, ino_t, struct vnode **));
-int nfs_fhtovp __P((struct mount *mp, struct fid *fhp, struct mbuf *nam,
- struct vnode **vpp, int *exflagsp, struct ucred **credanonp));
+int nfs_fhtovp __P((struct mount *mp, struct fid *fhp, struct vnode **vpp));
int nfs_vptofh __P((struct vnode *vp, struct fid *fhp));
int nfs_fsinfo __P((struct nfsmount *, struct vnode *, struct ucred *,
struct proc *));