Revert the changes I introduced trying to solve tmpfs' NFS export problem.

Requested by yamt@
This commit is contained in:
mjf 2006-10-31 08:12:46 +00:00
parent 7372f1dad4
commit a2be0ed655
5 changed files with 12 additions and 33 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: mntopts.h,v 1.9 2006/10/24 21:53:10 mjf Exp $ */
/* $NetBSD: mntopts.h,v 1.10 2006/10/31 08:12:46 mjf Exp $ */
/*-
* Copyright (c) 1994
@ -56,7 +56,6 @@ struct mntopt {
#define MOPT_SYMPERM { "symperm", 0, MNT_SYMPERM, 0 }
#define MOPT_SOFTDEP { "softdep", 0, MNT_SOFTDEP, 0 }
#define MOPT_IGNORE { "hidden", 0, MNT_IGNORE, 0 }
#define MOPT_NOSHARE { "share", 1, MNT_NOSHARE, 0 }
/* Control flags. */
#define MOPT_FORCE { "force", 0, MNT_FORCE, 0 }
@ -89,8 +88,7 @@ struct mntopt {
MOPT_RDONLY, \
MOPT_UNION, \
MOPT_IGNORE, \
MOPT_SYMPERM, \
MOPT_NOSHARE
MOPT_SYMPERM
__BEGIN_DECLS
typedef struct mntoptparse *mntoptparse_t;

View File

@ -1,4 +1,4 @@
.\" $NetBSD: mount.8,v 1.55 2006/10/24 21:53:10 mjf Exp $
.\" $NetBSD: mount.8,v 1.56 2006/10/31 08:12:46 mjf Exp $
.\"
.\" Copyright (c) 1980, 1989, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@ -29,7 +29,7 @@
.\"
.\" @(#)mount.8 8.8 (Berkeley) 6/16/94
.\"
.Dd October 24, 2006
.Dd September 25, 2006
.Dt MOUNT 8
.Os
.Sh NAME
@ -200,8 +200,6 @@ or other systems that perform power management.
Do not allow execution of any binaries on the mounted file system.
This option is useful for a server that has file systems containing
binaries for architectures other than its own.
.It Cm noshare
Do not allow this file system to be exported over the network.
.It Cm nosuid
Do not allow set-user-identifier or set-group-identifier bits to take effect.
.It Cm port

View File

@ -1,4 +1,4 @@
/* $NetBSD: vfs_syscalls.c,v 1.274 2006/10/24 21:53:10 mjf Exp $ */
/* $NetBSD: vfs_syscalls.c,v 1.275 2006/10/31 08:12:46 mjf Exp $ */
/*
* Copyright (c) 1989, 1993
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.274 2006/10/24 21:53:10 mjf Exp $");
__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.275 2006/10/31 08:12:46 mjf Exp $");
#include "opt_compat_netbsd.h"
#include "opt_compat_43.h"
@ -181,16 +181,6 @@ sys_mount(struct lwp *l, void *v, register_t *retval __unused)
* lock this vnode again, so make the lock recursive.
*/
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY | LK_SETRECURSE);
/*
* Do not allow the filesystem to be exported if MNT_NOSHARE
* is set.
*/
if ((SCARG(uap, flags) & MNT_EXPORTED) &&
(vp->v_mount->mnt_flag & MNT_NOSHARE)) {
vput(vp);
return (EPERM);
}
if (SCARG(uap, flags) & (MNT_UPDATE | MNT_GETARGS)) {
if ((vp->v_flag & VROOT) == 0) {
vput(vp);
@ -360,13 +350,12 @@ sys_mount(struct lwp *l, void *v, register_t *retval __unused)
mp->mnt_flag &=
~(MNT_NOSUID | MNT_NOEXEC | MNT_NODEV |
MNT_SYNCHRONOUS | MNT_UNION | MNT_ASYNC | MNT_NOCOREDUMP |
MNT_NOATIME | MNT_NODEVMTIME | MNT_SYMPERM | MNT_SOFTDEP |
MNT_NOSHARE);
MNT_NOATIME | MNT_NODEVMTIME | MNT_SYMPERM | MNT_SOFTDEP);
mp->mnt_flag |= SCARG(uap, flags) &
(MNT_NOSUID | MNT_NOEXEC | MNT_NODEV |
MNT_SYNCHRONOUS | MNT_UNION | MNT_ASYNC | MNT_NOCOREDUMP |
MNT_NOATIME | MNT_NODEVMTIME | MNT_SYMPERM | MNT_SOFTDEP |
MNT_IGNORE | MNT_NOSHARE);
MNT_IGNORE);
}
/*
* Mount the filesystem.

View File

@ -1,4 +1,4 @@
/* $NetBSD: nfs_export.c,v 1.20 2006/10/30 16:06:05 jmmv Exp $ */
/* $NetBSD: nfs_export.c,v 1.21 2006/10/31 08:12:46 mjf Exp $ */
/*-
* Copyright (c) 1997, 1998, 2004, 2005 The NetBSD Foundation, Inc.
@ -82,7 +82,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: nfs_export.c,v 1.20 2006/10/30 16:06:05 jmmv Exp $");
__KERNEL_RCSID(0, "$NetBSD: nfs_export.c,v 1.21 2006/10/31 08:12:46 mjf Exp $");
#include "opt_compat_netbsd.h"
#include "opt_inet.h"
@ -705,9 +705,6 @@ export(struct netexport *nep, const struct export_args *argp)
int error;
if (argp->ex_flags & MNT_EXPORTED) {
if (mp->mnt_flag & MNT_NOSHARE)
return (EPERM);
if (argp->ex_flags & MNT_EXPUBLIC) {
if ((error = setpublicfs(mp, nep, argp)) != 0)
return error;

View File

@ -1,4 +1,4 @@
/* $NetBSD: fstypes.h,v 1.15 2006/10/24 21:53:10 mjf Exp $ */
/* $NetBSD: fstypes.h,v 1.16 2006/10/31 08:12:46 mjf Exp $ */
/*
* Copyright (c) 1989, 1991, 1993
@ -87,6 +87,7 @@ typedef struct fhandle fhandle_t;
#define __MNT_UNUSED2 0x00200000
#define __MNT_UNUSED3 0x00800000
#define __MNT_UNUSED4 0x01000000
#define __MNT_UNUSED5 0x02000000
#define MNT_RDONLY 0x00000001 /* read only filesystem */
#define MNT_SYNCHRONOUS 0x00000002 /* file system written synchronously */
@ -97,7 +98,6 @@ typedef struct fhandle fhandle_t;
#define MNT_ASYNC 0x00000040 /* file system written asynchronously */
#define MNT_NOCOREDUMP 0x00008000 /* don't write core dumps to this FS */
#define MNT_IGNORE 0x00100000 /* don't show entry in df */
#define MNT_NOSHARE 0x02000000 /* file-system can't be exported */
#define MNT_NOATIME 0x04000000 /* Never update access times in fs */
#define MNT_SYMPERM 0x20000000 /* recognize symlink permission */
#define MNT_NODEVMTIME 0x40000000 /* Never update mod times for devs */
@ -113,7 +113,6 @@ typedef struct fhandle fhandle_t;
{ MNT_ASYNC, 0, "asynchronous" }, \
{ MNT_NOCOREDUMP, 0, "nocoredump" }, \
{ MNT_IGNORE, 0, "hidden" }, \
{ MNT_NOSHARE, 0, "noshare" }, \
{ MNT_NOATIME, 0, "noatime" }, \
{ MNT_SYMPERM, 0, "symperm" }, \
{ MNT_NODEVMTIME, 0, "nodevmtime" }, \
@ -164,7 +163,6 @@ typedef struct fhandle fhandle_t;
MNT_ASYNC | \
MNT_NOCOREDUMP | \
MNT_IGNORE | \
MNT_NOSHARE | \
MNT_NOATIME | \
MNT_SYMPERM | \
MNT_NODEVMTIME | \
@ -218,7 +216,6 @@ typedef struct fhandle fhandle_t;
#define __MNT_FLAG_BITS \
"\20" \
"\41MNT_NOSHARE" \
"\40MNT_SOFTDEP" \
"\37MNT_NODEVMTIME" \
"\36MNT_SYMPERM" \