summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/bsdconfig/share/common.subr6
-rwxr-xr-xusr.sbin/bsdinstall/scripts/config4
-rwxr-xr-xusr.sbin/bsdinstall/scripts/docsinstall4
-rwxr-xr-xusr.sbin/bsdinstall/scripts/hostname6
-rwxr-xr-xusr.sbin/bsdinstall/scripts/jail3
-rwxr-xr-xusr.sbin/bsdinstall/scripts/keymap3
-rwxr-xr-xusr.sbin/bsdinstall/scripts/netconfig_ipv410
-rwxr-xr-xusr.sbin/bsdinstall/scripts/netconfig_ipv610
-rwxr-xr-xusr.sbin/bsdinstall/scripts/rootpass1
-rwxr-xr-xusr.sbin/bsdinstall/scripts/script5
-rwxr-xr-xusr.sbin/bsdinstall/scripts/wlanconfig4
-rwxr-xr-xusr.sbin/bsdinstall/scripts/zfsboot2
-rw-r--r--usr.sbin/iscsid/discovery.c3
-rw-r--r--usr.sbin/iscsid/pdu.c1
-rw-r--r--usr.sbin/makefs/cd9660.c3
-rw-r--r--usr.sbin/newsyslog/newsyslog.c45
-rw-r--r--usr.sbin/newsyslog/newsyslog.conf.519
-rw-r--r--usr.sbin/ntp/Makefile10
-rw-r--r--usr.sbin/ntp/config.h10
-rw-r--r--usr.sbin/ntp/doc/ntp-keygen.84
-rw-r--r--usr.sbin/ntp/doc/ntp.conf.554
-rw-r--r--usr.sbin/ntp/doc/ntp.keys.56
-rw-r--r--usr.sbin/ntp/doc/ntpd.827
-rw-r--r--usr.sbin/ntp/doc/ntpdc.84
-rw-r--r--usr.sbin/ntp/doc/ntpq.816
-rw-r--r--usr.sbin/ntp/doc/sntp.87
-rw-r--r--usr.sbin/ntp/ntpdc/Makefile1
-rw-r--r--usr.sbin/ntp/ntpq/Makefile1
-rwxr-xr-xusr.sbin/ntp/scripts/mkver2
-rw-r--r--usr.sbin/pw/pw_group.c2
-rw-r--r--usr.sbin/rtadvd/Makefile2
-rw-r--r--usr.sbin/rtadvd/rtadvd.c17
-rw-r--r--usr.sbin/rtsold/Makefile2
-rw-r--r--usr.sbin/rtsold/rtsold.c8
-rw-r--r--usr.sbin/syslogd/syslogd.c28
-rw-r--r--usr.sbin/sysrc/sysrc147
-rw-r--r--usr.sbin/sysrc/sysrc.855
-rw-r--r--usr.sbin/watch/watch.c4
38 files changed, 316 insertions, 220 deletions
diff --git a/usr.sbin/bsdconfig/share/common.subr b/usr.sbin/bsdconfig/share/common.subr
index b7f4ee7..5996446 100644
--- a/usr.sbin/bsdconfig/share/common.subr
+++ b/usr.sbin/bsdconfig/share/common.subr
@@ -1,7 +1,7 @@
if [ ! "$_COMMON_SUBR" ]; then _COMMON_SUBR=1
#
# Copyright (c) 2012 Ron McDowell
-# Copyright (c) 2012-2014 Devin Teske
+# Copyright (c) 2012-2015 Devin Teske
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -33,8 +33,8 @@ if [ ! "$_COMMON_SUBR" ]; then _COMMON_SUBR=1
# Default file descriptors to link to stdout/stderr for passthru allowing
# redirection within a sub-shell to bypass directly to the terminal.
#
-: ${TERMINAL_STDOUT_PASSTHRU:=3}}
-: ${TERMINAL_STDERR_PASSTHRU:=4}}
+: ${TERMINAL_STDOUT_PASSTHRU:=3}
+: ${TERMINAL_STDERR_PASSTHRU:=4}
############################################################ GLOBALS
diff --git a/usr.sbin/bsdinstall/scripts/config b/usr.sbin/bsdinstall/scripts/config
index bc3d723..ebb1dff 100755
--- a/usr.sbin/bsdinstall/scripts/config
+++ b/usr.sbin/bsdinstall/scripts/config
@@ -1,7 +1,7 @@
#!/bin/sh
#-
# Copyright (c) 2011 Nathan Whitehorn
-# Copyright (c) 2013 Devin Teske
+# Copyright (c) 2013-2015 Devin Teske
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -45,6 +45,8 @@ cp $BSDINSTALL_TMPBOOT/* $BSDINSTALL_CHROOT/boot
# Set up other things from installed config
chroot $BSDINSTALL_CHROOT /usr/bin/newaliases > /dev/null 2>&1
+exit $SUCCESS
+
################################################################################
# END
################################################################################
diff --git a/usr.sbin/bsdinstall/scripts/docsinstall b/usr.sbin/bsdinstall/scripts/docsinstall
index 4836507..a600054 100755
--- a/usr.sbin/bsdinstall/scripts/docsinstall
+++ b/usr.sbin/bsdinstall/scripts/docsinstall
@@ -1,7 +1,7 @@
#!/bin/sh
#-
# Copyright (c) 2011 Marc Fonvieille
-# Copyright (c) 2013 Devin Teske
+# Copyright (c) 2013-2015 Devin Teske
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -159,7 +159,7 @@ for lang in $selected; do
docsets="$docsets $lang-freebsd-doc"
done
-ASSUME_ALWAYS_YES=YES chroot $BSDINSTALL_CHROOT pkg install $docsets || return $FAILURE
+ASSUME_ALWAYS_YES=YES chroot $BSDINSTALL_CHROOT pkg install $docsets
################################################################################
# END
diff --git a/usr.sbin/bsdinstall/scripts/hostname b/usr.sbin/bsdinstall/scripts/hostname
index a53fd80..511db67 100755
--- a/usr.sbin/bsdinstall/scripts/hostname
+++ b/usr.sbin/bsdinstall/scripts/hostname
@@ -1,6 +1,7 @@
#!/bin/sh
#-
# Copyright (c) 2011 Nathan Whitehorn
+# Copyright (c) 2015 Devin Teske
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -43,6 +44,9 @@ if [ $? -eq $DIALOG_CANCEL ]; then exit 1; fi
exec 3>&-
echo "hostname=\"$HOSTNAME\"" > $BSDINSTALL_TMPETC/rc.conf.hostname
-if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then
+retval=$?
+if [ "$BSDINSTALL_CONFIGCURRENT" ]; then
hostname -s "$HOSTNAME"
+ retval=$?
fi
+exit $retval
diff --git a/usr.sbin/bsdinstall/scripts/jail b/usr.sbin/bsdinstall/scripts/jail
index cb86060..ecfbb78 100755
--- a/usr.sbin/bsdinstall/scripts/jail
+++ b/usr.sbin/bsdinstall/scripts/jail
@@ -1,7 +1,7 @@
#!/bin/sh
#-
# Copyright (c) 2011 Nathan Whitehorn
-# Copyright (c) 2013 Devin Teske
+# Copyright (c) 2013-2015 Devin Teske
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -125,6 +125,7 @@ cp /etc/localtime $1/etc
bsdinstall entropy
f_dprintf "Installation Completed at %s" "$(date)"
+exit $SUCCESS
################################################################################
# END
diff --git a/usr.sbin/bsdinstall/scripts/keymap b/usr.sbin/bsdinstall/scripts/keymap
index c36651f..7b42571 100755
--- a/usr.sbin/bsdinstall/scripts/keymap
+++ b/usr.sbin/bsdinstall/scripts/keymap
@@ -1,7 +1,7 @@
#!/bin/sh
#-
# Copyright (c) 2011 Nathan Whitehorn
-# Copyright (c) 2013 Devin Teske
+# Copyright (c) 2013-2015 Devin Teske
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -231,6 +231,7 @@ while :; do
done
f_quietly f_keymap_kbdcontrol "$keymap"
+exit $SUCCESS
################################################################################
# END
diff --git a/usr.sbin/bsdinstall/scripts/netconfig_ipv4 b/usr.sbin/bsdinstall/scripts/netconfig_ipv4
index 856c999..88a0fa2 100755
--- a/usr.sbin/bsdinstall/scripts/netconfig_ipv4
+++ b/usr.sbin/bsdinstall/scripts/netconfig_ipv4
@@ -1,7 +1,7 @@
#!/bin/sh
#-
# Copyright (c) 2011 Nathan Whitehorn
-# Copyright (c) 2013 Devin Teske
+# Copyright (c) 2013-2015 Devin Teske
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -80,16 +80,20 @@ echo $INTERFACE $IF_CONFIG |
printf("ifconfig_%s=\"%s\inet %s netmask %s\"\n", $1, prefix, $2, $3);
printf("defaultrouter=\"%s\"\n", $4);
}' >> $BSDINSTALL_TMPETC/._rc.conf.net
+retval=$?
-if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then
+if [ "$BSDINSTALL_CONFIGCURRENT" ]; then
. $BSDINSTALL_TMPETC/._rc.conf.net
ifconfig $INTERFACE `eval echo \\\$ifconfig_$INTERFACE`
- if [ -n "${defaultrouter}" ]; then
+ if [ "$defaultrouter" ]; then
route delete -inet default
route add -inet default $defaultrouter
+ retval=$?
fi
fi
+exit $retval
+
################################################################################
# END
################################################################################
diff --git a/usr.sbin/bsdinstall/scripts/netconfig_ipv6 b/usr.sbin/bsdinstall/scripts/netconfig_ipv6
index aa1a579..ff4258f 100755
--- a/usr.sbin/bsdinstall/scripts/netconfig_ipv6
+++ b/usr.sbin/bsdinstall/scripts/netconfig_ipv6
@@ -2,7 +2,7 @@
#-
# Copyright (c) 2011 Nathan Whitehorn
# Copyright (c) 2011 The FreeBSD Foundation
-# Copyright (c) 2013 Devin Teske
+# Copyright (c) 2013-2015 Devin Teske
# All rights reserved.
#
# Portions of this software were developed by Bjoern Zeeb
@@ -141,16 +141,20 @@ BEGIN {
}
printf("ifconfig_%s_ipv6=\"inet6 %s\"\n", iface, $1);
}' >> $BSDINSTALL_TMPETC/._rc.conf.net
+retval=$?
-if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then
+if [ "$BSDINSTALL_CONFIGCURRENT" ]; then
. $BSDINSTALL_TMPETC/._rc.conf.net
ifconfig ${INTERFACE} `eval echo \\\$ifconfig_${INTERFACE}_ipv6`
- if [ -n "${ipv6_defaultrouter}" ]; then
+ if [ "$ipv6_defaultrouter" ]; then
route delete -inet6 default
route add -inet6 default ${ipv6_defaultrouter}
+ retval=$?
fi
fi
+exit $retval
+
################################################################################
# END
################################################################################
diff --git a/usr.sbin/bsdinstall/scripts/rootpass b/usr.sbin/bsdinstall/scripts/rootpass
index b3dde22..7bfd823 100755
--- a/usr.sbin/bsdinstall/scripts/rootpass
+++ b/usr.sbin/bsdinstall/scripts/rootpass
@@ -34,4 +34,3 @@ echo
echo "Please select a password for the system management account (root):"
chroot $BSDINSTALL_CHROOT passwd root 2>&1
-
diff --git a/usr.sbin/bsdinstall/scripts/script b/usr.sbin/bsdinstall/scripts/script
index 19cd392..bb48873 100755
--- a/usr.sbin/bsdinstall/scripts/script
+++ b/usr.sbin/bsdinstall/scripts/script
@@ -1,7 +1,7 @@
#!/bin/sh
#-
# Copyright (c) 2013 Nathan Whitehorn
-# Copyright (c) 2013 Devin Teske
+# Copyright (c) 2013-2015 Devin Teske
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -129,7 +129,8 @@ bsdinstall umount
f_dprintf "Installation Completed at %s" "$( date )"
-trap true EXIT
+trap - EXIT
+exit $SUCCESS
################################################################################
# END
diff --git a/usr.sbin/bsdinstall/scripts/wlanconfig b/usr.sbin/bsdinstall/scripts/wlanconfig
index cefc2cb..4eba2b0 100755
--- a/usr.sbin/bsdinstall/scripts/wlanconfig
+++ b/usr.sbin/bsdinstall/scripts/wlanconfig
@@ -1,7 +1,7 @@
#!/bin/sh
#-
# Copyright (c) 2011 Nathan Whitehorn
-# Copyright (c) 2013 Devin Teske
+# Copyright (c) 2013-2015 Devin Teske
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -168,7 +168,7 @@ if [ "$BSDINSTALL_CONFIGCURRENT" ]; then
f_dprintf "%s" "$output"
fi
-exit 0
+exit $SUCCESS
################################################################################
# END
diff --git a/usr.sbin/bsdinstall/scripts/zfsboot b/usr.sbin/bsdinstall/scripts/zfsboot
index bbcb712..e230ac6 100755
--- a/usr.sbin/bsdinstall/scripts/zfsboot
+++ b/usr.sbin/bsdinstall/scripts/zfsboot
@@ -1644,7 +1644,7 @@ while :; do
esac
done
-return $SUCCESS
+exit $SUCCESS
################################################################################
# END
diff --git a/usr.sbin/iscsid/discovery.c b/usr.sbin/iscsid/discovery.c
index a8975d7..f5a0f66 100644
--- a/usr.sbin/iscsid/discovery.c
+++ b/usr.sbin/iscsid/discovery.c
@@ -33,10 +33,7 @@ __FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/ioctl.h>
-#include <assert.h>
#include <stdbool.h>
-#include <stdio.h>
-#include <stdlib.h>
#include <string.h>
#include <netinet/in.h>
diff --git a/usr.sbin/iscsid/pdu.c b/usr.sbin/iscsid/pdu.c
index 8f07718..b5a8cc0 100644
--- a/usr.sbin/iscsid/pdu.c
+++ b/usr.sbin/iscsid/pdu.c
@@ -35,7 +35,6 @@ __FBSDID("$FreeBSD$");
#include <sys/uio.h>
#include <assert.h>
#include <stdint.h>
-#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
diff --git a/usr.sbin/makefs/cd9660.c b/usr.sbin/makefs/cd9660.c
index f0e2f38..ea4ed44 100644
--- a/usr.sbin/makefs/cd9660.c
+++ b/usr.sbin/makefs/cd9660.c
@@ -428,8 +428,7 @@ cd9660_parse_opts(const char *option, fsinfo_t *fsopts)
rv = set_option(cd9660_options, var, val);
}
- if (var)
- free(var);
+ free(var);
return (rv);
}
diff --git a/usr.sbin/newsyslog/newsyslog.c b/usr.sbin/newsyslog/newsyslog.c
index b63234b..24e4882 100644
--- a/usr.sbin/newsyslog/newsyslog.c
+++ b/usr.sbin/newsyslog/newsyslog.c
@@ -280,6 +280,7 @@ static int age_old_log(const char *file);
static void savelog(char *from, char *to);
static void createdir(const struct conf_entry *ent, char *dirpart);
static void createlog(const struct conf_entry *ent);
+static int parse_signal(const char *str);
/*
* All the following take a parameter of 'int', but expect values in the
@@ -1338,12 +1339,13 @@ no_trimat:
if (q && *q) {
if (*q == '/')
working->pid_cmd_file = strdup(q);
- else if (isdigit(*q))
+ else if (isalnum(*q))
goto got_sig;
- else
+ else {
errx(1,
- "illegal pid file or signal number in config file:\n%s",
+ "illegal pid file or signal in config file:\n%s",
errline);
+ }
}
if (eol)
q = NULL;
@@ -1354,17 +1356,13 @@ no_trimat:
working->sig = SIGHUP;
if (q && *q) {
- if (isdigit(*q)) {
- got_sig:
- working->sig = atoi(q);
- } else {
- err_sig:
+got_sig:
+ working->sig = parse_signal(q);
+ if (working->sig < 1 || working->sig >= sys_nsig) {
errx(1,
- "illegal signal number in config file:\n%s",
+ "illegal signal in config file:\n%s",
errline);
}
- if (working->sig < 1 || working->sig >= NSIG)
- goto err_sig;
}
/*
@@ -2662,3 +2660,28 @@ change_attrs(const char *fname, const struct conf_entry *ent)
warn("can't chflags %s NODUMP", fname);
}
}
+
+/*
+ * Parse a signal number or signal name. Returns the signal number parsed or -1
+ * on failure.
+ */
+static int
+parse_signal(const char *str)
+{
+ int sig, i;
+ const char *errstr;
+
+ sig = strtonum(str, 1, sys_nsig - 1, &errstr);
+
+ if (errstr == NULL)
+ return (sig);
+ if (strncasecmp(str, "SIG", 3) == 0)
+ str += 3;
+
+ for (i = 1; i < sys_nsig; i++) {
+ if (strcasecmp(str, sys_signame[i]) == 0)
+ return (i);
+ }
+
+ return (-1);
+}
diff --git a/usr.sbin/newsyslog/newsyslog.conf.5 b/usr.sbin/newsyslog/newsyslog.conf.5
index a053f2f..0d28aab 100644
--- a/usr.sbin/newsyslog/newsyslog.conf.5
+++ b/usr.sbin/newsyslog/newsyslog.conf.5
@@ -21,7 +21,7 @@
.\" the suitability of this software for any purpose. It is
.\" provided "as is" without express or implied warranty.
.\"
-.Dd March 21, 2012
+.Dd October 24, 2015
.Dt NEWSYSLOG.CONF 5
.Os
.Sh NAME
@@ -337,7 +337,7 @@ process ID or to find a group process ID if the
.Cm U
flag was specified.
If this field is present, a
-.Ar signal_number
+.Ar signal
is sent to the process ID contained in this file.
If this field is not present and the
.Cm N
@@ -358,14 +358,23 @@ flag, the file is treated as a path to a binary to be executed
by the
.Xr newsyslog 8
after rotation instead of sending the signal out.
-.It Ar signal_number
-This optional field specifies the signal number that will be sent
-to the daemon process (or to all processes in a process group, if the
+.It Ar signal
+This optional field specifies the signal that will be sent to the daemon
+process (or to all processes in a process group, if the
.Cm U
flag was specified).
If this field is not present, then a
.Dv SIGHUP
signal will be sent.
+Signal names
+must start with
+.Dq SIG
+and be the signal name, e.g.,
+.Dv SIGUSR1 .
+Alternatively,
+.Ar signal
+can be the signal number, e.g., 30 for
+.Dv SIGUSR1 .
.El
.Sh EXAMPLES
The following is an example of the
diff --git a/usr.sbin/ntp/Makefile b/usr.sbin/ntp/Makefile
index 962e60f..ad5b523 100644
--- a/usr.sbin/ntp/Makefile
+++ b/usr.sbin/ntp/Makefile
@@ -5,4 +5,14 @@ SUBDIR= libopts libntp libntpevent libparse ntpd ntpdc ntpq ntpdate \
ntptime ntp-keygen sntp
SUBDIR+= doc
+SUBDIR_DEPEND_ntpd= libntp libopts libparse
+SUBDIR_DEPEND_ntpdate= libntp
+SUBDIR_DEPEND_ntpdc= libntp libopts
+SUBDIR_DEPEND_ntpq= libntp libopts
+SUBDIR_DEPEND_ntptime= libntp
+SUBDIR_DEPEND_ntp-keygen= libntp libopts
+SUBDIR_DEPEND_sntp= libntp libntpevent libopts
+
+SUBDIR_PARALLEL=
+
.include <bsd.subdir.mk>
diff --git a/usr.sbin/ntp/config.h b/usr.sbin/ntp/config.h
index 7a4a2d1..ef4717f 100644
--- a/usr.sbin/ntp/config.h
+++ b/usr.sbin/ntp/config.h
@@ -1421,7 +1421,7 @@
#define PACKAGE_NAME "ntp"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "ntp 4.2.8p3"
+#define PACKAGE_STRING "ntp 4.2.8p4"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "ntp"
@@ -1430,7 +1430,7 @@
#define PACKAGE_URL "http://www.ntp.org./"
/* Define to the version of this package. */
-#define PACKAGE_VERSION "4.2.8p3"
+#define PACKAGE_VERSION "4.2.8p4"
/* data dir */
#define PERLLIBDIR "/usr/local/share/ntp/lib"
@@ -1611,7 +1611,7 @@ typedef unsigned int uintptr_t;
/* #undef USE_UDP_SIGPOLL */
/* Version number of package */
-#define VERSION "4.2.8p3"
+#define VERSION "4.2.8p4"
/* vsnprintf expands "%m" to strerror(errno) */
/* #undef VSNPRINTF_PERCENT_M */
@@ -1788,5 +1788,5 @@ typedef union mpinfou {
/*
* FreeBSD specific: Explicitly specify date/time for reproducible build.
*/
-#define MKREPRO_DATE "Jul 04 2015"
-#define MKREPRO_TIME "15:42:16"
+#define MKREPRO_DATE "Oct 22 2015"
+#define MKREPRO_TIME "17:58:31"
diff --git a/usr.sbin/ntp/doc/ntp-keygen.8 b/usr.sbin/ntp/doc/ntp-keygen.8
index 89c4e09..197adbf 100644
--- a/usr.sbin/ntp/doc/ntp-keygen.8
+++ b/usr.sbin/ntp/doc/ntp-keygen.8
@@ -1,11 +1,11 @@
-.Dd February 4 2015
+.Dd October 21 2015
.Dt NTP_KEYGEN 8 User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.mdoc)
.\"
.\" $FreeBSD$
.\"
-.\" It has been AutoGen-ed February 4, 2015 at 02:44:02 AM by AutoGen 5.18.5pre4
+.\" It has been AutoGen-ed October 21, 2015 at 12:40:10 PM by AutoGen 5.18.5
.\" From the definitions ntp-keygen-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/usr.sbin/ntp/doc/ntp.conf.5 b/usr.sbin/ntp/doc/ntp.conf.5
index 4ed9440..c7af12d 100644
--- a/usr.sbin/ntp/doc/ntp.conf.5
+++ b/usr.sbin/ntp/doc/ntp.conf.5
@@ -1,11 +1,11 @@
-.Dd February 4 2015
+.Dd October 21 2015
.Dt NTP_CONF 5 File Formats
.Os
.\" EDIT THIS FILE WITH CAUTION (ntp.mdoc)
.\"
.\" $FreeBSD$
.\"
-.\" It has been AutoGen-ed February 4, 2015 at 02:42:07 AM by AutoGen 5.18.5pre4
+.\" It has been AutoGen-ed October 21, 2015 at 12:38:24 PM by AutoGen 5.18.5
.\" From the definitions ntp.conf.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
@@ -1905,7 +1905,7 @@ re\-associate accordingly.
Some administrators prefer to avoid running
.Xr ntpd 8
continuously and run either
-.Xr ntpdate 8
+.Xr sntp 8
or
.Xr ntpd 8
.Fl q
@@ -1997,7 +1997,7 @@ peers remaining.
This value defaults to 1, but can be changed
to any number from 1 to 15.
.It Cm minclock Ar minclock
-The clustering algorithm repeatedly casts out outlyer
+The clustering algorithm repeatedly casts out outlier
associations until no more than
.Cm minclock
associations remain.
@@ -2388,6 +2388,9 @@ This implies that
must have write permission for the directory the
drift file is located in, and that file system links, symbolic or
otherwise, should be avoided.
+.It Ic dscp Ar value
+This option specifies the Differentiated Services Control Point (DSCP) value,
+a 6\-bit code. The default value is 46, signifying Expedited Forwarding.
.It Xo Ic enable
.Oo
.Cm auth | Cm bclient |
@@ -2487,6 +2490,19 @@ This option is useful for sites that run
.Xr ntpd 8
on multiple hosts, with (mostly) common options (e.g., a
restriction list).
+.It Ic leapsmearinterval Ar seconds
+This EXPERIMENTAL option is only available if
+.Xr ntpd 8
+was built with the
+.Cm \-\-enable\-leap\-smear
+option to the
+.Cm configure
+script.
+It specifies the interval over which a leap second correction will be applied.
+Recommended values for this option are between
+7200 (2 hours) and 86400 (24 hours).
+.Sy DO NOT USE THIS OPTION ON PUBLIC\-ACCESS SERVERS!
+See http://bugs.ntp.org/2855 for more information.
.It Ic logconfig Ar configkeyword
This command controls the amount and type of output written to
the system
@@ -2620,7 +2636,9 @@ holds the names of the reference clock variables.
.Cm freq Ar freq |
.Cm huffpuff Ar huffpuff |
.Cm panic Ar panic |
-.Cm step Ar srep |
+.Cm step Ar step |
+.Cm stepback Ar stepback |
+.Cm stepfwd Ar stepfwd |
.Cm stepout Ar stepout
.Oc
.Xc
@@ -2680,6 +2698,19 @@ adjustments will never occur.
Note: The kernel time discipline is
disabled if the step threshold is set to zero or greater than the
default.
+.It Cm stepback Ar stepback
+The argument is the step threshold for the backward direction,
+which by default is 0.128 s.
+It can
+be set to any positive number in seconds.
+If both the forward and backward step thresholds are set to zero, step
+adjustments will never occur.
+Note: The kernel time discipline is
+disabled if
+each direction of step threshold are either
+set to zero or greater than .5 second.
+.It Cm stepfwd Ar stepfwd
+As for stepback, but for the forward direction.
.It Cm stepout Ar stepout
The argument is the stepout timeout, which by default is 900 s.
It can
@@ -2696,19 +2727,22 @@ pulses will not be suppressed.
.Xc
.Bl -tag -width indent
.It Cm memlock Ar Nmegabytes
-Specify the number of megabytes of memory that can be allocated.
-Probably only available under Linux, this option is useful
+Specify the number of megabytes of memory that should be
+allocated and locked.
+Probably only available under Linux, this option may be useful
when dropping root (the
.Fl i
option).
-The default is 32 megabytes. Setting this to zero will prevent any attemp to lock memory.
+The default is 32 megabytes on non\-Linux machines, and \-1 under Linux.
+-1 means "do not lock the process into memory".
+0 means "lock whatever memory the process wants into memory".
.It Cm stacksize Ar N4kPages
Specifies the maximum size of the process stack on systems with the
-.It Cm filenum Ar Nfiledescriptors
-Specifies the maximum number of file descriptors ntpd may have open at once. Defaults to the system default.
.Fn mlockall
function.
Defaults to 50 4k pages (200 4k pages in OpenBSD).
+.It Cm filenum Ar Nfiledescriptors
+Specifies the maximum number of file descriptors ntpd may have open at once. Defaults to the system default.
.El
.It Xo Ic trap Ar host_address
.Op Cm port Ar port_number
diff --git a/usr.sbin/ntp/doc/ntp.keys.5 b/usr.sbin/ntp/doc/ntp.keys.5
index 4ec3bb3..b1bcb3c 100644
--- a/usr.sbin/ntp/doc/ntp.keys.5
+++ b/usr.sbin/ntp/doc/ntp.keys.5
@@ -1,13 +1,11 @@
-.Dd February 4 2015
+.Dd October 21 2015
.Dt NTP_KEYS 5 File Formats
.Os SunOS 5.10
.\" EDIT THIS FILE WITH CAUTION (ntp.mdoc)
.\"
.\" $FreeBSD$
.\"
-.\" $FreeBSD$
-.\"
-.\" It has been AutoGen-ed February 4, 2015 at 02:42:10 AM by AutoGen 5.18.5pre4
+.\" It has been AutoGen-ed October 21, 2015 at 12:38:28 PM by AutoGen 5.18.5
.\" From the definitions ntp.keys.def
.\" and the template file agmdoc-file.tpl
.Sh NAME
diff --git a/usr.sbin/ntp/doc/ntpd.8 b/usr.sbin/ntp/doc/ntpd.8
index 665aa0b..243f96d 100644
--- a/usr.sbin/ntp/doc/ntpd.8
+++ b/usr.sbin/ntp/doc/ntpd.8
@@ -1,11 +1,11 @@
-.Dd February 4 2015
+.Dd October 21 2015
.Dt NTPD 8 User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntpd-opts.mdoc)
.\"
.\" $FreeBSD$
.\"
-.\" It has been AutoGen-ed February 4, 2015 at 02:42:12 AM by AutoGen 5.18.5pre4
+.\" It has been AutoGen-ed October 21, 2015 at 12:38:30 PM by AutoGen 5.18.5
.\" From the definitions ntpd-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
@@ -146,7 +146,7 @@ The name and path of the frequency file,
by default.
This is the same operation as the
\fBdriftfile\fP \fIdriftfile\fP
-configuration specification in the
+configuration specification in the
\fI/etc/ntp.conf\fP
file.
.It Fl g , Fl \-panicgate
@@ -165,6 +165,19 @@ options.
See the
\fBtinker\fP
configuration file directive for other options.
+.It Fl G , Fl \-force\-step\-once
+Step any initial offset correction..
+.sp
+Normally,
+\fBntpd\fP
+steps the time if the time offset exceeds the step threshold,
+which is 128 ms by default, and otherwise slews the time.
+This option forces the initial offset correction to be stepped,
+so the highest time accuracy can be achieved quickly.
+However, this may also cause the time to be stepped back
+so this option must not be used if
+applications requiring monotonic time are running.
+See the \fBtinker\fP configuration file directive for other options.
.It Fl i Ar string , Fl \-jaildir Ns = Ns Ar string
Jail directory.
.sp
@@ -188,7 +201,7 @@ Open the network address given, or all the addresses associated with the
given interface name. This option may appear multiple times. This option
also implies not opening other addresses, except wildcard and localhost.
This option is deprecated. Please consider using the configuration file
-\fBinterface\fP command, which is more versatile.
+\fBinterface\fP command, which is more versatile.
.It Fl k Ar string , Fl \-keyfile Ns = Ns Ar string
path to symmetric keys.
.sp
@@ -521,6 +534,8 @@ when you have permission to do so from the owner of the target host.
Finally,
in the past many startup scripts would run
.Xr ntpdate 8
+or
+.Xr sntp 8
to get the system clock close to correct before starting
.Xr ntpd 8 ,
but this was never more than a mediocre hack and is no longer needed.
@@ -530,7 +545,9 @@ and you still need to set the system time before starting
.Nm ,
please open a bug report and document what is going on,
and then look at using
-.Xr sntp 8 .
+.Xr sntp 8
+if you really need to set the clock before starting
+.Nm .
.Pp
There is a way to start
.Xr ntpd 8
diff --git a/usr.sbin/ntp/doc/ntpdc.8 b/usr.sbin/ntp/doc/ntpdc.8
index 3373614..74129c4 100644
--- a/usr.sbin/ntp/doc/ntpdc.8
+++ b/usr.sbin/ntp/doc/ntpdc.8
@@ -1,11 +1,11 @@
-.Dd February 4 2015
+.Dd October 21 2015
.Dt NTPDC 8 User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntpdc-opts.mdoc)
.\"
.\" $FreeBSD$
.\"
-.\" It has been AutoGen-ed February 4, 2015 at 02:42:44 AM by AutoGen 5.18.5pre4
+.\" It has been AutoGen-ed October 21, 2015 at 12:38:57 PM by AutoGen 5.18.5
.\" From the definitions ntpdc-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/usr.sbin/ntp/doc/ntpq.8 b/usr.sbin/ntp/doc/ntpq.8
index 1eba486..bcd1fba 100644
--- a/usr.sbin/ntp/doc/ntpq.8
+++ b/usr.sbin/ntp/doc/ntpq.8
@@ -1,11 +1,11 @@
-.Dd February 4 2015
+.Dd October 21 2015
.Dt NTPQ 8 User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntpq-opts.mdoc)
.\"
.\" $FreeBSD$
.\"
-.\" It has been AutoGen-ed February 4, 2015 at 02:43:19 AM by AutoGen 5.18.5pre4
+.\" It has been AutoGen-ed October 21, 2015 at 12:39:29 PM by AutoGen 5.18.5
.\" From the definitions ntpq-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
@@ -226,7 +226,9 @@ switch.
This command allows the specification of a key number to be
used to authenticate configuration requests.
This must correspond
-to a key number the server has been configured to use for this
+to the
+.Cm controlkey
+key number the server has been configured to use for this
purpose.
.It Ic keytype Xo Oo
.Cm md5 |
@@ -506,6 +508,14 @@ offset of server relative to this host
.It Ic jitter
jitter
.El
+.It Ic apeers
+Display a list of peers in the form:
+.Dl [tally]remote refid assid st t when pool reach delay offset jitter
+where the output is just like the
+.Ic peers
+command except that the
+.Ic refid
+is displayed in hex format and the association number is also displayed.
.It Ic pstats Ar assocID
Show the statistics for the peer with the given
.Ar assocID .
diff --git a/usr.sbin/ntp/doc/sntp.8 b/usr.sbin/ntp/doc/sntp.8
index 4d09cb0..9bcc78d 100644
--- a/usr.sbin/ntp/doc/sntp.8
+++ b/usr.sbin/ntp/doc/sntp.8
@@ -1,11 +1,11 @@
-.Dd February 4 2015
+.Dd October 21 2015
.Dt SNTP 8 User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (sntp-opts.mdoc)
.\"
.\" $FreeBSD$
.\"
-.\" It has been AutoGen-ed February 4, 2015 at 02:34:20 AM by AutoGen 5.18.5pre4
+.\" It has been AutoGen-ed October 21, 2015 at 12:30:59 PM by AutoGen 5.18.5
.\" From the definitions sntp-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
@@ -59,7 +59,8 @@ Otherwise, only the
is displayed.
Finally, the
.Em stratum
-of the host is reported.
+of the host is reported
+and the leap indicator is decoded and displayed.
.Sh "OPTIONS"
.Bl -tag
.It Fl 4 , Fl \-ipv4
diff --git a/usr.sbin/ntp/ntpdc/Makefile b/usr.sbin/ntp/ntpdc/Makefile
index 051d697..c89982a 100644
--- a/usr.sbin/ntp/ntpdc/Makefile
+++ b/usr.sbin/ntp/ntpdc/Makefile
@@ -3,7 +3,6 @@
MAN=
.include <bsd.own.mk>
-.include <bsd.own.mk>
.PATH: ${.CURDIR}/../../../contrib/ntp/ntpdc
diff --git a/usr.sbin/ntp/ntpq/Makefile b/usr.sbin/ntp/ntpq/Makefile
index 7936719..fec39eb 100644
--- a/usr.sbin/ntp/ntpq/Makefile
+++ b/usr.sbin/ntp/ntpq/Makefile
@@ -3,7 +3,6 @@
MAN=
.include <bsd.own.mk>
-.include <bsd.own.mk>
.PATH: ${.CURDIR}/../../../contrib/ntp/ntpq
diff --git a/usr.sbin/ntp/scripts/mkver b/usr.sbin/ntp/scripts/mkver
index 0fc94be..2bc36b5 100755
--- a/usr.sbin/ntp/scripts/mkver
+++ b/usr.sbin/ntp/scripts/mkver
@@ -6,7 +6,7 @@ PROG=${1-UNKNOWN}
ConfStr="$PROG"
-ConfStr="$ConfStr 4.2.8p3"
+ConfStr="$ConfStr 4.2.8p4"
case "$CSET" in
'') ;;
diff --git a/usr.sbin/pw/pw_group.c b/usr.sbin/pw/pw_group.c
index 711ef68..67beab9 100644
--- a/usr.sbin/pw/pw_group.c
+++ b/usr.sbin/pw/pw_group.c
@@ -259,7 +259,7 @@ pw_group_next(int argc, char **argv, char *arg1 __unused)
struct userconf *cnf;
const char *cfg = NULL;
int ch;
- bool quiet;
+ bool quiet = false;
while ((ch = getopt(argc, argv, "Cq")) != -1) {
switch (ch) {
diff --git a/usr.sbin/rtadvd/Makefile b/usr.sbin/rtadvd/Makefile
index d48832d..b5c3796 100644
--- a/usr.sbin/rtadvd/Makefile
+++ b/usr.sbin/rtadvd/Makefile
@@ -22,8 +22,6 @@ SRCS= rtadvd.c rrenum.c advcap.c if.c config.c timer.c timer_subr.c \
DPADD= ${LIBUTIL}
LDADD= -lutil
-CFLAGS+= -DHAVE_ARC4RANDOM
-
WARNS?= 1
.include <bsd.prog.mk>
diff --git a/usr.sbin/rtadvd/rtadvd.c b/usr.sbin/rtadvd/rtadvd.c
index 6554b61..16c21e6 100644
--- a/usr.sbin/rtadvd/rtadvd.c
+++ b/usr.sbin/rtadvd/rtadvd.c
@@ -242,14 +242,6 @@ main(int argc, char *argv[])
/* timer initialization */
rtadvd_timer_init();
-#ifndef HAVE_ARC4RANDOM
- /* random value initialization */
-#ifdef __FreeBSD__
- srandomdev();
-#else
- srandom((unsigned long)time(NULL));
-#endif
-#endif
pfh = pidfile_open(pidfilename, 0600, &otherpid);
if (pfh == NULL) {
if (errno == EEXIST)
@@ -1016,11 +1008,7 @@ set_short_delay(struct ifinfo *ifi)
* delay and send the advertisement at the
* already-scheduled time. RFC 4861 6.2.6
*/
-#ifdef HAVE_ARC4RANDOM
delay = arc4random_uniform(MAX_RA_DELAY_TIME);
-#else
- delay = random() % MAX_RA_DELAY_TIME;
-#endif
interval.tv_sec = 0;
interval.tv_nsec = delay * 1000;
rest = rtadvd_timer_rest(ifi->ifi_ra_timer);
@@ -1894,13 +1882,8 @@ ra_timer_update(void *arg, struct timespec *tm)
* MaxRtrAdvInterval (RFC4861 6.2.4).
*/
interval = rai->rai_mininterval;
-#ifdef HAVE_ARC4RANDOM
interval += arc4random_uniform(rai->rai_maxinterval -
rai->rai_mininterval);
-#else
- interval += random() % (rai->rai_maxinterval -
- rai->rai_mininterval);
-#endif
break;
case IFI_STATE_TRANSITIVE:
/*
diff --git a/usr.sbin/rtsold/Makefile b/usr.sbin/rtsold/Makefile
index efc322c..44cb99c 100644
--- a/usr.sbin/rtsold/Makefile
+++ b/usr.sbin/rtsold/Makefile
@@ -20,7 +20,7 @@ MLINKS= rtsold.8 rtsol.8
SRCS= rtsold.c rtsol.c if.c probe.c dump.c rtsock.c
WARNS?= 3
-CFLAGS+= -DHAVE_ARC4RANDOM -DHAVE_POLL_H
+CFLAGS+= -DHAVE_POLL_H
DPADD= ${LIBKVM}
LDADD= -lkvm
diff --git a/usr.sbin/rtsold/rtsold.c b/usr.sbin/rtsold/rtsold.c
index a97b884..46bdb1e 100644
--- a/usr.sbin/rtsold/rtsold.c
+++ b/usr.sbin/rtsold/rtsold.c
@@ -223,10 +223,6 @@ main(int argc, char **argv)
errx(1, "pid filename (%s) must be an absolute path",
pidfilename);
}
-#ifndef HAVE_ARC4RANDOM
- /* random value initialization */
- srandom((u_long)time(NULL));
-#endif
#if (__FreeBSD_version < 900000)
if (Fflag) {
@@ -780,11 +776,7 @@ rtsol_timer_update(struct ifinfo *ifi)
ifi->timer = tm_max; /* stop timer(valid?) */
break;
case IFS_DELAY:
-#ifndef HAVE_ARC4RANDOM
- interval = random() % (MAX_RTR_SOLICITATION_DELAY * MILLION);
-#else
interval = arc4random_uniform(MAX_RTR_SOLICITATION_DELAY * MILLION);
-#endif
ifi->timer.tv_sec = interval / MILLION;
ifi->timer.tv_nsec = (interval % MILLION) * 1000;
break;
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c
index ecfdac9..ec1bd3c 100644
--- a/usr.sbin/syslogd/syslogd.c
+++ b/usr.sbin/syslogd/syslogd.c
@@ -352,6 +352,18 @@ static int waitdaemon(int, int, int);
static void timedout(int);
static void increase_rcvbuf(int);
+static void
+close_filed(struct filed *f)
+{
+
+ if (f == NULL || f->f_file == -1)
+ return;
+
+ (void)close(f->f_file);
+ f->f_file = -1;
+ f->f_type = F_UNUSED;
+}
+
int
main(int argc, char *argv[])
{
@@ -999,7 +1011,8 @@ logmsg(int pri, const char *msg, const char *from, int flags)
(void)strlcpy(f->f_lasttime, timestamp,
sizeof(f->f_lasttime));
fprintlog(f, flags, msg);
- (void)close(f->f_file);
+ close(f->f_file);
+ f->f_file = -1;
}
(void)sigsetmask(omask);
return;
@@ -1288,8 +1301,7 @@ fprintlog(struct filed *f, int flags, const char *msg)
*/
if (errno != ENOSPC) {
int e = errno;
- (void)close(f->f_file);
- f->f_type = F_UNUSED;
+ close_filed(f);
errno = e;
logerror(f->f_un.f_fname);
}
@@ -1327,7 +1339,7 @@ fprintlog(struct filed *f, int flags, const char *msg)
}
if (writev(f->f_file, iov, IOV_SIZE) < 0) {
int e = errno;
- (void)close(f->f_file);
+ close_filed(f);
if (f->f_un.f_pipe.f_pid > 0)
deadq_enter(f->f_un.f_pipe.f_pid,
f->f_un.f_pipe.f_pname);
@@ -1435,7 +1447,7 @@ reapchild(int signo __unused)
for (f = Files; f; f = f->f_next)
if (f->f_type == F_PIPE &&
f->f_un.f_pipe.f_pid == pid) {
- (void)close(f->f_file);
+ close_filed(f);
f->f_un.f_pipe.f_pid = 0;
log_deadchild(pid, status,
f->f_un.f_pipe.f_pname);
@@ -1539,7 +1551,7 @@ die(int signo)
if (f->f_prevcount)
fprintlog(f, 0, (char *)NULL);
if (f->f_type == F_PIPE && f->f_un.f_pipe.f_pid > 0) {
- (void)close(f->f_file);
+ close_filed(f);
f->f_un.f_pipe.f_pid = 0;
}
}
@@ -1605,11 +1617,11 @@ init(int signo)
case F_FORW:
case F_CONSOLE:
case F_TTY:
- (void)close(f->f_file);
+ close_filed(f);
break;
case F_PIPE:
if (f->f_un.f_pipe.f_pid > 0) {
- (void)close(f->f_file);
+ close_filed(f);
deadq_enter(f->f_un.f_pipe.f_pid,
f->f_un.f_pipe.f_pname);
}
diff --git a/usr.sbin/sysrc/sysrc b/usr.sbin/sysrc/sysrc
index 67b5e14..2a24551 100644
--- a/usr.sbin/sysrc/sysrc
+++ b/usr.sbin/sysrc/sysrc
@@ -40,7 +40,7 @@ BSDCFG_SHARE="/usr/share/bsdconfig"
#
# Version information
#
-SYSRC_VERSION="6.3 Mar-4,2015"
+SYSRC_VERSION="6.5 Sep-1,2015"
#
# Options
@@ -57,11 +57,11 @@ SHOW_EQUALS=
SHOW_FILE=
SHOW_NAME=1
SHOW_VALUE=1
-SYSRC_VERBOSE=
+VERBOSE=
############################################################ FUNCTIONS
-# die [ $fmt [ $opts ... ]]
+# die [$fmt [$opts ...]]
#
# Optionally print a message to stderr before exiting with failure status.
#
@@ -195,59 +195,81 @@ jail_depend()
cat $BSDCFG_SHARE/sysrc.subr
}
+# escape $string [$var_to_set]
+#
+# Escape $string contents so that the contents can be properly encapsulated in
+# single-quotes (making for safe evaluation).
+#
+# NB: See `bsdconfig includes -dF escape' for relevant information/discussion.
+# NB: Abridged version of `f_shell_escape()' from bsdconfig(8) `strings.subr'.
+#
+escape()
+{
+ local __start="$1" __var_to_set="$2" __string=
+ while [ "$__start" ]; do
+ case "$__start" in *\'*)
+ __string="$__string${__start%%\'*}'\\''"
+ __start="${__start#*\'}" continue
+ esac
+ break
+ done
+ __string="$__string$__start"
+ if [ "$__var_to_set" ]; then
+ setvar "$__var_to_set" "$__string"
+ else
+ echo "$__string"
+ fi
+}
+
############################################################ MAIN SOURCE
#
# Perform sanity checks
#
-[ $# -gt 0 ] || usage
+[ $# -gt 0 ] || usage # NOTREACHED
#
# Check for `--help' and `--version' command-line option
#
-( # Operate in sub-shell to protect $@ in parent
- while [ $# -gt 0 ]; do
- case "$1" in
- --help) help ;;
- --version) # see GLOBALS
- echo "$SYSRC_VERSION"
- exit 1 ;;
- -[fRj]) # These flags take an argument
- shift 1 ;;
- esac
- shift 1
- done
- exit 0
-) || die
+for arg in "$@"; do
+ case "$arg" in
+ --) break ;;
+ --help) help ;; # NOTREACHED
+ --version) # see GLOBALS
+ echo "$SYSRC_VERSION"
+ exit $FAILURE ;;
+ esac
+done
+unset arg
#
# Process command-line flags
#
while getopts aAcdDef:Fhij:nNqR:vxX flag; do
case "$flag" in
- a) SHOW_ALL=${SHOW_ALL:-1};;
- A) SHOW_ALL=2;;
- c) CHECK_ONLY=1;;
- d) DESCRIBE=1;;
- D) RC_CONFS=;;
- e) SHOW_EQUALS=1;;
- f) RC_CONFS="$RC_CONFS${RC_CONFS:+ }$OPTARG";;
- F) SHOW_FILE=1;;
- h) usage;;
- i) IGNORE_UNKNOWNS=1;;
- j) [ "$OPTARG" ] || die \
- "%s: Missing or null argument to \`-j' flag" "$pgm"
- JAIL="$OPTARG";;
- n) SHOW_NAME=;;
- N) SHOW_VALUE=;;
- q) QUIET=1 SYSRC_VERBOSE=;;
- R) [ "$OPTARG" ] || die \
- "%s: Missing or null argument to \`-R' flag" "$pgm"
- ROOTDIR="$OPTARG";;
- v) SYSRC_VERBOSE=1 QUIET=;;
- x) DELETE=${DELETE:-1};;
- X) DELETE=2;;
- \?) usage;;
+ a) SHOW_ALL=${SHOW_ALL:-1} ;;
+ A) SHOW_ALL=2 ;;
+ c) CHECK_ONLY=1 ;;
+ d) DESCRIBE=1 ;;
+ D) RC_CONFS= ;;
+ e) SHOW_EQUALS=1 ;;
+ f) RC_CONFS="$RC_CONFS${RC_CONFS:+ }$OPTARG" ;;
+ F) SHOW_FILE=1 ;;
+ h) usage ;; # NOTREACHED
+ i) IGNORE_UNKNOWNS=1 ;;
+ j) [ "$OPTARG" ] ||
+ die "%s: Missing or null argument to \`-j' flag" "$pgm"
+ JAIL="$OPTARG" ;;
+ n) SHOW_NAME= ;;
+ N) SHOW_VALUE= ;;
+ q) QUIET=1 VERBOSE= ;;
+ R) [ "$OPTARG" ] ||
+ die "%s: Missing or null argument to \`-R' flag" "$pgm"
+ ROOTDIR="$OPTARG" ;;
+ v) VERBOSE=1 QUIET= ;;
+ x) DELETE=${DELETE:-1} ;;
+ X) DELETE=2 ;;
+ \?) usage ;; # NOTREACHED
esac
done
shift $(( $OPTIND - 1 ))
@@ -255,7 +277,7 @@ shift $(( $OPTIND - 1 ))
#
# [More] Sanity checks (e.g., "sysrc --")
#
-[ $# -eq 0 -a ! "$SHOW_ALL" ] && usage
+[ $# -eq 0 -a ! "$SHOW_ALL" ] && usage # NOTREACHED
#
# Taint-check all rc.conf(5) files
@@ -300,7 +322,7 @@ fi
SEP=': '
[ "$SHOW_FILE" ] && SHOW_EQUALS=
[ "$SHOW_NAME" ] || SHOW_EQUALS=
-[ "$SYSRC_VERBOSE" = "0" ] && SYSRC_VERBOSE=
+[ "$VERBOSE" = "0" ] && VERBOSE=
if [ ! "$SHOW_VALUE" ]; then
SHOW_NAME=1
SHOW_EQUALS=
@@ -315,7 +337,7 @@ if [ "$JAIL" -o "$ROOTDIR" ]; then
# Reconstruct the arguments that we want to carry-over
#
args="
- ${SYSRC_VERBOSE:+-v}
+ ${VERBOSE:+-v}
${QUIET:+-q}
$( [ "$DELETE" = "1" ] && echo \ -x )
$( [ "$DELETE" = "2" ] && echo \ -X )
@@ -330,9 +352,12 @@ if [ "$JAIL" -o "$ROOTDIR" ]; then
$( [ "$SHOW_FILE" ] && echo \ -F )
"
if [ "${RC_CONFS+set}" ]; then
- args="$args -f '$RC_CONFS'"
+ escape "$RC_CONFS" _RC_CONFS
+ args="$args -f '$_RC_CONFS'"
+ unset _RC_CONFS
fi
for arg in "$@"; do
+ escape "$arg" arg
args="$args '$arg'"
done
@@ -359,13 +384,12 @@ if [ "$JAIL" -o "$ROOTDIR" ]; then
# jls(1) or jexec(8) utilities are missing.
#
if f_have jexec && f_have jls; then
- jid="`jls jid path | \
- (
+ jid=$( jls jid path |
while read JID JROOT; do
[ "$JROOT" = "$ROOTDIR" ] || continue
echo $JID
done
- )`"
+ )
#
# If multiple running jails match the specified root
@@ -431,7 +455,7 @@ if [ "$SHOW_ALL" ]; then
IFS="$IFS|"
EXCEPT="IFS|EXCEPT|PATH|RC_DEFAULTS|OPTIND|DESCRIBE|SEP"
EXCEPT="$EXCEPT|DELETE|SHOW_ALL|SHOW_EQUALS|SHOW_NAME"
- EXCEPT="$EXCEPT|SHOW_VALUE|SHOW_FILE|SYSRC_VERBOSE|RC_CONFS"
+ EXCEPT="$EXCEPT|SHOW_VALUE|SHOW_FILE|VERBOSE|RC_CONFS"
EXCEPT="$EXCEPT|pgm|SUCCESS|FAILURE|CHECK_ONLY"
EXCEPT="$EXCEPT|f_sysrc_desc_awk|f_sysrc_delete_awk"
@@ -447,8 +471,8 @@ if [ "$SHOW_ALL" ]; then
# If passed `-a' (rather than `-A'), re-purge the
# environment, removing the rc.conf(5) defaults.
#
- [ "$SHOW_ALL" = "1" ] \
- && f_clean_env --except rc_conf_files $EXCEPT
+ [ "$SHOW_ALL" = "1" ] &&
+ f_clean_env --except rc_conf_files $EXCEPT
#
# If `-f file' was passed, set $rc_conf_files to an
@@ -466,8 +490,7 @@ if [ "$SHOW_ALL" ]; then
#
[ "$SHOW_ALL" = "1" -a \
"$( f_sysrc_find rc_conf_files )" = "$RC_DEFAULTS" \
- ] \
- && unset rc_conf_files
+ ] && unset rc_conf_files
fi
for NAME in $( set |
@@ -499,7 +522,7 @@ if [ "$SHOW_ALL" ]; then
continue
fi
- [ "$SYSRC_VERBOSE" ] && \
+ [ "$VERBOSE" ] &&
echo -n "$( f_sysrc_find "$NAME" ): "
#
@@ -535,7 +558,7 @@ while [ $# -gt 0 ]; do
*) mode=ASSIGN
esac
- [ "$DESCRIBE" ] && \
+ [ "$DESCRIBE" ] &&
echo "$NAME: $( f_sysrc_desc "$NAME" )"
case "$1" in
@@ -546,9 +569,9 @@ while [ $# -gt 0 ]; do
#
# If verbose, prefix line with where the directive lives
- if [ "$SYSRC_VERBOSE" -a ! "$CHECK_ONLY" ]; then
+ if [ "$VERBOSE" -a ! "$CHECK_ONLY" ]; then
file=$( f_sysrc_find "$NAME" )
- [ "$file" = "$RC_DEFAULTS" -o ! "$file" ] && \
+ [ "$file" = "$RC_DEFAULTS" -o ! "$file" ] &&
file=$( f_sysrc_get 'rc_conf_files%%[$IFS]*' )
if [ "$SHOW_EQUALS" ]; then
echo -n ": $file; "
@@ -573,7 +596,7 @@ while [ $# -gt 0 ]; do
if [ "$CHECK_ONLY" ]; then
if ! IGNORED=$( f_sysrc_get "$NAME?" ); then
status=$FAILURE
- [ "$SYSRC_VERBOSE" ] &&
+ [ "$VERBOSE" ] &&
echo "$NAME: not currently set"
shift 1
continue
@@ -581,12 +604,12 @@ while [ $# -gt 0 ]; do
value=$( f_sysrc_get "$NAME" )
if [ "$value" != "${1#*=}" ]; then
status=$FAILURE
- if [ "$SYSRC_VERBOSE" ]; then
+ if [ "$VERBOSE" ]; then
echo -n "$( f_sysrc_find "$NAME" ): "
echo -n "$NAME: would change from "
echo "\`$value' to \`${1#*=}'"
fi
- elif [ "$SYSRC_VERBOSE" ]; then
+ elif [ "$VERBOSE" ]; then
echo -n "$( f_sysrc_find "$NAME" ): "
echo "$NAME: already set to \`$value'"
fi
@@ -642,7 +665,7 @@ while [ $# -gt 0 ]; do
unset remove delim oldIFS b add r
[ "$SHOW_FILE" ] && before=$( f_sysrc_find "$NAME" )
;;
- *)
+ *) # ASSIGN
if [ "$SHOW_FILE" ]; then
before=$( f_sysrc_find "$NAME" )
else
@@ -715,7 +738,7 @@ while [ $# -gt 0 ]; do
continue
fi
- if [ "$SYSRC_VERBOSE" ]; then
+ if [ "$VERBOSE" ]; then
if [ "$SHOW_EQUALS" ]; then
echo -n ": $( f_sysrc_find "$NAME" ); "
else
diff --git a/usr.sbin/sysrc/sysrc.8 b/usr.sbin/sysrc/sysrc.8
index 31254d4..2634e31 100644
--- a/usr.sbin/sysrc/sysrc.8
+++ b/usr.sbin/sysrc/sysrc.8
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd March 4, 2015
+.Dd September 2, 2015
.Dt SYSRC 8
.Os
.Sh NAME
@@ -199,8 +199,8 @@ syntax to add items to existing values,
the first character of the value is taken as the delimiter separating items
.Pq usually Qo \ Qc or Qo , Qc .
For example, in the following statement:
-.Bl -tag -width indent+
-.It \
+.Bl -item -offset indent
+.It
.Nm
cloned_interfaces+=" gif0"
.El
@@ -223,26 +223,25 @@ For example, the above and below statements are equivalent since
.Dq gif0
starts with an alpha-numeric character
.Pq the letter Li g :
-.Pp
-.Bl -tag -width indent+
-.It \
+.Bl -item -offset indent
+.It
.Nm
cloned_interfaces+=gif0
.El
.Pp
Take the following sequence for example:
-.Bl -tag -width indent+
-.It \
+.Bl -item -offset indent
+.It
.Nm
cloned_interfaces= # start with NULL
-.It \
+.It
.Nm
cloned_interfaces+=gif0
.Dl # NULL -> `gif0' Pq NB: no preceding delimiter
-.It \
+.It
.Nm
cloned_interfaces+=gif0 # no change
-.It \
+.It
.Nm
cloned_interfaces+="tun0 gif0"
.Dl # `gif0' -> `gif0 tun0' Pq NB: no duplication
@@ -278,22 +277,21 @@ For example, the above and below statements are equivalent since
.Dq gif0
starts with an alpha-numeric character
.Pq the letter Li g :
-.Pp
-.Bl -tag -width indent+
-.It \
+.Bl -item -offset indent
+.It
.Nm
cloned_interfaces-=gif0
.El
.Pp
Take the following sequence for example:
-.Bl -tag -width indent+
-.It \
+.Bl -item -offset indent
+.It
.Nm
foo="bar baz" # start
-.It \
+.It
.Nm
foo-=bar # `bar baz' -> `baz'
-.It \
+.It
.Nm
foo-=baz # `baz' -> NULL
.El
@@ -396,27 +394,6 @@ usbd_flags-"default"
.Nm
cloned_interfaces+"alternate"
.Dl returns "alternate" if $cloned_interfaces is set .
-.Pp
-.Nm
-\&'#kern_securelevel'
-.Dl returns length in characters of $kern_securelevel .
-.Pp
-.Nm
-\&'hostname?'
-.Dl returns NULL and error status 2 if $hostname is unset Pq or if set, returns the value of $hostname with no error status .
-.Pp
-.Nm
-\&'hostname:?'
-.Dl returns NULL and error status 2 if $hostname is unset or NULL Pq or if set and non-NULL, returns value without error status .
-.Sh LIMITATIONS
-The
-.Nm
-utility presently does not support the
-.Ql rc.conf.d
-collection of system configuration files
-.Pq which requires a service name to be known during execution .
-.Pp
-This will be corrected by a future enhancement.
.Sh SEE ALSO
.Xr jls 1 ,
.Xr rc.conf 5 ,
diff --git a/usr.sbin/watch/watch.c b/usr.sbin/watch/watch.c
index eecf0d3..766d45a 100644
--- a/usr.sbin/watch/watch.c
+++ b/usr.sbin/watch/watch.c
@@ -247,7 +247,7 @@ set_dev(const char *name)
if ((sb.st_mode & S_IFMT) != S_IFCHR)
fatal(EX_DATAERR, "must be a character device");
- strncpy(dev_name, buf, DEV_NAME_LEN);
+ strlcpy(dev_name, buf, sizeof(dev_name));
attach_snp();
}
@@ -340,7 +340,7 @@ main(int ac, char *av[])
else
fatal(EX_DATAERR, "no device name given");
} else
- strncpy(dev_name, *av, DEV_NAME_LEN);
+ strlcpy(dev_name, *av, sizeof(dev_name));
set_dev(dev_name);
OpenPOWER on IntegriCloud