Subject: bin/16688: No way exists to use MNT_IGNORE (custom C code excepted)
To: None <gnats-bugs@gnats.netbsd.org>
From: None <kre@munnari.OZ.AU>
List: netbsd-bugs
Date: 05/06/2002 22:26:09
>Number:         16688
>Category:       bin
>Synopsis:       No way exists to use MNT_IGNORE (custom C code excepted)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon May 06 05:27:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Robert Elz
>Release:        NetBSD 1.5ZC   2002-04-22 (and later it seems)
>Organization:
	University of Melbourne
>Environment:
System: NetBSD munnari.OZ.AU 1.5ZC NetBSD 1.5ZC (MUNNARI) #10: Fri Apr 26 18:18:15 EST 2002 kre@munnnari.cs.mu.OZ.AU:/usr/src/sys/arch/alpha/compile/MUNNARI alpha
Architecture: alpha
Machine: alpha
>Description:
	df(1) obeys the MNT_IGNORE flag, and does not show the filesystem
	unless given the -a arg.   mount(8) shows filesystems mounted
	with MNT_IGNORE as being mounted with option "hidden", but no
	way existed that I could find to set that bit when mounting a
	filesystem.   That more or less makes the feature useless, it
	seems - though being able to set it for union mounts and such
	is very useful.

>How-To-Repeat:
	RTFM, UTSL, get frustrated looking for how the bit can ever
	get set using standard NetBSD commands.
>Fix:
	Apply the following patch, and the "hidden" option becomes
	available in fstab and via mount -o (option name chosen as that
	was what mount already said if the flag somehow got set).

	The duplication (without complete constsiency) between what is
	in <sys/mount.h> (as part of __MNT_BASIC_FLAGS) in particular,
	and what is in sbin/mount/mntopts.h probably should be addressed
	at some time.  But not by me.

	I have no idea what sequence is intended to be used when sorting
	the -o options in the man page - it seems to be partly lexical
	(ignoring "no" prefixes) and partly functional...  I punted for
	lexical for this one (no related functional group).   Whatever...

Index: mntopts.h
===================================================================
RCS file: /local/NetBSD/repository/basesrc/sbin/mount/mntopts.h,v
retrieving revision 1.9
diff -u -3 -r1.9 mntopts.h
--- mntopts.h	2000/06/15 22:36:07	1.9
+++ mntopts.h	2002/05/06 06:19:03
@@ -57,6 +57,7 @@
 #define MOPT_NOATIME		{ "atime",	1, MNT_NOATIME, 0 }
 #define MOPT_SYMPERM		{ "symperm",	0, MNT_SYMPERM, 0 }
 #define MOPT_SOFTDEP		{ "softdep",	0, MNT_SOFTDEP, 0 }
+#define MOPT_IGNORE		{ "hidden",	0, MNT_IGNORE, 0 }
 
 /* Control flags. */
 #define MOPT_FORCE		{ "force",	1, MNT_FORCE, 0 }
@@ -86,6 +87,7 @@
 	MOPT_NOSUID,							\
 	MOPT_RDONLY,							\
 	MOPT_UNION,							\
+	MOPT_IGNORE,							\
 	MOPT_SYMPERM
 
 void getmntopts __P((const char *, const struct mntopt *, int *, int *));
Index: mount.8
===================================================================
RCS file: /local/NetBSD/repository/basesrc/sbin/mount/mount.8,v
retrieving revision 1.33
diff -u -3 -r1.33 mount.8
--- mount.8	2001/11/16 11:57:51	1.33
+++ mount.8	2002/05/06 11:59:07
@@ -182,6 +182,13 @@
 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 hidden
+By setting the
+.Dv MNT_IGNORE
+flag,
+causes the mount point to be excluded from the
+list of filesystems shown by default with
+.Xr df 1 .
 .It Cm nosuid
 Do not allow set-user-identifier or set-group-identifier bits to take effect.
 .It Cm rdonly
@@ -371,6 +378,7 @@
 .Sh SEE ALSO
 .Xr mount 2 ,
 .Xr fstab 5 ,
+.Xr df 1 ,
 .Xr disklabel 8 ,
 .Xr mount_ados 8 ,
 .Xr mount_cd9660 8 ,
>Release-Note:
>Audit-Trail:
>Unformatted: