From fbde243b6c805b964a4459b3ded2ff9ddd921d93 Mon Sep 17 00:00:00 2001 From: ae Date: Sat, 2 Jul 2016 11:54:20 +0000 Subject: Hide warning about non-existent lookup tables and informational messages about modified table entry when quied mode enabled. Approved by: re (hrs) Obtained from: Yandex LLC --- sbin/ipfw/tables.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'sbin') diff --git a/sbin/ipfw/tables.c b/sbin/ipfw/tables.c index 2264e32..d14c9e9 100644 --- a/sbin/ipfw/tables.c +++ b/sbin/ipfw/tables.c @@ -914,9 +914,10 @@ table_modify_record(ipfw_obj_header *oh, int ac, char *av[], int add, xi.vmask = vmask; strlcpy(xi.tablename, oh->ntlv.name, sizeof(xi.tablename)); - fprintf(stderr, "DEPRECATED: inserting data into " - "non-existent table %s. (auto-created)\n", - xi.tablename); + if (quiet == 0) + warnx("DEPRECATED: inserting data into " + "non-existent table %s. (auto-created)", + xi.tablename); table_do_create(oh, &xi); } @@ -937,8 +938,6 @@ table_modify_record(ipfw_obj_header *oh, int ac, char *av[], int add, error = table_do_modify_record(cmd, oh, tent_buf, count, atomic); - quiet = 0; - /* * Compatibility stuff: do not yell on duplicate keys or * failed deletions. -- cgit v1.1 From 448dc2b255257036cf847eaba84b9ec97c8225aa Mon Sep 17 00:00:00 2001 From: araujo Date: Tue, 5 Jul 2016 07:01:42 +0000 Subject: Fix a regression introduced on revision r271909, when using argument -g or several hops we have segmentation fault because we overwrite the same structure to store information for host and gateway. Submitted by: Maryse Levavasseur Reworked by: hrs Approved by: re (hrs) Differential Revision: https://reviews.freebsd.org/D6980 --- sbin/ping6/ping6.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'sbin') diff --git a/sbin/ping6/ping6.c b/sbin/ping6/ping6.c index 732e634..51a154d 100644 --- a/sbin/ping6/ping6.c +++ b/sbin/ping6/ping6.c @@ -515,7 +515,6 @@ main(int argc, char *argv[]) memcpy(&src, res->ai_addr, res->ai_addrlen); srclen = res->ai_addrlen; freeaddrinfo(res); - res = NULL; options |= F_SRCADDR; break; case 's': /* size of packet to send */ @@ -631,7 +630,7 @@ main(int argc, char *argv[]) if (error) errx(1, "%s", gai_strerror(error)); if (res->ai_canonname) - hostname = res->ai_canonname; + hostname = strdup(res->ai_canonname); else hostname = target; @@ -643,6 +642,7 @@ main(int argc, char *argv[]) if ((s = socket(res->ai_family, res->ai_socktype, res->ai_protocol)) < 0) err(1, "socket"); + freeaddrinfo(res); /* set the source address if specified. */ if ((options & F_SRCADDR) != 0) { @@ -1208,9 +1208,6 @@ main(int argc, char *argv[]) sigaction(SIGALRM, &si_sa, 0); summary(); - if (res != NULL) - freeaddrinfo(res); - if(packet != NULL) free(packet); -- cgit v1.1 From aea1562f16d3c164b2aa8e81aba14f422c17f30c Mon Sep 17 00:00:00 2001 From: trasz Date: Thu, 7 Jul 2016 09:03:57 +0000 Subject: Add new unmount(2) flag, MNT_NONBUSY, to check whether there are any open vnodes before proceeding. Make autounmound(8) use this flag. Without it, even an unsuccessfull unmount causes filesystem flush, which interferes with normal operation. Reviewed by: kib@ Approved by: re (gjb@) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D7047 --- sbin/umount/umount.8 | 15 ++++++++++++--- sbin/umount/umount.c | 16 +++++++++++----- 2 files changed, 23 insertions(+), 8 deletions(-) (limited to 'sbin') diff --git a/sbin/umount/umount.8 b/sbin/umount/umount.8 index 2ddbf5a..0f672b8 100644 --- a/sbin/umount/umount.8 +++ b/sbin/umount/umount.8 @@ -28,7 +28,7 @@ .\" @(#)umount.8 8.2 (Berkeley) 5/8/95 .\" $FreeBSD$ .\" -.Dd June 17, 2015 +.Dd July 7, 2016 .Dt UMOUNT 8 .Os .Sh NAME @@ -36,12 +36,12 @@ .Nd unmount file systems .Sh SYNOPSIS .Nm -.Op Fl fv +.Op Fl fnv .Ar special ... | node ... | fsid ... .Nm .Fl a | A .Op Fl F Ar fstab -.Op Fl fv +.Op Fl fnv .Op Fl h Ar host .Op Fl t Ar type .Sh DESCRIPTION @@ -94,6 +94,15 @@ option and, unless otherwise specified with the option, will only unmount .Tn NFS file systems. +.It Fl n +Unless the +.Fl f +is used, the +.Nm +will not unmount an active file system. +It will, however, perform a flush. +This flag disables this behaviour, preventing the flush +if there are any files open. .It Fl t Ar type Is used to indicate the actions should only be taken on file systems of the specified type. diff --git a/sbin/umount/umount.c b/sbin/umount/umount.c index 6cd8ea7..20b7804 100644 --- a/sbin/umount/umount.c +++ b/sbin/umount/umount.c @@ -91,7 +91,7 @@ main(int argc, char *argv[]) struct addrinfo hints; all = errs = 0; - while ((ch = getopt(argc, argv, "AaF:fh:t:v")) != -1) + while ((ch = getopt(argc, argv, "AaF:fh:nt:v")) != -1) switch (ch) { case 'A': all = 2; @@ -103,12 +103,15 @@ main(int argc, char *argv[]) setfstab(optarg); break; case 'f': - fflag = MNT_FORCE; + fflag |= MNT_FORCE; break; case 'h': /* -h implies -A. */ all = 2; nfshost = optarg; break; + case 'n': + fflag |= MNT_NONBUSY; + break; case 't': if (typelist != NULL) err(1, "only one -t option may be specified"); @@ -124,8 +127,11 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; + if ((fflag & MNT_FORCE) != 0 && (fflag & MNT_NONBUSY) != 0) + err(1, "-f and -n are mutually exclusive"); + /* Start disks transferring immediately. */ - if ((fflag & MNT_FORCE) == 0) + if ((fflag & (MNT_FORCE | MNT_NONBUSY)) == 0) sync(); if ((argc == 0 && !all) || (argc != 0 && all)) @@ -609,7 +615,7 @@ usage(void) { (void)fprintf(stderr, "%s\n%s\n", - "usage: umount [-fv] special ... | node ... | fsid ...", - " umount -a | -A [-F fstab] [-fv] [-h host] [-t type]"); + "usage: umount [-fnv] special ... | node ... | fsid ...", + " umount -a | -A [-F fstab] [-fnv] [-h host] [-t type]"); exit(1); } -- cgit v1.1