Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sbin/mount_ptyfs remove -c and chroot option; they are alway...



details:   https://anonhg.NetBSD.org/src/rev/0edc2c72a66e
branches:  trunk
changeset: 781629:0edc2c72a66e
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Sep 18 21:35:43 2012 +0000

description:
remove -c and chroot option; they are always on now

diffstat:

 sbin/mount_ptyfs/mount_ptyfs.8 |  13 +++----------
 sbin/mount_ptyfs/mount_ptyfs.c |  21 ++++++---------------
 2 files changed, 9 insertions(+), 25 deletions(-)

diffs (130 lines):

diff -r 747afa6b1f6d -r 0edc2c72a66e sbin/mount_ptyfs/mount_ptyfs.8
--- a/sbin/mount_ptyfs/mount_ptyfs.8    Tue Sep 18 21:33:55 2012 +0000
+++ b/sbin/mount_ptyfs/mount_ptyfs.8    Tue Sep 18 21:35:43 2012 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: mount_ptyfs.8,v 1.10 2012/09/09 17:11:49 wiz Exp $
+.\"    $NetBSD: mount_ptyfs.8,v 1.11 2012/09/18 21:35:43 christos Exp $
 .\"
 .\"
 .\" Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd September 9, 2012
+.Dd September 18, 2012
 .Dt MOUNT_PTYFS 8
 .Os
 .Sh NAME
@@ -36,7 +36,6 @@
 .Nd mount the /dev/pts file system
 .Sh SYNOPSIS
 .Nm
-.Op Fl c
 .Op Fl g Ar group|gid
 .Op Fl m Ar mode
 .Op Fl o Ar options
@@ -63,10 +62,6 @@
 .Pp
 The options are as follows:
 .Bl -tag -width indent
-.It Fl c
-Allows
-.Ar ptyfs
-to be mounted inside a chrooted environment.
 .It Fl g Ar group|gid
 Specify the group ownership of the slave pseudo-tty.
 .It Fl m Ar mode
@@ -80,9 +75,6 @@
 .Pp
 .Nm
 specific options are
-.Dv chroot
-which corresponds to
-.Fl c ,
 .Dv group
 which corresponds to
 .Fl g ,
@@ -112,3 +104,4 @@
 .Nx 3.0 .
 .Sh BUGS
 This filesystem may not be NFS-exported.
+Multiple instances are not allowed.
diff -r 747afa6b1f6d -r 0edc2c72a66e sbin/mount_ptyfs/mount_ptyfs.c
--- a/sbin/mount_ptyfs/mount_ptyfs.c    Tue Sep 18 21:33:55 2012 +0000
+++ b/sbin/mount_ptyfs/mount_ptyfs.c    Tue Sep 18 21:35:43 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mount_ptyfs.c,v 1.13 2012/04/02 21:08:02 christos Exp $        */
+/*     $NetBSD: mount_ptyfs.c,v 1.14 2012/09/18 21:35:43 christos Exp $        */
 
 /*
  * Copyright (c) 1992, 1993, 1994
@@ -77,7 +77,7 @@
 #if 0
 static char sccsid[] = "@(#)mount_ptyfs.c      8.3 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: mount_ptyfs.c,v 1.13 2012/04/02 21:08:02 christos Exp $");
+__RCSID("$NetBSD: mount_ptyfs.c,v 1.14 2012/09/18 21:35:43 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -100,14 +100,12 @@
 
 #define ALTF_GROUP     0x1
 #define ALTF_MODE      0x2
-#define ALTF_CHROOT    0x4
 
 static const struct mntopt mopts[] = {
        MOPT_STDOPTS,
        MOPT_GETARGS,
        { "group", 0, ALTF_GROUP, 1 },
        { "mode", 0, ALTF_MODE, 1 },
-       { "chroot", 0, ALTF_CHROOT, 1 },
        MOPT_NULL,
 };
 
@@ -165,7 +163,7 @@
        args.mode = S_IRUSR|S_IWUSR|S_IWGRP;
        args.flags = 0;
 
-       while ((ch = getopt(argc, argv, "cg:m:o:")) != -1)
+       while ((ch = getopt(argc, argv, "g:m:o:")) != -1)
                switch (ch) {
                case 'o':
                        altflags = 0;
@@ -176,13 +174,8 @@
                                args.gid = getgrp(getmntoptstr(mp, "group"));
                        if (altflags & ALTF_MODE)
                                args.mode = (mode_t)getmntoptnum(mp, "mode");
-                       if (altflags & ALTF_CHROOT)
-                               args.flags |= PTYFSMNT_CHROOT;
                        freemntopts(mp);
                        break;
-               case 'c':
-                       args.flags |= PTYFSMNT_CHROOT;
-                       break;
                case 'g':
                        args.gid = getgrp(optarg);
                        break;
@@ -210,10 +203,8 @@
        if (mount(MOUNT_PTYFS, canon_dir, mntflags, &args, sizeof args) == -1)
                err(1, "ptyfs on %s", canon_dir);
        if (mntflags & MNT_GETARGS) {
-               char buf[1024];
-               (void)snprintb(buf, sizeof(buf), PTYFSMNT_BITS, args.flags);
-               printf("version=%d, gid=%lu, mode=0%o flags=%s\n", args.version,
-                   (unsigned long)args.gid, args.mode, buf);
+               printf("version=%d, gid=%lu, mode=0%o\n", args.version,
+                   (unsigned long)args.gid, args.mode);
        }
        return 0;
 }
@@ -222,7 +213,7 @@
 usage(void)
 {
        (void)fprintf(stderr,
-           "Usage: %s [-c] [-g <group|gid>] [-m <mode>] [-o options] "
+           "Usage: %s [-g <group|gid>] [-m <mode>] [-o options] "
            "ptyfs mountpoint\n", getprogname());
        exit(1);
 }



Home | Main Index | Thread Index | Old Index