Source-Changes-HG archive

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

[src/minoura-xpg4dl]: src/sbin Sync w/ netbsd-1-5-base.



details:   https://anonhg.NetBSD.org/src/rev/836be2e030a5
branches:  minoura-xpg4dl
changeset: 486688:836be2e030a5
user:      minoura <minoura%NetBSD.org@localhost>
date:      Thu Jun 22 16:05:18 2000 +0000

description:
Sync w/ netbsd-1-5-base.

diffstat:

 sbin/Makefile                        |    5 +-
 sbin/ccdconfig/ccdconfig.c           |    6 +-
 sbin/disklabel/disklabel.8           |   12 +-
 sbin/disklabel/disklabel.c           |   56 +-
 sbin/dmesg/Makefile                  |    4 +-
 sbin/dmesg/dmesg.8                   |    4 +-
 sbin/dmesg/dmesg.c                   |  122 ++-
 sbin/fdisk/fdisk.8                   |    3 +-
 sbin/fdisk/fdisk.c                   |   17 +-
 sbin/fsck_lfs/Makefile               |    4 +-
 sbin/fsck_lfs/dir.c                  |    4 +-
 sbin/fsck_lfs/fsck_vars.h            |    3 +-
 sbin/fsck_lfs/inode.c                |   29 +-
 sbin/fsck_lfs/main.c                 |   13 +-
 sbin/fsck_lfs/pass0.c                |   60 +-
 sbin/fsck_lfs/pass1.c                |   34 +-
 sbin/fsck_lfs/pass2.c                |    4 +-
 sbin/fsck_lfs/pass5.c                |   10 +-
 sbin/fsck_lfs/setup.c                |   32 +-
 sbin/fsck_lfs/utilities.c            |    3 +-
 sbin/fsck_lfs/vars.c                 |    3 +-
 sbin/ldconfig/ldconfig.c             |   24 +-
 sbin/modload/modload.8               |   17 +-
 sbin/modunload/modunload.8           |   17 +-
 sbin/mount/mntopts.h                 |    3 +-
 sbin/mount/mount.8                   |   14 +-
 sbin/mount_ados/mount_ados.8         |   16 +-
 sbin/mount_ados/mount_ados.c         |   16 +-
 sbin/mount_cd9660/mount_cd9660.8     |   16 +-
 sbin/mount_cd9660/mount_cd9660.c     |   11 +-
 sbin/mount_ffs/mount_ffs.c           |    5 +-
 sbin/mount_filecore/mount_filecore.8 |    2 +-
 sbin/mount_filecore/mount_filecore.c |    2 +-
 sbin/mount_msdos/mount_msdos.8       |   16 +-
 sbin/mount_msdos/mount_msdos.c       |   16 +-
 sbin/mount_nfs/mount_nfs.c           |  110 ++-
 sbin/mount_ntfs/mount_ntfs.c         |    6 +-
 sbin/mount_portal/activate.c         |   45 +-
 sbin/mount_procfs/mount_procfs.8     |    4 +-
 sbin/ping6/ping6.8                   |   68 ++-
 sbin/ping6/ping6.c                   |  307 ++++++++---
 sbin/raidctl/raidctl.8               |    9 +-
 sbin/raidctl/raidctl.c               |  104 ++-
 sbin/restore/main.c                  |    7 +-
 sbin/restore/restore.8               |    7 +-
 sbin/rndctl/rndctl.8                 |   38 +-
 sbin/rndctl/rndctl.c                 |   76 ++-
 sbin/routed/if.c                     |    8 +-
 sbin/setkey/Makefile                 |   35 +
 sbin/setkey/parse.y                  |  902 +++++++++++++++++++++++++++++++++++
 sbin/setkey/sample.cf                |  219 ++++++++
 sbin/setkey/scriptdump.pl            |   58 ++
 sbin/setkey/setkey.8                 |  560 +++++++++++++++++++++
 sbin/setkey/setkey.c                 |  578 ++++++++++++++++++++++
 sbin/setkey/test-pfkey.c             |  531 ++++++++++++++++++++
 sbin/setkey/test-policy.c            |  160 ++++++
 sbin/setkey/token.l                  |  314 ++++++++++++
 sbin/setkey/vchar.h                  |   36 +
 sbin/sysctl/sysctl.c                 |   19 +-
 sbin/ttyflags/ttyflags.8             |   14 +-
 sbin/ttyflags/ttyflags.c             |   16 +-
 sbin/tunefs/tunefs.8                 |   34 +-
 sbin/tunefs/tunefs.c                 |   15 +-
 sbin/umount/umount.8                 |    9 +-
 sbin/umount/umount.c                 |  156 ++---
 65 files changed, 4495 insertions(+), 553 deletions(-)

diffs (truncated from 7270 to 300 lines):

diff -r adebdee8f797 -r 836be2e030a5 sbin/Makefile
--- a/sbin/Makefile     Thu Jun 22 14:57:40 2000 +0000
+++ b/sbin/Makefile     Thu Jun 22 16:05:18 2000 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.67 2000/03/15 12:05:58 soren Exp $
+#      $NetBSD: Makefile,v 1.67.2.1 2000/06/22 16:05:18 minoura Exp $
 #      @(#)Makefile    8.5 (Berkeley) 3/31/94
 
 # Not ported: XNSrouted enpload scsiformat startslip
@@ -33,4 +33,7 @@
 # IPv6
 SUBDIR+= ping6 rtsol
 
+# IPsec
+SUBDIR+= setkey
+
 .include <bsd.subdir.mk>
diff -r adebdee8f797 -r 836be2e030a5 sbin/ccdconfig/ccdconfig.c
--- a/sbin/ccdconfig/ccdconfig.c        Thu Jun 22 14:57:40 2000 +0000
+++ b/sbin/ccdconfig/ccdconfig.c        Thu Jun 22 16:05:18 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ccdconfig.c,v 1.29 2000/02/16 06:52:32 enami Exp $     */
+/*     $NetBSD: ccdconfig.c,v 1.29.2.1 2000/06/22 16:05:19 minoura Exp $       */
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -41,11 +41,9 @@
 __COPYRIGHT(
 "@(#) Copyright (c) 1996, 1997\
        The NetBSD Foundation, Inc.  All rights reserved.");
-__RCSID("$NetBSD: ccdconfig.c,v 1.29 2000/02/16 06:52:32 enami Exp $");
+__RCSID("$NetBSD: ccdconfig.c,v 1.29.2.1 2000/06/22 16:05:19 minoura Exp $");
 #endif
 
-#define __POOL_EXPOSE                  /* dev/ccdvar.h uses struct pool */
-
 #include <sys/param.h>
 #include <sys/ioctl.h>
 #include <sys/disklabel.h>
diff -r adebdee8f797 -r 836be2e030a5 sbin/disklabel/disklabel.8
--- a/sbin/disklabel/disklabel.8        Thu Jun 22 14:57:40 2000 +0000
+++ b/sbin/disklabel/disklabel.8        Thu Jun 22 16:05:18 2000 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: disklabel.8,v 1.29 2000/03/09 12:50:36 hubertf Exp $
+.\"    $NetBSD: disklabel.8,v 1.29.2.1 2000/06/22 16:05:20 minoura Exp $
 .\"
 .\" Copyright (c) 1987, 1988, 1991, 1993
 .\"    The Regents of the University of California.  All rights reserved.
@@ -59,6 +59,11 @@
 .Op Fl C
 .Ar disk
 .Nm ""
+.Fl I
+.Op Fl r
+.Op Fl C
+.Ar disk
+.Nm ""
 .Fl i
 .Op Fl r
 .Ar disk
@@ -319,6 +324,11 @@
 as on-disk.
 Existing bootstrap code is unaffected.
 .Pp
+.Dl disklabel -e -I sd0
+.Pp
+As previous, but don't fail if there was no label on the disk yet;
+provide some default values instead.
+.Pp
 .Dl disklabel -R sd0 mylabel
 .Pp
 Restore the on-disk and in-core label for sd0 from information in
diff -r adebdee8f797 -r 836be2e030a5 sbin/disklabel/disklabel.c
--- a/sbin/disklabel/disklabel.c        Thu Jun 22 14:57:40 2000 +0000
+++ b/sbin/disklabel/disklabel.c        Thu Jun 22 16:05:18 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: disklabel.c,v 1.82 2000/05/25 21:23:37 thorpej Exp $   */
+/*     $NetBSD: disklabel.c,v 1.82.2.1 2000/06/22 16:05:20 minoura Exp $       */
 
 /*
  * Copyright (c) 1987, 1993
@@ -47,7 +47,7 @@
 static char sccsid[] = "@(#)disklabel.c        8.4 (Berkeley) 5/4/95";
 /* from static char sccsid[] = "@(#)disklabel.c        1.2 (Symmetric) 11/28/85"; */
 #else
-__RCSID("$NetBSD: disklabel.c,v 1.82 2000/05/25 21:23:37 thorpej Exp $");
+__RCSID("$NetBSD: disklabel.c,v 1.82.2.1 2000/06/22 16:05:20 minoura Exp $");
 #endif
 #endif /* not lint */
 
@@ -129,12 +129,13 @@
 static int     rflag;
 static int     tflag;
 static int     Cflag;
+static int     Iflag;
 
 #ifdef DEBUG
 static int     debug;
-#define OPTIONS        "BCNRWb:def:irs:tw"
+#define OPTIONS        "BCINRWb:def:irs:tw"
 #else
-#define OPTIONS        "BCNRWb:ef:irs:tw"
+#define OPTIONS        "BCINRWb:ef:irs:tw"
 #endif
 
 #ifdef USE_MBR
@@ -195,6 +196,9 @@
                case 'C':
                        ++Cflag;
                        break;
+               case 'I':
+                       ++Iflag;
+                       break;
                case 'N':
                        if (op != UNSPEC)
                                usage();
@@ -266,6 +270,9 @@
        if (argc < 1)
                usage();
 
+       if (Iflag && op != EDIT)
+               usage();
+
        dkname = argv[0];
        f = opendisk(dkname, op == READ ? O_RDONLY : O_RDWR, np, MAXPATHLEN, 0);
        specname = np;
@@ -470,7 +477,7 @@
        /* Let the kernel deal with SunOS disklabel compatibility */
        if (0)
 #else
-       if (rflag)
+       if (rflag || Iflag)
 #endif
        {
 #ifdef USE_MBR
@@ -586,7 +593,7 @@
 
        case ESRCH:
                warnx("%s: No disk label on disk;\n"
-                   "use \"disklabel -r\" to install initial label", s);
+                   "use \"disklabel -I\" to install initial label", s);
                break;
 
        case EINVAL:
@@ -825,8 +832,8 @@
 {
        struct disklabel *lp;
 
-       if (rflag) {
-               char *msg;
+       if (rflag || Iflag) {
+               char *msg = NULL;
                off_t sectoffset = 0;
 
 #ifdef USE_MBR
@@ -840,7 +847,8 @@
                if (lseek(f, sectoffset, SEEK_SET) < 0 ||
                    read(f, bootarea, BBSIZE) < BBSIZE)
                        err(4, "%s", specname);
-               msg = "no disk label";
+               if (!Iflag)
+                       msg = "no disklabel";
                for (lp = (struct disklabel *)bootarea;
                    lp <= (struct disklabel *)(bootarea + BBSIZE - sizeof(*lp));
                    lp = (struct disklabel *)((char *)lp + sizeof(long))) {
@@ -852,8 +860,15 @@
                                msg = "disk label corrupted";
                        }
                }
-               /* lp = (struct disklabel *)(bootarea + LABELOFFSET); */
-               errx(1, msg);
+               if (msg != NULL)
+                       errx(1, msg);
+               /*
+                * There was no label on the disk. Get the fictious one
+                * as a basis for initialisation.
+                */
+               lp = makebootarea(bootarea, &lab, f);
+               if (ioctl(f, DIOCGDINFO, lp) < 0)
+                       errx(1, "no disklabel");
        } else {
                lp = &lab;
                if (ioctl(f, DIOCGDINFO, lp) < 0)
@@ -895,7 +910,7 @@
         * We must read the current bootarea so we don't clobber the
         * existing boot block, if any.
         */
-       if (rflag) {
+       if (rflag || Iflag) {
                off_t sectoffset = 0;
 
                if (lseek(f, sectoffset, SEEK_SET) < 0 ||
@@ -911,7 +926,7 @@
         * clobber the existing boot.
         */
        if (!installboot) {
-               if (rflag) {
+               if (rflag || Iflag) {
                        off_t sectoffset = 0;
 
 #ifdef USE_MBR
@@ -1330,16 +1345,23 @@
                sleep(1);
        }
        if (pid == 0) {
-               char *ed;
+               const char *ed;
+               char *buf;
+               int retval;
 
                sigprocmask(SIG_SETMASK, &osigset, (sigset_t *)0);
                setgid(getgid());
                setuid(getuid());
                if ((ed = getenv("EDITOR")) == (char *)0)
                        ed = DEFEDITOR;
-               execlp(ed, ed, tmpfil, 0);
-               perror(ed);
-               exit(1);
+               /*
+                * Use system(3) in case someone's editor is "editor arg1 arg2".
+                */
+               asprintf(&buf, "%s %s", ed, tmpfil);
+               retval = system(buf);
+               if (retval == -1)
+                       perror(ed);
+               exit(retval);
        }
        while ((xpid = wait(&stat)) >= 0)
                if (xpid == pid)
diff -r adebdee8f797 -r 836be2e030a5 sbin/dmesg/Makefile
--- a/sbin/dmesg/Makefile       Thu Jun 22 14:57:40 2000 +0000
+++ b/sbin/dmesg/Makefile       Thu Jun 22 16:05:18 2000 +0000
@@ -1,10 +1,8 @@
-#      $NetBSD: Makefile,v 1.8 1995/03/18 14:54:45 cgd Exp $
+#      $NetBSD: Makefile,v 1.8.14.1 2000/06/22 16:05:21 minoura Exp $
 #      @(#)Makefile    8.1 (Berkeley) 6/5/93
 
 PROG=  dmesg
 MAN=   dmesg.8
-BINGRP=        kmem
-BINMODE=2555
 LDADD= -lkvm
 DPADD= ${LIBKVM}
 
diff -r adebdee8f797 -r 836be2e030a5 sbin/dmesg/dmesg.8
--- a/sbin/dmesg/dmesg.8        Thu Jun 22 14:57:40 2000 +0000
+++ b/sbin/dmesg/dmesg.8        Thu Jun 22 16:05:18 2000 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: dmesg.8,v 1.11 2000/04/29 00:24:09 abs Exp $
+.\"    $NetBSD: dmesg.8,v 1.11.2.1 2000/06/22 16:05:22 minoura Exp $
 .\"
 .\" Copyright (c) 1980, 1991, 1993
 .\"    The Regents of the University of California.  All rights reserved.
@@ -51,7 +51,7 @@
 .Bl -tag -width Ds
 .It Fl M
 Extract values associated with the name list from the specified core
-instead of the default ``/dev/kmem''.
+instead of the default ``/dev/mem''.
 .It Fl N
 Extract the name list from the specified system instead of the default
 ``/netbsd''.
diff -r adebdee8f797 -r 836be2e030a5 sbin/dmesg/dmesg.c
--- a/sbin/dmesg/dmesg.c        Thu Jun 22 14:57:40 2000 +0000
+++ b/sbin/dmesg/dmesg.c        Thu Jun 22 16:05:18 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dmesg.c,v 1.16 1998/07/05 08:56:54 mrg Exp $   */
+/*     $NetBSD: dmesg.c,v 1.16.8.1 2000/06/22 16:05:22 minoura Exp $   */
 /*-
  * Copyright (c) 1991, 1993
  *     The Regents of the University of California.  All rights reserved.
@@ -42,47 +42,50 @@
 #if 0
 static char sccsid[] = "@(#)dmesg.c    8.1 (Berkeley) 6/5/93";
 #else
-__RCSID("$NetBSD: dmesg.c,v 1.16 1998/07/05 08:56:54 mrg Exp $");
+__RCSID("$NetBSD: dmesg.c,v 1.16.8.1 2000/06/22 16:05:22 minoura Exp $");
 #endif
 #endif /* not lint */
 
+#include <sys/param.h>
 #include <sys/msgbuf.h>
+#include <sys/sysctl.h>
 
 #include <err.h>
 #include <fcntl.h>
 #include <kvm.h>
-#include <limits.h>
 #include <nlist.h>
 #include <stdio.h>
+#include <stddef.h>
 #include <stdlib.h>
-#include <time.h>
 #include <unistd.h>
 #include <vis.h>
 
+#ifndef SMALL
 struct nlist nl[] = {
 #define        X_MSGBUF        0
        { "_msgbufp" },



Home | Main Index | Thread Index | Old Index