[Zrouter-src-freebsd] ZRouter.org: push to FreeBSD HEAD tree

zrouter-src-freebsd at zrouter.org zrouter-src-freebsd at zrouter.org
Fri Mar 2 15:38:47 UTC 2012


details:   http://zrouter.org/hg/FreeBSD/head//rev/ea1903d719a7
changeset: 374:ea1903d719a7
user:      ray at terran.dlink.ua
date:      Fri Mar 02 17:04:50 2012 +0200
description:
Update to FreeBSD-HEAD @232391

diffstat:

 head/usr.sbin/IPXrouted/tables.c                           |    6 +-
 head/usr.sbin/Makefile                                     |    4 +-
 head/usr.sbin/acpi/Makefile.inc                            |   26 +-
 head/usr.sbin/acpi/acpidb/Makefile                         |   44 +-
 head/usr.sbin/acpi/iasl/Makefile                           |   24 +-
 head/usr.sbin/adduser/adduser.sh                           |    3 +-
 head/usr.sbin/amd/Makefile.inc                             |    4 +-
 head/usr.sbin/boot0cfg/boot0cfg.8                          |   11 +-
 head/usr.sbin/bootparamd/bootparamd/Makefile               |    8 +-
 head/usr.sbin/bootparamd/callbootd/Makefile                |    8 +-
 head/usr.sbin/bsdinstall/distextract/distextract.c         |   11 +-
 head/usr.sbin/bsdinstall/distfetch/distfetch.c             |   11 +-
 head/usr.sbin/bsnmpd/modules/snmp_netgraph/snmp_netgraph.3 |    4 +-
 head/usr.sbin/cron/crontab/crontab.c                       |   35 +-
 head/usr.sbin/daemon/daemon.8                              |   39 ++-
 head/usr.sbin/daemon/daemon.c                              |  143 +++++++++-
 head/usr.sbin/gpioctl/gpioctl.8                            |    6 -
 head/usr.sbin/gssd/Makefile                                |    4 +-
 head/usr.sbin/jail/jail.8                                  |   56 ++++-
 head/usr.sbin/keyserv/Makefile                             |    4 +-
 head/usr.sbin/lpr/lpc/cmds.c                               |    8 +-
 head/usr.sbin/periodic/periodic.sh                         |  161 +++++++----
 head/usr.sbin/pkg_install/create/perform.c                 |   14 +-
 head/usr.sbin/ppp/auth.c                                   |    6 +-
 head/usr.sbin/pw/cpdir.c                                   |    4 +-
 head/usr.sbin/pw/pw_user.c                                 |    8 +-
 head/usr.sbin/rpc.lockd/Makefile                           |    4 +-
 head/usr.sbin/rpc.statd/Makefile                           |    4 +-
 head/usr.sbin/rpc.yppasswdd/Makefile                       |    4 +-
 head/usr.sbin/rpc.yppasswdd/yppasswdd_server.c             |    7 +-
 head/usr.sbin/rpc.ypupdated/Makefile                       |    4 +-
 head/usr.sbin/rpc.ypxfrd/Makefile                          |    4 +-
 head/usr.sbin/sendmail/Makefile                            |    6 +-
 head/usr.sbin/tzsetup/tzsetup.8                            |    4 +-
 head/usr.sbin/tzsetup/tzsetup.c                            |    6 +-
 head/usr.sbin/usbdump/usbdump.8                            |   20 +-
 head/usr.sbin/usbdump/usbdump.c                            |  170 ++++++++++++-
 head/usr.sbin/utx/Makefile                                 |    9 +
 head/usr.sbin/utx/utx.8                                    |  107 ++++++++
 head/usr.sbin/utx/utx.c                                    |  114 ++++++++
 head/usr.sbin/utxrm/Makefile                               |    6 -
 head/usr.sbin/utxrm/utxrm.8                                |   72 -----
 head/usr.sbin/utxrm/utxrm.c                                |   84 ------
 head/usr.sbin/vipw/vipw.8                                  |    9 +-
 head/usr.sbin/wake/wake.c                                  |   23 +-
 head/usr.sbin/wpa/hostapd/hostapd.8                        |    3 +-
 head/usr.sbin/yppush/Makefile                              |    4 +-
 head/usr.sbin/ypserv/Makefile                              |    4 +-
 48 files changed, 896 insertions(+), 424 deletions(-)

diffs (2392 lines):

diff -r a085b3559102 -r ea1903d719a7 head/usr.sbin/IPXrouted/tables.c
--- a/head/usr.sbin/IPXrouted/tables.c	Fri Mar 02 17:02:21 2012 +0200
+++ b/head/usr.sbin/IPXrouted/tables.c	Fri Mar 02 17:04:50 2012 +0200
@@ -32,7 +32,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD$
+ * $FreeBSD: head/usr.sbin/IPXrouted/tables.c 231817 2012-02-16 05:17:06Z eadler $
  */
 
 #ifndef lint
@@ -172,7 +172,6 @@
 {
 	struct afhash h;
 	register struct rt_entry *rt;
-	struct rthash *rh;
 	int af = dst->sa_family, flags;
 	u_int hash;
 
@@ -183,7 +182,6 @@
 	(*afswitch[af].af_hash)(dst, &h);
 	flags = (*afswitch[af].af_ishost)(dst) ? RTF_HOST : 0;
 	hash = h.afh_nethash;
-	rh = &nethash[hash & ROUTEHASHMASK];
 	rt = (struct rt_entry *)malloc(sizeof (*rt));
 	if (rt == 0)
 		return;
@@ -213,7 +211,6 @@
     short ticks)
 {
 	int doioctl = 0, metricchanged = 0;
-	struct rtuentry oldroute;
 
 	FIXLEN(gate);
 	/*
@@ -281,7 +278,6 @@
 	if (doioctl || metricchanged) {
 		TRACE_ACTION("CHANGE FROM", rt);
 		if (doioctl) {
-			oldroute = rt->rt_rt;
 			rt->rt_router = *gate;
 		}
 		rt->rt_metric = metric;
diff -r a085b3559102 -r ea1903d719a7 head/usr.sbin/Makefile
--- a/head/usr.sbin/Makefile	Fri Mar 02 17:02:21 2012 +0200
+++ b/head/usr.sbin/Makefile	Fri Mar 02 17:04:50 2012 +0200
@@ -1,5 +1,5 @@
 #	From: @(#)Makefile	5.20 (Berkeley) 6/12/93
-# $FreeBSD: head/usr.sbin/Makefile 229997 2012-01-12 00:34:33Z ken $
+# $FreeBSD: head/usr.sbin/Makefile 231530 2012-02-11 20:28:42Z ed $
 
 .include <bsd.own.mk>
 
@@ -306,7 +306,7 @@
 .if ${MK_UTMPX} != "no"
 SUBDIR+=	ac
 SUBDIR+=	lastlogin
-SUBDIR+=	utxrm
+SUBDIR+=	utx
 .endif
 
 .if ${MK_WIRELESS} != "no"
diff -r a085b3559102 -r ea1903d719a7 head/usr.sbin/acpi/Makefile.inc
--- a/head/usr.sbin/acpi/Makefile.inc	Fri Mar 02 17:02:21 2012 +0200
+++ b/head/usr.sbin/acpi/Makefile.inc	Fri Mar 02 17:04:50 2012 +0200
@@ -1,5 +1,5 @@
 # $Id: Makefile.inc,v 1.1 2000/07/14 18:16:22 iwasaki Exp $
-# $FreeBSD: head/usr.sbin/acpi/Makefile.inc 228110 2011-11-28 23:36:48Z jkim $
+# $FreeBSD: head/usr.sbin/acpi/Makefile.inc 231845 2012-02-16 23:05:09Z jkim $
 
 ACPICA_DIR= ${.CURDIR}/../../../sys/contrib/dev/acpica
 CFLAGS+= -I${.CURDIR}/../../../sys
@@ -11,15 +11,15 @@
 .PATH:	${ACPICA_DIR}					\
 	${ACPICA_DIR}/common				\
 	${ACPICA_DIR}/compiler				\
-	${ACPICA_DIR}/debugger				\
-	${ACPICA_DIR}/disassembler			\
-	${ACPICA_DIR}/dispatcher			\
-	${ACPICA_DIR}/events				\
-	${ACPICA_DIR}/executer				\
-	${ACPICA_DIR}/hardware				\
-	${ACPICA_DIR}/namespace				\
-	${ACPICA_DIR}/os_specific/service_layers	\
-	${ACPICA_DIR}/parser				\
-	${ACPICA_DIR}/resources				\
-	${ACPICA_DIR}/tables				\
-	${ACPICA_DIR}/utilities
+	${ACPICA_DIR}/components/debugger		\
+	${ACPICA_DIR}/components/disassembler		\
+	${ACPICA_DIR}/components/dispatcher		\
+	${ACPICA_DIR}/components/events			\
+	${ACPICA_DIR}/components/executer		\
+	${ACPICA_DIR}/components/hardware		\
+	${ACPICA_DIR}/components/namespace		\
+	${ACPICA_DIR}/components/parser			\
+	${ACPICA_DIR}/components/resources		\
+	${ACPICA_DIR}/components/tables			\
+	${ACPICA_DIR}/components/utilities		\
+	${ACPICA_DIR}/os_specific/service_layers
diff -r a085b3559102 -r ea1903d719a7 head/usr.sbin/acpi/acpidb/Makefile
--- a/head/usr.sbin/acpi/acpidb/Makefile	Fri Mar 02 17:02:21 2012 +0200
+++ b/head/usr.sbin/acpi/acpidb/Makefile	Fri Mar 02 17:04:50 2012 +0200
@@ -1,60 +1,60 @@
-# $FreeBSD: head/usr.sbin/acpi/acpidb/Makefile 230089 2012-01-13 22:16:47Z jkim $
+# $FreeBSD: head/usr.sbin/acpi/acpidb/Makefile 231844 2012-02-16 22:59:29Z jkim $
 
 PROG=	acpidb
 SRCS=	acpidb.c
 
-# debugger
+# components/debugger
 SRCS+=	dbcmds.c dbdisply.c dbexec.c dbfileio.c dbhistry.c	\
 	dbinput.c dbmethod.c dbnames.c dbstats.c dbutils.c	\
 	dbxface.c
 
-# disassembler
+# components/disassembler
 SRCS+=	dmbuffer.c dmnames.c dmobject.c dmopcode.c dmresrc.c	\
 	dmresrcl.c dmresrcl2.c dmresrcs.c dmutils.c dmwalk.c
 
-# events
+# components/dispatcher
+SRCS+=	dsargs.c dscontrol.c dsfield.c dsinit.c dsmethod.c	\
+	dsmthdat.c dsobject.c dsopcode.c dsutils.c dswexec.c	\
+	dswload.c dswload2.c dswscope.c dswstate.c
+
+# components/events
 SRCS+=	evevent.c evglock.c evgpe.c evgpeblk.c evgpeinit.c	\
 	evgpeutil.c evmisc.c evregion.c evrgnini.c evsci.c	\
 	evxface.c evxfevnt.c evxfregn.c
 
-# hardware
-SRCS+=	hwacpi.c hwgpe.c hwpci.c hwregs.c hwsleep.c hwvalid.c	\
-	hwxface.c
-
-# interpreter/dispatcher
-SRCS+=	dsargs.c dscontrol.c dsfield.c dsinit.c dsmethod.c	\
-	dsmthdat.c dsobject.c dsopcode.c dsutils.c dswexec.c	\
-	dswload.c dswload2.c dswscope.c dswstate.c
-
-# interpreter/executer
+# components/executer
 SRCS+=	exconfig.c exconvrt.c excreate.c exdebug.c exdump.c	\
 	exfield.c exfldio.c exmisc.c exmutex.c exnames.c	\
 	exoparg1.c exoparg2.c exoparg3.c exoparg6.c exprep.c	\
 	exregion.c exresnte.c exresolv.c exresop.c exstore.c	\
 	exstoren.c exstorob.c exsystem.c exutils.c
 
-# interpreter/parser
-SRCS+=	psargs.c psloop.c psopcode.c psparse.c psscope.c	\
-	pstree.c psutils.c pswalk.c psxface.c
+# components/hardware
+SRCS+=	hwacpi.c hwesleep.c hwgpe.c hwpci.c hwregs.c hwsleep.c	\
+	hwvalid.c hwxface.c hwxfsleep.c
 
-# namespace
+# components/namespace
 SRCS+=	nsaccess.c nsalloc.c nsdump.c nseval.c nsinit.c		\
 	nsload.c nsnames.c nsobject.c nsparse.c nspredef.c	\
 	nsrepair.c nsrepair2.c nssearch.c nsutils.c nswalk.c	\
 	nsxfeval.c nsxfname.c nsxfobj.c
 
-# os_specific/service_layers
+# components/parser
+SRCS+=	psargs.c psloop.c psopcode.c psparse.c psscope.c	\
+	pstree.c psutils.c pswalk.c psxface.c
+
+# components/os_specific/service_layers
 SRCS+=	osunixxf.c
 
-# resources
+# components/resources
 SRCS+=	rsaddr.c rscalc.c rscreate.c rsdump.c rsinfo.c		\
 	rsio.c rsirq.c rslist.c rsmemory.c rsmisc.c		\
 	rsserial.c rsutils.c rsxface.c
 
-# tables
+# components/tables
 SRCS+=	tbfadt.c tbfind.c tbinstal.c tbutils.c tbxface.c
 
-# utilities
+# components/utilities
 SRCS+=	utaddress.c utalloc.c utcache.c utcopy.c utdebug.c	\
 	utdecode.c utdelete.c uteval.c utglobal.c utids.c	\
 	utinit.c utlock.c utmath.c utmisc.c utmutex.c		\
diff -r a085b3559102 -r ea1903d719a7 head/usr.sbin/acpi/iasl/Makefile
--- a/head/usr.sbin/acpi/iasl/Makefile	Fri Mar 02 17:02:21 2012 +0200
+++ b/head/usr.sbin/acpi/iasl/Makefile	Fri Mar 02 17:04:50 2012 +0200
@@ -1,4 +1,4 @@
-# $FreeBSD: head/usr.sbin/acpi/iasl/Makefile 230089 2012-01-13 22:16:47Z jkim $
+# $FreeBSD: head/usr.sbin/acpi/iasl/Makefile 231844 2012-02-16 22:59:29Z jkim $
 
 PROG=	iasl
 SRCS=	adfile.c adisasm.c adwalk.c
@@ -22,44 +22,44 @@
 	dtparserparse.c dtsubtable.c dttable.c dttemplate.c	\
 	dtutils.c
 
-# debugger
+# components/debugger
 SRCS+=	dbfileio.c
 
-# disassembler
+# components/disassembler
 SRCS+=	dmbuffer.c dmnames.c dmopcode.c dmresrc.c dmresrcl.c	\
 	dmresrcl2.c dmresrcs.c dmutils.c dmwalk.c
 
-# interpreter/dispatcher
+# components/dispatcher
 SRCS+=	dsargs.c dscontrol.c dsfield.c dsobject.c dsopcode.c	\
 	dsutils.c dswexec.c dswload.c dswload2.c dswscope.c	\
 	dswstate.c
 
-# interpreter/executer
+# components/executer
 SRCS+=	exconvrt.c excreate.c exdump.c exmisc.c exmutex.c	\
 	exnames.c exoparg1.c exoparg2.c exoparg3.c exoparg6.c	\
 	exprep.c exresnte.c exresolv.c exresop.c exstore.c	\
 	exstoren.c exstorob.c exsystem.c exutils.c
 
-# interpreter/parser
+# components/parser
 SRCS+=	psargs.c psloop.c psopcode.c psparse.c psscope.c	\
 	pstree.c psutils.c pswalk.c
 
-# namespace
+# components/namespace
 SRCS+=	nsaccess.c nsalloc.c nsdump.c nsnames.c nsobject.c	\
 	nsparse.c nssearch.c nsutils.c nswalk.c
 
-# os_specific/service_layers
-SRCS+=	osunixxf.c
-
-# tables
+# components/tables
 SRCS+=	tbfadt.c tbinstal.c tbutils.c tbxface.c
 
-# utilities
+# components/utilities
 SRCS+=	utaddress.c utalloc.c utcache.c utcopy.c utdebug.c	\
 	utdecode.c utdelete.c utglobal.c utinit.c utlock.c	\
 	utmath.c utmisc.c utmutex.c utobject.c utresrc.c	\
 	utstate.c utxface.c utxferror.c
 
+# os_specific/service_layers
+SRCS+=	osunixxf.c
+
 WARNS?=	2
 
 MAN=	iasl.8
diff -r a085b3559102 -r ea1903d719a7 head/usr.sbin/adduser/adduser.sh
--- a/head/usr.sbin/adduser/adduser.sh	Fri Mar 02 17:02:21 2012 +0200
+++ b/head/usr.sbin/adduser/adduser.sh	Fri Mar 02 17:04:50 2012 +0200
@@ -24,7 +24,7 @@
 #
 #       Email: Mike Makonnen <mtm at FreeBSD.Org>
 #
-# $FreeBSD: head/usr.sbin/adduser/adduser.sh 228990 2011-12-30 10:58:14Z uqs $
+# $FreeBSD: head/usr.sbin/adduser/adduser.sh 232146 2012-02-25 07:58:59Z deischen $
 #
 
 # err msg
@@ -488,6 +488,7 @@
 	_prompt=
 
 	if [ -n "$uuid" ]; then
+		uuid=`get_nextuid $uuid`
 		_prompt="Uid [$uuid]: "
 	else
 		_prompt="Uid (Leave empty for default): "
diff -r a085b3559102 -r ea1903d719a7 head/usr.sbin/amd/Makefile.inc
--- a/head/usr.sbin/amd/Makefile.inc	Fri Mar 02 17:02:21 2012 +0200
+++ b/head/usr.sbin/amd/Makefile.inc	Fri Mar 02 17:04:50 2012 +0200
@@ -1,6 +1,6 @@
 # ex:ts=8
 #
-# $FreeBSD$
+# $FreeBSD: head/usr.sbin/amd/Makefile.inc 231118 2012-02-07 09:27:07Z dim $
 #
 # Makefile for amd
 # 	This file is under a "BSD" copyright (c) by David O'Brien 1998.
@@ -36,7 +36,7 @@
 .endif
 LIBAMU=		${LIBAMUDIR}/libamu.a
 
-RPCCOM=		rpcgen
+RPCCOM=		RPCGEN_CPP=${CPP:Q} rpcgen
 MOUNT_X=	${DESTDIR}/usr/include/rpcsvc/mount.x
 NFS_PROT_X=	${DESTDIR}/usr/include/rpcsvc/nfs_prot.x
 
diff -r a085b3559102 -r ea1903d719a7 head/usr.sbin/boot0cfg/boot0cfg.8
--- a/head/usr.sbin/boot0cfg/boot0cfg.8	Fri Mar 02 17:02:21 2012 +0200
+++ b/head/usr.sbin/boot0cfg/boot0cfg.8	Fri Mar 02 17:04:50 2012 +0200
@@ -22,9 +22,9 @@
 .\" OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
 .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.\" $FreeBSD: head/usr.sbin/boot0cfg/boot0cfg.8 228738 2011-12-20 15:19:29Z jhb $
+.\" $FreeBSD: head/usr.sbin/boot0cfg/boot0cfg.8 230978 2012-02-04 13:12:52Z kib $
 .\"
-.Dd November 7, 2011
+.Dd February 4, 2012
 .Dt BOOT0CFG 8
 .Os
 .Sh NAME
@@ -114,6 +114,9 @@
 .Ar mask
 is an integer between 0 (no slices enabled) and 0xf (all four slices
 enabled).
+Each mask bit enables corresponding slice if set to 1.
+The least significant bit of the mask corresponds to slice 1,
+the most significant bit of the mask corresponds to slice 4.
 .It Fl o Ar options
 A comma-separated string of any of the following options may be
 specified (with
@@ -172,9 +175,9 @@
 .Pp
 .Dl "boot0cfg -s 2 ad0"
 .Pp
-To enable just slices 1 and 2 in the menu:
+To enable just slices 1 and 3 in the menu:
 .Pp
-.Dl "boot0cfg -m 0x3 ad0"
+.Dl "boot0cfg -m 0x5 ad0"
 .Pp
 To go back to non-interactive booting, use
 .Xr fdisk 8
diff -r a085b3559102 -r ea1903d719a7 head/usr.sbin/bootparamd/bootparamd/Makefile
--- a/head/usr.sbin/bootparamd/bootparamd/Makefile	Fri Mar 02 17:02:21 2012 +0200
+++ b/head/usr.sbin/bootparamd/bootparamd/Makefile	Fri Mar 02 17:04:50 2012 +0200
@@ -1,5 +1,5 @@
 #	from: @(#)Makefile	5.8 (Berkeley) 7/28/90
-# $FreeBSD$
+# $FreeBSD: head/usr.sbin/bootparamd/bootparamd/Makefile 231118 2012-02-07 09:27:07Z dim $
 
 .include <bsd.own.mk>
 
@@ -18,12 +18,12 @@
 RPCSRC=	${DESTDIR}/usr/include/rpcsvc/bootparam_prot.x
 
 bootparam_prot_svc.c: ${RPCSRC}
-	rpcgen -C -m -o ${.TARGET} ${RPCSRC}
+	RPCGEN_CPP=${CPP:Q} rpcgen -C -m -o ${.TARGET} ${RPCSRC}
 
 bootparam_prot_xdr.c: ${RPCSRC}
-	rpcgen -C -c -o ${.TARGET} ${RPCSRC}
+	RPCGEN_CPP=${CPP:Q} rpcgen -C -c -o ${.TARGET} ${RPCSRC}
 
 bootparam_prot.h: ${RPCSRC}
-	rpcgen -C -h -o ${.TARGET} ${RPCSRC}
+	RPCGEN_CPP=${CPP:Q} rpcgen -C -h -o ${.TARGET} ${RPCSRC}
 
 .include <bsd.prog.mk>
diff -r a085b3559102 -r ea1903d719a7 head/usr.sbin/bootparamd/callbootd/Makefile
--- a/head/usr.sbin/bootparamd/callbootd/Makefile	Fri Mar 02 17:02:21 2012 +0200
+++ b/head/usr.sbin/bootparamd/callbootd/Makefile	Fri Mar 02 17:04:50 2012 +0200
@@ -1,5 +1,5 @@
 #	from: @(#)Makefile	5.8 (Berkeley) 7/28/90
-# $FreeBSD$
+# $FreeBSD: head/usr.sbin/bootparamd/callbootd/Makefile 231118 2012-02-07 09:27:07Z dim $
 
 PROG=	callbootd
 NO_MAN=
@@ -13,12 +13,12 @@
 RPCSRC=	${DESTDIR}/usr/include/rpcsvc/bootparam_prot.x
 
 bootparam_prot_clnt.c: ${RPCSRC}
-	rpcgen -C -l -o ${.TARGET} ${RPCSRC}
+	RPCGEN_CPP=${CPP:Q} rpcgen -C -l -o ${.TARGET} ${RPCSRC}
 
 bootparam_prot_xdr.c: ${RPCSRC}
-	rpcgen -C -c -o ${.TARGET} ${RPCSRC}
+	RPCGEN_CPP=${CPP:Q} rpcgen -C -c -o ${.TARGET} ${RPCSRC}
 
 bootparam_prot.h: ${RPCSRC}
-	rpcgen -C -h -o ${.TARGET} ${RPCSRC}
+	RPCGEN_CPP=${CPP:Q} rpcgen -C -h -o ${.TARGET} ${RPCSRC}
 
 .include <bsd.prog.mk>
diff -r a085b3559102 -r ea1903d719a7 head/usr.sbin/bsdinstall/distextract/distextract.c
--- a/head/usr.sbin/bsdinstall/distextract/distextract.c	Fri Mar 02 17:02:21 2012 +0200
+++ b/head/usr.sbin/bsdinstall/distextract/distextract.c	Fri Mar 02 17:04:50 2012 +0200
@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: head/usr.sbin/bsdinstall/distextract/distextract.c 228048 2011-11-28 05:34:16Z kevlo $
+ * $FreeBSD: head/usr.sbin/bsdinstall/distextract/distextract.c 232200 2012-02-26 22:09:21Z nwhitehorn $
  */
 
 #include <sys/param.h>
@@ -38,9 +38,16 @@
 int
 main(void)
 {
-	char *diststring = strdup(getenv("DISTRIBUTIONS"));
+	char *diststring;
 	const char **dists;
 	int i, retval, ndists = 0;
+
+	if (getenv("DISTRIBUTIONS") == NULL) {
+		fprintf(stderr, "DISTRIBUTIONS variable is not set\n");
+		return (1);
+	}
+
+	diststring = strdup(getenv("DISTRIBUTIONS"));
 	for (i = 0; diststring[i] != 0; i++)
 		if (isspace(diststring[i]) && !isspace(diststring[i+1]))
 			ndists++;
diff -r a085b3559102 -r ea1903d719a7 head/usr.sbin/bsdinstall/distfetch/distfetch.c
--- a/head/usr.sbin/bsdinstall/distfetch/distfetch.c	Fri Mar 02 17:02:21 2012 +0200
+++ b/head/usr.sbin/bsdinstall/distfetch/distfetch.c	Fri Mar 02 17:04:50 2012 +0200
@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: head/usr.sbin/bsdinstall/distfetch/distfetch.c 228048 2011-11-28 05:34:16Z kevlo $
+ * $FreeBSD: head/usr.sbin/bsdinstall/distfetch/distfetch.c 232200 2012-02-26 22:09:21Z nwhitehorn $
  */
 
 #include <sys/param.h>
@@ -37,9 +37,16 @@
 int
 main(void)
 {
-	char *diststring = strdup(getenv("DISTRIBUTIONS"));
+	char *diststring;
 	char **urls;
 	int i, nfetched, ndists = 0;
+
+	if (getenv("DISTRIBUTIONS") == NULL) {
+		fprintf(stderr, "DISTRIBUTIONS variable is not set\n");
+		return (1);
+	}
+
+	diststring = strdup(getenv("DISTRIBUTIONS"));
 	for (i = 0; diststring[i] != 0; i++)
 		if (isspace(diststring[i]) && !isspace(diststring[i+1]))
 			ndists++;
diff -r a085b3559102 -r ea1903d719a7 head/usr.sbin/bsnmpd/modules/snmp_netgraph/snmp_netgraph.3
--- a/head/usr.sbin/bsnmpd/modules/snmp_netgraph/snmp_netgraph.3	Fri Mar 02 17:02:21 2012 +0200
+++ b/head/usr.sbin/bsnmpd/modules/snmp_netgraph/snmp_netgraph.3	Fri Mar 02 17:04:50 2012 +0200
@@ -27,7 +27,7 @@
 .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
 .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.\" $FreeBSD$
+.\" $FreeBSD: head/usr.sbin/bsnmpd/modules/snmp_netgraph/snmp_netgraph.3 231564 2012-02-12 18:29:56Z ed $
 .\"
 .Dd November 14, 2003
 .Dt SNMP_NETGRAPH 3
@@ -78,7 +78,7 @@
 .Ft typedef void
 .Fn ng_hook_f "const char *hook" "const u_char *mesg" "size_t len" "void *uarg"
 .Ft void *
-.Fn ng_register_cookie "const struct lmodule *mod" "u_int32_t cookie" "ng_ID_t id" "ng_cookie_f *func" "void *uarg"
+.Fn ng_register_cookie "const struct lmodule *mod" "uint32_t cookie" "ng_ID_t id" "ng_cookie_f *func" "void *uarg"
 .Ft void
 .Fn ng_unregister_cookie "void *reg"
 .Ft void *
diff -r a085b3559102 -r ea1903d719a7 head/usr.sbin/cron/crontab/crontab.c
--- a/head/usr.sbin/cron/crontab/crontab.c	Fri Mar 02 17:02:21 2012 +0200
+++ b/head/usr.sbin/cron/crontab/crontab.c	Fri Mar 02 17:04:50 2012 +0200
@@ -18,7 +18,7 @@
 
 #if !defined(lint) && !defined(LINT)
 static const char rcsid[] =
-  "$FreeBSD$";
+  "$FreeBSD: head/usr.sbin/cron/crontab/crontab.c 232202 2012-02-27 05:49:00Z delphij $";
 #endif
 
 /* crontab - install and manage per-user crontab files
@@ -194,6 +194,17 @@
 	}
 
 	if (Option == opt_replace) {
+		/* relinquish the setuid status of the binary during
+		 * the open, lest nonroot users read files they should
+		 * not be able to read.  we can't use access() here
+		 * since there's a race condition.  thanks go out to
+		 * Arnt Gulbrandsen <agulbra at pvv.unit.no> for spotting
+		 * the race.
+		 */
+
+		if (swap_uids() < OK)
+			err(ERROR_EXIT, "swapping uids");
+
 		/* we have to open the file here because we're going to
 		 * chdir(2) into /var/cron before we get around to
 		 * reading the file.
@@ -204,21 +215,11 @@
 		    !strcmp(resolved_path, SYSCRONTAB)) {
 			err(ERROR_EXIT, SYSCRONTAB " must be edited manually");
 		} else {
-			/* relinquish the setuid status of the binary during
-			 * the open, lest nonroot users read files they should
-			 * not be able to read.  we can't use access() here
-			 * since there's a race condition.  thanks go out to
-			 * Arnt Gulbrandsen <agulbra at pvv.unit.no> for spotting
-			 * the race.
-			 */
-
-			if (swap_uids() < OK)
-				err(ERROR_EXIT, "swapping uids");
 			if (!(NewCrontab = fopen(Filename, "r")))
 				err(ERROR_EXIT, "%s", Filename);
-			if (swap_uids_back() < OK)
-				err(ERROR_EXIT, "swapping uids back");
 		}
+		if (swap_uids_back() < OK)
+			err(ERROR_EXIT, "swapping uids back");
 	}
 
 	Debug(DMISC, ("user=%s, file=%s, option=%s\n",
@@ -363,11 +364,15 @@
 		goto fatal;
 	}
  again:
+	if (swap_uids() < OK)
+		err(ERROR_EXIT, "swapping uids");
 	if (stat(Filename, &statbuf) < 0) {
 		warn("stat");
  fatal:		unlink(Filename);
 		exit(ERROR_EXIT);
 	}
+	if (swap_uids_back() < OK)
+		err(ERROR_EXIT, "swapping uids back");
 	if (statbuf.st_dev != fsbuf.st_dev || statbuf.st_ino != fsbuf.st_ino)
 		errx(ERROR_EXIT, "temp file must be edited in place");
 	if (MD5File(Filename, orig_md5) == NULL) {
@@ -433,6 +438,8 @@
 			editor, WTERMSIG(waiter), WCOREDUMP(waiter) ?"" :"no ");
 		goto fatal;
 	}
+	if (swap_uids() < OK)
+		err(ERROR_EXIT, "swapping uids");
 	if (stat(Filename, &statbuf) < 0) {
 		warn("stat");
 		goto fatal;
@@ -443,6 +450,8 @@
 		warn("MD5");
 		goto fatal;
 	}
+	if (swap_uids_back() < OK)
+		err(ERROR_EXIT, "swapping uids back");
 	if (strcmp(orig_md5, new_md5) == 0 && !syntax_error) {
 		warnx("no changes made to crontab");
 		goto remove;
diff -r a085b3559102 -r ea1903d719a7 head/usr.sbin/daemon/daemon.8
--- a/head/usr.sbin/daemon/daemon.8	Fri Mar 02 17:02:21 2012 +0200
+++ b/head/usr.sbin/daemon/daemon.8	Fri Mar 02 17:04:50 2012 +0200
@@ -24,9 +24,9 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\" $FreeBSD: head/usr.sbin/daemon/daemon.8 230541 2012-01-25 14:50:12Z ghelmer $
+.\" $FreeBSD: head/usr.sbin/daemon/daemon.8 231911 2012-02-19 10:36:29Z trociny $
 .\"
-.Dd March 19, 2007
+.Dd February 19, 2012
 .Dt DAEMON 8
 .Os
 .Sh NAME
@@ -59,17 +59,40 @@
 using the
 .Xr pidfile 3
 functionality.
-If the
+The program is executed in a spawned child process while the
+.Nm
+waits until it terminates to keep the
+.Ar file
+locked and removes it after the process exits.
+The
+.Ar file
+owner is the user who runs the
+.Nm
+regardless of whether the
 .Fl u
-option is used, the directory to contain the pidfile must be writable
-by the specified user.
-Note, that the file will be created shortly before the process is
-actually executed, and will remain after the process exits (although
-it will be removed if the execution fails).
+option is used or not.
+.It Fl r
+Supervise and restart the program if it has been terminated.
 .It Fl u Ar user
 Login name of the user to execute the program under.
 Requires adequate superuser privileges.
 .El
+.Pp
+If the
+.Fl p
+or
+.Fl r
+option is specified the program is executed in a spawned child process.
+The
+.Nm
+waits until it terminates to keep the pid file locked and removes it
+after the process exits or restarts the program.
+In this case if the monitoring
+.Nm
+receives software termination signal (SIGTERM) it forwards it to the
+spawned process.
+Normally it will cause the child to exit followed by the termination
+of the supervising process after removing the pidfile.
 .Sh EXIT STATUS
 The
 .Nm
diff -r a085b3559102 -r ea1903d719a7 head/usr.sbin/daemon/daemon.c
--- a/head/usr.sbin/daemon/daemon.c	Fri Mar 02 17:02:21 2012 +0200
+++ b/head/usr.sbin/daemon/daemon.c	Fri Mar 02 17:04:50 2012 +0200
@@ -29,33 +29,40 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/usr.sbin/daemon/daemon.c 230541 2012-01-25 14:50:12Z ghelmer $");
+__FBSDID("$FreeBSD: head/usr.sbin/daemon/daemon.c 231912 2012-02-19 10:38:55Z trociny $");
 
 #include <sys/param.h>
+#include <sys/mman.h>
+#include <sys/wait.h>
 
 #include <err.h>
 #include <errno.h>
-#include <pwd.h>
 #include <libutil.h>
 #include <login_cap.h>
+#include <pwd.h>
+#include <signal.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
 
+static void dummy_sighandler(int);
 static void restrict_process(const char *);
+static int  wait_child(pid_t pid, sigset_t *mask);
 static void usage(void);
 
 int
 main(int argc, char *argv[])
 {
 	struct pidfh *pfh = NULL;
-	int ch, nochdir, noclose, errcode;
+	sigset_t mask, oldmask;
+	int ch, nochdir, noclose, restart;
 	const char *pidfile, *user;
-	pid_t otherpid;
+	pid_t otherpid, pid;
 
 	nochdir = noclose = 1;
+	restart = 0;
 	pidfile = user = NULL;
-	while ((ch = getopt(argc, argv, "-cfp:u:")) != -1) {
+	while ((ch = getopt(argc, argv, "-cfp:ru:")) != -1) {
 		switch (ch) {
 		case 'c':
 			nochdir = 0;
@@ -66,6 +73,9 @@
 		case 'p':
 			pidfile = optarg;
 			break;
+		case 'r':
+			restart = 1;
+			break;
 		case 'u':
 			user = optarg;
 			break;
@@ -79,14 +89,12 @@
 	if (argc == 0)
 		usage();
 
-	if (user != NULL)
-		restrict_process(user);
-
+	pfh = NULL;
 	/*
 	 * Try to open the pidfile before calling daemon(3),
 	 * to be able to report the error intelligently
 	 */
-	if (pidfile) {
+	if (pidfile != NULL) {
 		pfh = pidfile_open(pidfile, 0600, &otherpid);
 		if (pfh == NULL) {
 			if (errno == EEXIST) {
@@ -100,22 +108,87 @@
 	if (daemon(nochdir, noclose) == -1)
 		err(1, NULL);
 
-	/* Now that we are the child, write out the pid */
-	if (pidfile)
+	/*
+	 * If the pidfile or restart option is specified the daemon
+	 * executes the command in a forked process and wait on child
+	 * exit to remove the pidfile or restart the command. Normally
+	 * we don't want the monitoring daemon to be terminated
+	 * leaving the running process and the stale pidfile, so we
+	 * catch SIGTERM and forward it to the children expecting to
+	 * get SIGCHLD eventually.
+	 */
+	pid = -1;
+	if (pidfile != NULL || restart) {
+		/*
+		 * Restore default action for SIGTERM in case the
+		 * parent process decided to ignore it.
+		 */
+		if (signal(SIGTERM, SIG_DFL) == SIG_ERR)
+			err(1, "signal");
+		/*
+		 * Because SIGCHLD is ignored by default, setup dummy handler
+		 * for it, so we can mask it.
+		 */
+		if (signal(SIGCHLD, dummy_sighandler) == SIG_ERR)
+			err(1, "signal");
+		/*
+		 * Block interesting signals.
+		 */
+		sigemptyset(&mask);
+		sigaddset(&mask, SIGTERM);
+		sigaddset(&mask, SIGCHLD);
+		if (sigprocmask(SIG_SETMASK, &mask, &oldmask) == -1)
+			err(1, "sigprocmask");
+		/*
+		 * Try to protect against pageout kill. Ignore the
+		 * error, madvise(2) will fail only if a process does
+		 * not have superuser privileges.
+		 */
+		(void)madvise(NULL, 0, MADV_PROTECT);
+restart:
+		/*
+		 * Spawn a child to exec the command, so in the parent
+		 * we could wait for it to exit and remove pidfile.
+		 */
+		pid = fork();
+		if (pid == -1) {
+			pidfile_remove(pfh);
+			err(1, "fork");
+		}
+	}
+	if (pid <= 0) {
+		if (pid == 0) {
+			/* Restore old sigmask in the child. */
+			if (sigprocmask(SIG_SETMASK, &oldmask, NULL) == -1)
+				err(1, "sigprocmask");
+		}
+		/* Now that we are the child, write out the pid. */
 		pidfile_write(pfh);
 
-	execvp(argv[0], argv);
+		if (user != NULL)
+			restrict_process(user);
 
-	/*
-	 * execvp() failed -- unlink pidfile if any, and
-	 * report the error
-	 */
-	errcode = errno; /* Preserve errcode -- unlink may reset it */
-	if (pidfile)
-		pidfile_remove(pfh);
+		execvp(argv[0], argv);
 
-	/* The child is now running, so the exit status doesn't matter. */
-	errc(1, errcode, "%s", argv[0]);
+		/*
+		 * execvp() failed -- report the error. The child is
+		 * now running, so the exit status doesn't matter.
+		 */
+		err(1, "%s", argv[0]);
+	}
+	setproctitle("%s[%d]", argv[0], pid);
+	if (wait_child(pid, &mask) == 0 && restart) {
+		sleep(1);
+		goto restart;
+	}
+	pidfile_remove(pfh);
+	exit(0); /* Exit status does not matter. */
+}
+
+static void
+dummy_sighandler(int sig __unused)
+{
+	/* Nothing to do. */
 }
 
 static void
@@ -131,6 +204,34 @@
 		errx(1, "failed to set user environment");
 }
 
+static int
+wait_child(pid_t pid, sigset_t *mask)
+{
+	int terminate, signo;
+
+	terminate = 0;
+	for (;;) {
+		if (sigwait(mask, &signo) == -1) {
+			warn("sigwaitinfo");
+			return (-1);
+		}
+		switch (signo) {
+		case SIGCHLD:
+			return (terminate);
+		case SIGTERM:
+			terminate = 1;
+			if (kill(pid, signo) == -1) {
+				warn("kill");
+				return (-1);
+			}
+			continue;
+		default:
+			warnx("sigwaitinfo: invalid signal: %d", signo);
+			return (-1);
+		}
+	}
+}
+
 static void
 usage(void)
 {
diff -r a085b3559102 -r ea1903d719a7 head/usr.sbin/gpioctl/gpioctl.8
--- a/head/usr.sbin/gpioctl/gpioctl.8	Fri Mar 02 17:02:21 2012 +0200
+++ b/head/usr.sbin/gpioctl/gpioctl.8	Fri Mar 02 17:04:50 2012 +0200
@@ -116,7 +116,6 @@
 .It
 Configure pin 12 to be input pin
 .Pp
-<<<<<<< .mine
 gpioctl -f /dev/gpioc0 -c 12 IN
 .It
 Get input of pin 12
@@ -126,11 +125,6 @@
 Get only value of pin 12
 .Pp
 gpioctl -f /dev/gpioc0 -q -g 12
-||||||| .r222248
-gpioctl -f /dev/gpioctl0 -c 12 IN
-=======
-gpioctl -f /dev/gpioc0 -c 12 IN
->>>>>>> .r222305
 .El
 .Sh HISTORY
 The
diff -r a085b3559102 -r ea1903d719a7 head/usr.sbin/gssd/Makefile
--- a/head/usr.sbin/gssd/Makefile	Fri Mar 02 17:02:21 2012 +0200
+++ b/head/usr.sbin/gssd/Makefile	Fri Mar 02 17:04:50 2012 +0200
@@ -1,4 +1,4 @@
-# $FreeBSD$
+# $FreeBSD: head/usr.sbin/gssd/Makefile 231118 2012-02-07 09:27:07Z dim $
 
 PROG=	gssd
 MAN=	gssd.8
@@ -13,7 +13,7 @@
 CLEANFILES= gssd_svc.c gssd.h
 
 RPCSRC=	${.CURDIR}/../../sys/kgssapi/gssd.x
-RPCGEN= rpcgen -L -C -M
+RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -L -C -M
 
 gssd_svc.c: ${RPCSRC} gssd.h
 	${RPCGEN} -m -o ${.TARGET} ${RPCSRC}
diff -r a085b3559102 -r ea1903d719a7 head/usr.sbin/jail/jail.8
--- a/head/usr.sbin/jail/jail.8	Fri Mar 02 17:02:21 2012 +0200
+++ b/head/usr.sbin/jail/jail.8	Fri Mar 02 17:04:50 2012 +0200
@@ -32,9 +32,9 @@
 .\" this stuff is worth it, you can buy me a beer in return.   Poul-Henning Kamp
 .\" ----------------------------------------------------------------------------
 .\"
-.\" $FreeBSD: head/usr.sbin/jail/jail.8 224615 2011-08-02 19:44:40Z mm $
+.\" $FreeBSD: head/usr.sbin/jail/jail.8 232291 2012-02-29 07:33:07Z mm $
 .\"
-.Dd July 23, 2011
+.Dd February 29, 2012
 .Dt JAIL 8
 .Os
 .Sh NAME
@@ -301,6 +301,19 @@
 setting this parameter it may have a higher one.
 If the system securelevel is changed, any jail securelevels will be at
 least as secure.
+.It Va devfs_ruleset
+The number of the devfs ruleset that is enforced for mounting devfs in
+this jail.
+A value of zero (default) means no ruleset is enforced.
+Descendant jails inherit the parent jail's devfs ruleset enforcement.
+Mounting devfs inside a jail is possible only if the
+.Va allow.mount
+and
+.Va allow.mount.devfs
+permissions are effective and
+.Va enforce_statfs
+is set to a value lower than 2.
+Devfs rules and rulesets cannot be viewed or modified from inside a jail.
 .It Va children.max
 The number of child jails allowed to be created by this jail (or by
 other jails under this jail).
@@ -396,6 +409,45 @@
 This permission is effective only if
 .Va enforce_statfs
 is set to a value lower than 2.
+.It Va allow.mount.devfs
+privileged users inside the jail will be able to mount and unmount the
+devfs file system.
+This permission is effective only together with
+.Va allow.mount
+and if
+.Va enforce_statfs
+is set to a value lower than 2.
+Please consider restricting the devfs ruleset with the
+.Va devfs_ruleset
+option.
+.It Va allow.mount.nullfs
+privileged users inside the jail will be able to mount and unmount the
+nullfs file system.
+This permission is effective only together with
+.Va allow.mount
+and if
+.Va enforce_statfs
+is set to a value lower than 2.
+.It Va allow.mount.procfs
+privileged users inside the jail will be able to mount and unmount the
+procfs file system.
+This permission is effective only together with
+.Va allow.mount
+and if
+.Va enforce_statfs
+is set to a value lower than 2.
+.It Va allow.mount.zfs
+privileged users inside the jail will be able to mount and unmount the
+ZFS file system.
+This permission is effective only together with
+.Va allow.mount
+and if
+.Va enforce_statfs
+is set to a value lower than 2.
+See
+.Xr zfs 8
+for information on how to configure the ZFS filesystem to operate from
+within a jail.
 .It Va allow.quotas
 The prison root may administer quotas on the jail's filesystem(s).
 This includes filesystems that the jail may share with other jails or
diff -r a085b3559102 -r ea1903d719a7 head/usr.sbin/keyserv/Makefile
--- a/head/usr.sbin/keyserv/Makefile	Fri Mar 02 17:02:21 2012 +0200
+++ b/head/usr.sbin/keyserv/Makefile	Fri Mar 02 17:04:50 2012 +0200
@@ -1,4 +1,4 @@
-# $FreeBSD$
+# $FreeBSD: head/usr.sbin/keyserv/Makefile 231118 2012-02-07 09:27:07Z dim $
 
 PROG=	keyserv
 MAN=	keyserv.8
@@ -15,7 +15,7 @@
 
 CLEANFILES= crypt_svc.c crypt.h
 
-RPCGEN= rpcgen -C
+RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -C
 
 crypt_svc.c: ${RPCDIR}/crypt.x
 	${RPCGEN} -m -o ${.TARGET} ${RPCDIR}/crypt.x
diff -r a085b3559102 -r ea1903d719a7 head/usr.sbin/lpr/lpc/cmds.c
--- a/head/usr.sbin/lpr/lpc/cmds.c	Fri Mar 02 17:02:21 2012 +0200
+++ b/head/usr.sbin/lpr/lpc/cmds.c	Fri Mar 02 17:04:50 2012 +0200
@@ -41,7 +41,7 @@
 #endif
 
 #include "lp.cdefs.h"		/* A cross-platform version of <sys/cdefs.h> */
-__FBSDID("$FreeBSD: head/usr.sbin/lpr/lpc/cmds.c 228990 2011-12-30 10:58:14Z uqs $");
+__FBSDID("$FreeBSD: head/usr.sbin/lpr/lpc/cmds.c 231723 2012-02-15 02:01:24Z kevlo $");
 
 /*
  * lpc -- line printer control program -- commands:
@@ -77,7 +77,7 @@
 
 static char	*args2line(int argc, char **argv);
 static int	 doarg(char *_job);
-static int	 doselect(struct dirent *_d);
+static int	 doselect(const struct dirent *_d);
 static int	 kill_qtask(const char *lf);
 static int	 sortq(const void *_a, const void *_b);
 static int	 touch(struct jobqueue *_jq);
@@ -376,7 +376,7 @@
 		return;
 	}
 	(void) ftruncate(fd, 0);
-	if (msg == (char *)NULL)
+	if (msg == NULL)
 		(void) write(fd, "\n", 1);
 	else
 		(void) write(fd, msg, strlen(msg));
@@ -451,7 +451,7 @@
 static int 	 cln_testonly;		/* remove-files vs just-print-info */
 
 static int
-doselect(struct dirent *d)
+doselect(const struct dirent *d)
 {
 	int c = d->d_name[0];
 
diff -r a085b3559102 -r ea1903d719a7 head/usr.sbin/periodic/periodic.sh
--- a/head/usr.sbin/periodic/periodic.sh	Fri Mar 02 17:02:21 2012 +0200
+++ b/head/usr.sbin/periodic/periodic.sh	Fri Mar 02 17:04:50 2012 +0200
@@ -1,6 +1,6 @@
 #!/bin/sh -
 #
-# $FreeBSD$
+# $FreeBSD: head/usr.sbin/periodic/periodic.sh 231568 2012-02-12 23:18:05Z brooks $
 #
 # Run nightly periodic scripts
 #
@@ -14,6 +14,18 @@
     exit 1
 }
 
+output_pipe()
+{
+    # Where's our output going ?
+    eval output=\$${1##*/}_output
+    case "$output" in
+    /*) pipe="cat >>$output";;
+    "") pipe=cat;;
+    *)  pipe="mail -E -s '$host ${1##*/} run output' $output";;
+    esac
+    eval $pipe
+}
+
 if [ $# -lt 1 ] ; then
     usage
 fi
@@ -27,83 +39,102 @@
 
 host=`hostname`
 export host
+
+# If we were called normally, then create a lock file for each argument
+# in turn and reinvoke ourselves with the LOCKED argument.  This prevents
+# very long running jobs from being overlapped by another run as this is
+# will lead the system running progressivly slower and more and more jobs 
+# are run at once.
+if [ $1 != "LOCKED" ]; then
+    ret=0
+    for arg; do
+        lockfile=/var/run/periodic.${arg##*/}.lock
+        lockf -t 0 "${lockfile}" /bin/sh $0 LOCKED "$arg"
+        case $? in
+        0) ;;
+        73) #EX_CANTCREATE
+            echo "can't create ${lockfile}" | output_pipe $arg
+            ret=1
+            ;;
+        75) #EX_TEMPFAIL
+            echo "$host ${arg##*/} prior run still in progress" | \
+                output_pipe $arg
+            ret=1
+            ;;
+        *)
+            ret=1
+            ;;
+        esac
+    done
+    exit $ret
+fi
+
+if [ $# -ne 2 ]; then
+    usage
+fi
+shift
+arg=$1
+
 tmp_output=`mktemp ${TMPDIR:-/tmp}/periodic.XXXXXXXXXX`
 
 # Execute each executable file in the directory list.  If the x bit is not
 # set, assume the user didn't really want us to muck with it (it's a
 # README file or has been disabled).
 
-for arg
-do
-    # Where's our output going ?
-    eval output=\$${arg##*/}_output
-    case "$output" in
-    /*) pipe="cat >>$output";;
-    "") pipe=cat;;
-    *)  pipe="mail -E -s '$host ${arg##*/} run output' $output";;
+success=YES info=YES badconfig=NO empty_output=YES	# Defaults when ${run}_* aren't YES/NO
+for var in success info badconfig empty_output; do
+    case $(eval echo "\$${arg##*/}_show_$var") in
+    [Yy][Ee][Ss]) eval $var=YES;;
+    [Nn][Oo])     eval $var=NO;;
     esac
+done
 
-    success=YES info=YES badconfig=NO empty_output=YES	# Defaults when ${run}_* aren't YES/NO
-    for var in success info badconfig empty_output
-    do
-        case $(eval echo "\$${arg##*/}_show_$var") in
-        [Yy][Ee][Ss]) eval $var=YES;;
-        [Nn][Oo])     eval $var=NO;;
-        esac
+case $arg in
+/*) if [ -d "$arg" ]; then
+        dirlist="$arg"
+    else
+        echo "$0: $arg not found" >&2 
+        continue
+    fi
+    ;;
+*)  dirlist=
+    for top in /etc/periodic ${local_periodic}; do
+        [ -d $top/$arg ] && dirlist="$dirlist $top/$arg"
     done
+    ;;
+esac
 
-    case $arg in
-    /*) if [ -d "$arg" ]
-        then
-            dirlist="$arg"
-        else
-            echo "$0: $arg not found" >&2 
-            continue
-        fi;;
-    *)  dirlist=
-        for top in /etc/periodic ${local_periodic}
-        do
-            [ -d $top/$arg ] && dirlist="$dirlist $top/$arg"
-        done;;
-    esac
-
-    {
-        empty=TRUE
-        processed=0
-        for dir in $dirlist
-        do
-            for file in $dir/*
-            do
-                if [ -x $file -a ! -d $file ]
-                then
-                    output=TRUE
-                    processed=$(($processed + 1))
-                    $file </dev/null >$tmp_output 2>&1
-                    rc=$?
-                    if [ -s $tmp_output ]
-                    then
-                      case $rc in
-                      0)  [ $success = NO ] && output=FALSE;;
-                      1)  [ $info = NO ] && output=FALSE;;
-                      2)  [ $badconfig = NO ] && output=FALSE;;
-                      esac
-                      [ $output = TRUE ] && { cat $tmp_output; empty=FALSE; }
-                    fi
-                    cp /dev/null $tmp_output
+{
+    empty=TRUE
+    processed=0
+    for dir in $dirlist; do
+        for file in $dir/*; do
+            if [ -x $file -a ! -d $file ]; then
+                output=TRUE
+                processed=$(($processed + 1))
+                $file </dev/null >$tmp_output 2>&1
+                rc=$?
+                if [ -s $tmp_output ]; then
+                    case $rc in
+                    0)  [ $success = NO ] && output=FALSE;;
+                    1)  [ $info = NO ] && output=FALSE;;
+                    2)  [ $badconfig = NO ] && output=FALSE;;
+                    esac
+                    [ $output = TRUE ] && { cat $tmp_output; empty=FALSE; }
                 fi
-            done
+                cp /dev/null $tmp_output
+            fi
         done
-        if [ $empty = TRUE ]
-        then
-          if [ $empty_output = TRUE ]
-          then
+    done
+    if [ $empty = TRUE ]; then
+        if [ $empty_output = TRUE ]; then
             [ $processed = 1 ] && plural= || plural=s
             echo "No output from the $processed file$plural processed"
-          fi
-        else
-          echo ""
-          echo "-- End of $arg output --"
         fi
-    } | eval $pipe
-done
+    else
+        echo ""
+        echo "-- End of $arg output --"
+    fi
+} | output_pipe ${arg}
+
 rm -f $tmp_output
diff -r a085b3559102 -r ea1903d719a7 head/usr.sbin/pkg_install/create/perform.c
--- a/head/usr.sbin/pkg_install/create/perform.c	Fri Mar 02 17:02:21 2012 +0200
+++ b/head/usr.sbin/pkg_install/create/perform.c	Fri Mar 02 17:04:50 2012 +0200
@@ -19,7 +19,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/usr.sbin/pkg_install/create/perform.c 228990 2011-12-30 10:58:14Z uqs $");
+__FBSDID("$FreeBSD: head/usr.sbin/pkg_install/create/perform.c 231328 2012-02-10 00:53:39Z eadler $");
 
 #include "lib.h"
 #include "create.h"
@@ -214,8 +214,12 @@
     read_plist(&plist, pkg_in);
 
     /* Prefix should add an @cwd to the packing list */
-    if (Prefix)
-	add_plist_top(&plist, PLIST_CWD, Prefix);
+    if (Prefix) {
+        char resolved_prefix[PATH_MAX];
+        if (realpath(Prefix, resolved_prefix) == NULL)
+	    err(EXIT_FAILURE, "couldn't resolve path for prefix: %s", Prefix);
+	add_plist_top(&plist, PLIST_CWD, resolved_prefix);
+    }
 
     /* Add the origin if asked, at the top */
     if (Origin)
@@ -260,7 +264,9 @@
     /* mark_plist(&plist); */
 
     /* Now put the release specific items in */
-    add_plist(&plist, PLIST_CWD, ".");
+    if (!Prefix) {
+	add_plist(&plist, PLIST_CWD, ".");
+    }
     write_file(COMMENT_FNAME, Comment);
     add_plist(&plist, PLIST_IGNORE, NULL);
     add_plist(&plist, PLIST_FILE, COMMENT_FNAME);
diff -r a085b3559102 -r ea1903d719a7 head/usr.sbin/ppp/auth.c
--- a/head/usr.sbin/ppp/auth.c	Fri Mar 02 17:02:21 2012 +0200
+++ b/head/usr.sbin/ppp/auth.c	Fri Mar 02 17:04:50 2012 +0200
@@ -25,7 +25,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD$
+ * $FreeBSD: head/usr.sbin/ppp/auth.c 231994 2012-02-22 06:27:20Z kevlo $
  */
 
 #include <sys/param.h>
@@ -126,9 +126,11 @@
     /* Then look up the real password database */
     struct passwd *pw;
     int result;
+    char *cryptpw;
 
+    cryptpw = crypt(key, pw->pw_passwd);
     result = (pw = getpwnam(name)) &&
-             !strcmp(crypt(key, pw->pw_passwd), pw->pw_passwd);
+             (cryptpw == NULL || !strcmp(cryptpw, pw->pw_passwd));
     endpwent();
     return result;
 #else /* !NOPAM */
diff -r a085b3559102 -r ea1903d719a7 head/usr.sbin/pw/cpdir.c
--- a/head/usr.sbin/pw/cpdir.c	Fri Mar 02 17:02:21 2012 +0200
+++ b/head/usr.sbin/pw/cpdir.c	Fri Mar 02 17:04:50 2012 +0200
@@ -26,7 +26,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-  "$FreeBSD: head/usr.sbin/pw/cpdir.c 228990 2011-12-30 10:58:14Z uqs $";
+  "$FreeBSD: head/usr.sbin/pw/cpdir.c 231654 2012-02-14 10:17:03Z kevlo $";
 #endif /* not lint */
 
 #include <err.h>
@@ -84,7 +84,7 @@
 							if (strcmp(e->d_name, ".") != 0 && strcmp(e->d_name, "..") != 0)
 								copymkdir(dst, src, st.st_mode & _DEF_DIRMODE, uid, gid);
 								chflags(dst, st.st_flags);	/* propagate flags */
-						    } else if (S_ISLNK(st.st_mode) && (len = readlink(src, lnk, sizeof(lnk))) != -1) {
+						    } else if (S_ISLNK(st.st_mode) && (len = readlink(src, lnk, sizeof(lnk) - 1)) != -1) {
 							lnk[len] = '\0';
 							symlink(lnk, dst);
 							lchown(dst, uid, gid);
diff -r a085b3559102 -r ea1903d719a7 head/usr.sbin/pw/pw_user.c
--- a/head/usr.sbin/pw/pw_user.c	Fri Mar 02 17:02:21 2012 +0200
+++ b/head/usr.sbin/pw/pw_user.c	Fri Mar 02 17:04:50 2012 +0200
@@ -27,7 +27,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-  "$FreeBSD: head/usr.sbin/pw/pw_user.c 228673 2011-12-17 23:46:47Z dim $";
+  "$FreeBSD: head/usr.sbin/pw/pw_user.c 231994 2012-02-22 06:27:20Z kevlo $";
 #endif /* not lint */
 
 #include <ctype.h>
@@ -1028,6 +1028,7 @@
 {
 	int             i;
 	char            salt[SALTSIZE + 1];
+	char		*cryptpw;
 
 	static char     buf[256];
 
@@ -1038,7 +1039,10 @@
 		salt[i] = chars[arc4random_uniform(sizeof(chars) - 1)];
 	salt[SALTSIZE] = '\0';
 
-	return strcpy(buf, crypt(password, salt));
+	cryptpw = crypt(password, salt);
+	if (cryptpw == NULL)
+		errx(EX_CONFIG, "crypt(3) failure");
+	return strcpy(buf, cryptpw);
 }
 
 
diff -r a085b3559102 -r ea1903d719a7 head/usr.sbin/rpc.lockd/Makefile
--- a/head/usr.sbin/rpc.lockd/Makefile	Fri Mar 02 17:02:21 2012 +0200
+++ b/head/usr.sbin/rpc.lockd/Makefile	Fri Mar 02 17:04:50 2012 +0200
@@ -1,5 +1,5 @@
 #	$NetBSD: Makefile,v 1.12 2000/08/07 16:23:31 thorpej Exp $
-# $FreeBSD$
+# $FreeBSD: head/usr.sbin/rpc.lockd/Makefile 231118 2012-02-07 09:27:07Z dim $
 
 PROG=	rpc.lockd
 MAN=	rpc.lockd.8
@@ -15,7 +15,7 @@
 CLEANFILES= nlm_prot_svc.c nlm_prot.h test
 
 RPCSRC= ${DESTDIR}/usr/include/rpcsvc/nlm_prot.x
-RPCGEN= rpcgen -L -C
+RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -L -C
 
 nlm_prot_svc.c: ${RPCSRC}
 	${RPCGEN} -m -o ${.TARGET} ${RPCSRC}
diff -r a085b3559102 -r ea1903d719a7 head/usr.sbin/rpc.statd/Makefile
--- a/head/usr.sbin/rpc.statd/Makefile	Fri Mar 02 17:02:21 2012 +0200
+++ b/head/usr.sbin/rpc.statd/Makefile	Fri Mar 02 17:04:50 2012 +0200
@@ -1,4 +1,4 @@
-# $FreeBSD$
+# $FreeBSD: head/usr.sbin/rpc.statd/Makefile 231118 2012-02-07 09:27:07Z dim $
 
 PROG=	rpc.statd
 MAN=	rpc.statd.8
@@ -13,7 +13,7 @@
 CLEANFILES= sm_inter_svc.c sm_inter.h
 
 RPCSRC= ${DESTDIR}/usr/include/rpcsvc/sm_inter.x
-RPCGEN= rpcgen -L -C
+RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -L -C
 
 sm_inter_svc.c: ${RPCSRC}
 	${RPCGEN} -m -o ${.TARGET} ${RPCSRC}
diff -r a085b3559102 -r ea1903d719a7 head/usr.sbin/rpc.yppasswdd/Makefile
--- a/head/usr.sbin/rpc.yppasswdd/Makefile	Fri Mar 02 17:02:21 2012 +0200
+++ b/head/usr.sbin/rpc.yppasswdd/Makefile	Fri Mar 02 17:04:50 2012 +0200
@@ -1,4 +1,4 @@
-# $FreeBSD$
+# $FreeBSD: head/usr.sbin/rpc.yppasswdd/Makefile 231118 2012-02-07 09:27:07Z dim $
 
 RPCDIR=	${DESTDIR}/usr/include/rpcsvc
 
@@ -25,7 +25,7 @@
 
 CLEANFILES= ${GENSRCS}
 
-RPCGEN=	rpcgen -I -C
+RPCGEN=	RPCGEN_CPP=${CPP:Q} rpcgen -I -C
 
 # We need to remove the 'static' keyword from _rpcsvcstate so that
 # yppasswdd_main.c can see it.
diff -r a085b3559102 -r ea1903d719a7 head/usr.sbin/rpc.yppasswdd/yppasswdd_server.c
--- a/head/usr.sbin/rpc.yppasswdd/yppasswdd_server.c	Fri Mar 02 17:02:21 2012 +0200
+++ b/head/usr.sbin/rpc.yppasswdd/yppasswdd_server.c	Fri Mar 02 17:04:50 2012 +0200
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: head/usr.sbin/rpc.yppasswdd/yppasswdd_server.c 231994 2012-02-22 06:27:20Z kevlo $");
 
 #include <sys/param.h>
 #include <sys/fcntl.h>
@@ -460,6 +460,7 @@
 	int passwd_changed = 0;
 	int shell_changed = 0;
 	int gecos_changed = 0;
+	char *cryptpw;
 	char *oldshell = NULL;
 	char *oldgecos = NULL;
 	char *passfile_hold;
@@ -537,8 +538,8 @@
 
 	/* Step 2: check that the supplied oldpass is valid. */
 
-	if (strcmp(crypt(argp->oldpass, yp_password.pw_passwd),
-					yp_password.pw_passwd)) {
+	cryptpw = crypt(argp->oldpass, yp_password.pw_passwd);
+	if (cryptpw == NULL || strcmp(cryptpw, yp_password.pw_passwd)) {
 		yp_error("rejected change attempt -- bad password");
 		yp_error("client address: %s username: %s",
 			  inet_ntoa(rqhost->sin_addr),
diff -r a085b3559102 -r ea1903d719a7 head/usr.sbin/rpc.ypupdated/Makefile
--- a/head/usr.sbin/rpc.ypupdated/Makefile	Fri Mar 02 17:02:21 2012 +0200
+++ b/head/usr.sbin/rpc.ypupdated/Makefile	Fri Mar 02 17:04:50 2012 +0200
@@ -1,4 +1,4 @@
-# $FreeBSD$
+# $FreeBSD: head/usr.sbin/rpc.ypupdated/Makefile 231118 2012-02-07 09:27:07Z dim $
 
 .PATH: ${.CURDIR}/../ypserv ${.CURDIR}/../../libexec/ypxfr
 
@@ -19,7 +19,7 @@
 CLEANFILES= ypupdate_prot_svc.c ypupdate_prot.h
 
 RPCDIR=	${DESTDIR}/usr/include/rpcsvc
-RPCGEN= rpcgen -I -C
+RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -I -C
 
 # We need to remove the 'static' keyword from _rpcsvcstate so that
 # ypupdated_main.c can see it.
diff -r a085b3559102 -r ea1903d719a7 head/usr.sbin/rpc.ypxfrd/Makefile
--- a/head/usr.sbin/rpc.ypxfrd/Makefile	Fri Mar 02 17:02:21 2012 +0200
+++ b/head/usr.sbin/rpc.ypxfrd/Makefile	Fri Mar 02 17:04:50 2012 +0200
@@ -1,4 +1,4 @@
-# $FreeBSD$
+# $FreeBSD: head/usr.sbin/rpc.ypxfrd/Makefile 231118 2012-02-07 09:27:07Z dim $
 
 .PATH: ${.CURDIR}/../../usr.sbin/ypserv
 
@@ -17,7 +17,7 @@
 CLEANFILES= ypxfrd_svc.c ypxfrd.h
 
 RPCDIR=	${.CURDIR}/../../include/rpcsvc
-RPCGEN= rpcgen -I -C
+RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -I -C
 
 # We need to remove the 'static' keyword from _rpcsvcstate so that
 # ypxfrd_main.c can see it.
diff -r a085b3559102 -r ea1903d719a7 head/usr.sbin/sendmail/Makefile
--- a/head/usr.sbin/sendmail/Makefile	Fri Mar 02 17:02:21 2012 +0200
+++ b/head/usr.sbin/sendmail/Makefile	Fri Mar 02 17:04:50 2012 +0200
@@ -1,5 +1,5 @@
 #	@(#)Makefile	8.8 (Berkeley) 3/28/97
-# $FreeBSD: head/usr.sbin/sendmail/Makefile 228707 2011-12-19 13:35:44Z dim $
+# $FreeBSD: head/usr.sbin/sendmail/Makefile 232263 2012-02-28 18:30:18Z dim $
 
 .include <bsd.own.mk>
 
@@ -45,12 +45,10 @@
 
 WARNS?=	1
 
-.if ${CC:T:Mclang} == "clang"
 # Unfortunately, clang gives warnings about sendmail code that cannot
 # be turned off yet.  Since this is contrib code, and we don't really
 # care about the warnings, just make them non-fatal for now.
-NO_WERROR=
-.endif
+NO_WERROR.clang=
 
 DPADD=	${LIBUTIL} ${LIBWRAP}
 LDADD=	-lutil -lwrap
diff -r a085b3559102 -r ea1903d719a7 head/usr.sbin/tzsetup/tzsetup.8
--- a/head/usr.sbin/tzsetup/tzsetup.8	Fri Mar 02 17:02:21 2012 +0200
+++ b/head/usr.sbin/tzsetup/tzsetup.8	Fri Mar 02 17:04:50 2012 +0200
@@ -22,7 +22,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\" $FreeBSD: head/usr.sbin/tzsetup/tzsetup.8 222139 2011-05-20 17:35:10Z ru $
+.\" $FreeBSD: head/usr.sbin/tzsetup/tzsetup.8 232297 2012-02-29 14:44:42Z emaste $
 .\"
 .Dd October 21, 2009
 .Dt TZSETUP 8
@@ -49,7 +49,7 @@
 the hardware clock does not keep
 .Tn UTC .
 .Pp
-The following option is available:
+The following options are available:
 .Bl -tag -offset indent -width Fl
 .It Fl C Ar chroot_directory
 Open all files and directories relative to
diff -r a085b3559102 -r ea1903d719a7 head/usr.sbin/tzsetup/tzsetup.c
--- a/head/usr.sbin/tzsetup/tzsetup.c	Fri Mar 02 17:02:21 2012 +0200
+++ b/head/usr.sbin/tzsetup/tzsetup.c	Fri Mar 02 17:04:50 2012 +0200
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/usr.sbin/tzsetup/tzsetup.c 230520 2012-01-25 02:15:40Z emaste $");
+__FBSDID("$FreeBSD: head/usr.sbin/tzsetup/tzsetup.c 231181 2012-02-08 05:03:04Z wollman $");
 
 #include <err.h>
 #include <errno.h>
@@ -723,7 +723,7 @@
 				return (DITEM_FAILURE | DITEM_RECREATE);
 			}
 
-			if (unlink(path_localtime) < 0) {
+			if (unlink(path_localtime) < 0 && errno != ENOENT) {
 				snprintf(prompt, sizeof(prompt),
 				    "Could not unlink %s: %s",
 				    path_localtime, strerror(errno));
@@ -780,7 +780,7 @@
 					fprintf(stderr, "%s\n", prompt);
 				return (DITEM_FAILURE | DITEM_RECREATE);
 			}
-			if (unlink(path_localtime) < 0) {
+			if (unlink(path_localtime) < 0 && errno != ENOENT) {
 				snprintf(prompt, sizeof(prompt),
 				    "Could not unlink %s: %s",
 				    path_localtime, strerror(errno));
diff -r a085b3559102 -r ea1903d719a7 head/usr.sbin/usbdump/usbdump.8
--- a/head/usr.sbin/usbdump/usbdump.8	Fri Mar 02 17:02:21 2012 +0200
+++ b/head/usr.sbin/usbdump/usbdump.8	Fri Mar 02 17:04:50 2012 +0200
@@ -23,9 +23,9 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\" $FreeBSD: head/usr.sbin/usbdump/usbdump.8 222519 2011-05-31 07:13:07Z bcr $
+.\" $FreeBSD: head/usr.sbin/usbdump/usbdump.8 231835 2012-02-16 21:18:36Z hselasky $
 .\"
-.Dd May 31, 2011
+.Dd February 16, 2012
 .Dt USBDUMP 8
 .Os
 .Sh NAME
@@ -38,6 +38,7 @@
 .Op Fl s Ar snaplen
 .Op Fl v
 .Op Fl w Ar file
+.Op Fl f Ar filter
 .Sh DESCRIPTION
 The
 .Nm
@@ -61,6 +62,16 @@
 .It Fl w Ar file
 Write the raw packets to
 .Ar file .
+.It Fl f Ar filter
+The filter argument consists of either one or two numbers separated by a dot.
+The first indicates the device unit number which should be traced.
+The second number which is optional indicates the endpoint which should be traced.
+To get all traffic for the control endpoint, two filters should be
+created, one for endpoint 0 and one for endpoint 128.
+If 128 is added to the endpoint number that means IN direction, else OUT direction is implied.
+A device unit or endpoint value of -1 means ignore this field.
+If no filters are specified, all packets are passed through using the default -1,-1 filter.
+This option can be specified multiple times.
 .El
 .Sh EXAMPLES
 Capture the USB raw packets on usbus2:
@@ -72,6 +83,11 @@
 .Pp
 .Dl "usbdump -i usbus2 -s 0 -w /tmp/dump_pkts"
 .Pp
+Dump the USB raw packets of usbus2, but only the control endpoint traffic
+of device unit number 3:
+.Pp
+.Dl "usbdump -i usbus2 -s 0 -f 3.0 -f 3.128 -w /tmp/dump_pkts"
+.Pp
 Read and display the USB raw packets from previous file:
 .Pp
 .Dl "usbdump -r /tmp/dump_pkts -v"
diff -r a085b3559102 -r ea1903d719a7 head/usr.sbin/usbdump/usbdump.c
--- a/head/usr.sbin/usbdump/usbdump.c	Fri Mar 02 17:02:21 2012 +0200
+++ b/head/usr.sbin/usbdump/usbdump.c	Fri Mar 02 17:04:50 2012 +0200
@@ -26,7 +26,7 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  * THE POSSIBILITY OF SUCH DAMAGES.
  *
- * $FreeBSD: head/usr.sbin/usbdump/usbdump.c 226474 2011-10-17 15:54:20Z hselasky $
+ * $FreeBSD: head/usr.sbin/usbdump/usbdump.c 231835 2012-02-16 21:18:36Z hselasky $
  */
 
 #include <sys/param.h>
@@ -35,6 +35,7 @@
 #include <sys/socket.h>
 #include <sys/stat.h>
 #include <sys/utsname.h>
+#include <sys/queue.h>
 #include <net/if.h>
 #include <net/bpf.h>
 #include <dev/usb/usb.h>
@@ -45,12 +46,33 @@
 #include <limits.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <stdint.h>
 #include <string.h>
 #include <time.h>
 #include <unistd.h>
 #include <sysexits.h>
 #include <err.h>
 
+#define	BPF_STORE_JUMP(x,_c,_k,_jt,_jf) do {	\
+  (x).code = (_c);				\
+  (x).k = (_k);					\
+  (x).jt = (_jt);				\
+  (x).jf = (_jf);				\
+} while (0)
+
+#define	BPF_STORE_STMT(x,_c,_k) do {		\
+  (x).code = (_c);				\
+  (x).k = (_k);					\
+  (x).jt = 0;					\
+  (x).jf = 0;					\
+} while (0)
+
+struct usb_filt {
+	STAILQ_ENTRY(usb_filt) entry;
+	int unit;
+	int endpoint;
+};
+
 struct usbcap {
 	int		fd;		/* fd for /dev/usbpf */
 	uint32_t	bufsize;
@@ -123,6 +145,114 @@
 	[USB_SPEED_SUPER] = "SUPER",
 };
 
+static STAILQ_HEAD(,usb_filt) usb_filt_head =
+    STAILQ_HEAD_INITIALIZER(usb_filt_head);
+
+static void
+add_filter(int usb_filt_unit, int usb_filt_ep)
+{
+	struct usb_filt *puf;
+
+	puf = malloc(sizeof(struct usb_filt));
+	if (puf == NULL)
+		errx(EX_SOFTWARE, "Out of memory.");
+
+	puf->unit = usb_filt_unit;
+	puf->endpoint = usb_filt_ep;
+
+	STAILQ_INSERT_TAIL(&usb_filt_head, puf, entry);
+}
+
+static void
+make_filter(struct bpf_program *pprog, int snapshot)
+{
+	struct usb_filt *puf;
+	struct bpf_insn *dynamic_insn;
+	int len;
+
+	len = 0;
+
+	STAILQ_FOREACH(puf, &usb_filt_head, entry)
+		len++;
+
+	dynamic_insn = malloc(((len * 5) + 1) * sizeof(struct bpf_insn));
+
+	if (dynamic_insn == NULL)
+		errx(EX_SOFTWARE, "Out of memory.");
+
+	len++;
+
+	if (len == 1) {
+		/* accept all packets */
+
+		BPF_STORE_STMT(dynamic_insn[0], BPF_RET | BPF_K, snapshot);
+
+		goto done;
+	}
+
+	len = 0;
+
+	STAILQ_FOREACH(puf, &usb_filt_head, entry) {
+		const int addr_off = (uintptr_t)&((struct usbpf_pkthdr *)0)->up_address;
+		const int addr_ep = (uintptr_t)&((struct usbpf_pkthdr *)0)->up_endpoint;
+		
+		if (puf->unit != -1) {
+			if (puf->endpoint != -1) {
+				BPF_STORE_STMT(dynamic_insn[len],
+				    BPF_LD | BPF_B | BPF_ABS, addr_off);
+				len++;
+				BPF_STORE_JUMP(dynamic_insn[len],
+				    BPF_JMP | BPF_JEQ | BPF_K, (uint8_t)puf->unit, 0, 3);
+				len++;
+				BPF_STORE_STMT(dynamic_insn[len],
+				    BPF_LD | BPF_W | BPF_ABS, addr_ep);
+				len++;
+				BPF_STORE_JUMP(dynamic_insn[len],
+				    BPF_JMP | BPF_JEQ | BPF_K, htobe32(puf->endpoint), 0, 1);
+				len++;
+			} else {
+				BPF_STORE_STMT(dynamic_insn[len],
+				    BPF_LD | BPF_B | BPF_ABS, addr_off);
+				len++;
+				BPF_STORE_JUMP(dynamic_insn[len],
+				    BPF_JMP | BPF_JEQ | BPF_K, (uint8_t)puf->unit, 0, 1);
+				len++;
+			}
+		} else {
+			if (puf->endpoint != -1) {
+				BPF_STORE_STMT(dynamic_insn[len],
+				    BPF_LD | BPF_W | BPF_ABS, addr_ep);
+				len++;
+				BPF_STORE_JUMP(dynamic_insn[len],
+				    BPF_JMP | BPF_JEQ | BPF_K, htobe32(puf->endpoint), 0, 1);
+				len++;
+			}
+		}
+		BPF_STORE_STMT(dynamic_insn[len],
+		    BPF_RET | BPF_K, snapshot);
+		len++;
+	}
+
+	BPF_STORE_STMT(dynamic_insn[len], BPF_RET | BPF_K, 0);
+	len++;
+
+done:
+	pprog->bf_len = len;
+	pprog->bf_insns = dynamic_insn;
+}
+
+static void
+free_filter(struct bpf_program *pprog)
+{
+	struct usb_filt *puf;
+
+	while ((puf = STAILQ_FIRST(&usb_filt_head)) != NULL) {
+		STAILQ_REMOVE_HEAD(&usb_filt_head, entry);
+		free(puf);
+	}
+	free(pprog->bf_insns);
+}
+
 static void
 handle_sigint(int sig)
 {
@@ -527,6 +657,7 @@
 #define FMT "    %-14s %s\n"
 	fprintf(stderr, "usage: usbdump [options]\n");
 	fprintf(stderr, FMT, "-i <usbusX>", "Listen on USB bus interface");
+	fprintf(stderr, FMT, "-f <unit[.endpoint]>", "Specify a device and endpoint filter");
 	fprintf(stderr, FMT, "-r <file>", "Read the raw packets from file");
 	fprintf(stderr, FMT, "-s <snaplen>", "Snapshot bytes from each packet");
 	fprintf(stderr, FMT, "-v", "Increase the verbose level");
@@ -539,7 +670,6 @@
 main(int argc, char *argv[])
 {
 	struct timeval tv;
-	struct bpf_insn total_insn;
 	struct bpf_program total_prog;
 	struct bpf_stat us;
 	struct bpf_version bv;
@@ -547,12 +677,16 @@
 	struct ifreq ifr;
 	long snapshot = 192;
 	uint32_t v;
-	int fd, o;
+	int fd;
+	int o;
+	int filt_unit;
+	int filt_ep;
 	const char *optstring;
+	char *pp;
 
 	memset(&uc, 0, sizeof(struct usbcap));
 
-	optstring = "i:r:s:vw:";
+	optstring = "i:r:s:vw:f:";
 	while ((o = getopt(argc, argv, optstring)) != -1) {
 		switch (o) {
 		case 'i':
@@ -563,8 +697,10 @@
 			init_rfile(p);
 			break;
 		case 's':
-			snapshot = strtol(optarg, NULL, 10);
+			snapshot = strtol(optarg, &pp, 10);
 			errno = 0;
+			if (pp != NULL && *pp != 0)
+				usage();
 			if (snapshot == 0 && errno == EINVAL)
 				usage();
 			/* snapeshot == 0 is special */
@@ -578,6 +714,20 @@
 			w_arg = optarg;
 			init_wfile(p);
 			break;
+		case 'f':
+			filt_unit = strtol(optarg, &pp, 10);
+			filt_ep = -1;
+			if (pp != NULL) {
+				if (*pp == '.') {
+					filt_ep = strtol(pp + 1, &pp, 10);
+					if (pp != NULL && *pp != 0)
+						usage();
+				} else if (*pp != 0) {
+					usage();
+				}
+			}
+			add_filter(filt_unit, filt_ep);
+			break;
 		default:
 			usage();
 			/* NOTREACHED */
@@ -623,17 +773,13 @@
 	if (p->buffer == NULL)
 		errx(EX_SOFTWARE, "Out of memory.");
 
-	/* XXX no read filter rules yet so at this moment accept everything */
-	total_insn.code = (u_short)(BPF_RET | BPF_K);
-	total_insn.jt = 0;
-	total_insn.jf = 0;
-	total_insn.k = snapshot;
+	make_filter(&total_prog, snapshot);
 
-	total_prog.bf_len = 1;
-	total_prog.bf_insns = &total_insn;
 	if (ioctl(p->fd, BIOCSETF, (caddr_t)&total_prog) < 0)
 		err(EXIT_FAILURE, "BIOCSETF ioctl failed");
 
+	free_filter(&total_prog);
+
 	/* 1 second read timeout */
 	tv.tv_sec = 1;
 	tv.tv_usec = 0;
diff -r a085b3559102 -r ea1903d719a7 head/usr.sbin/utx/Makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/usr.sbin/utx/Makefile	Fri Mar 02 17:04:50 2012 +0200
@@ -0,0 +1,9 @@
+# $FreeBSD: head/usr.sbin/utx/Makefile 231530 2012-02-11 20:28:42Z ed $
+
+PROG=	utx
+MAN=	utx.8
+
+LINKS=	${BINDIR}/utx ${BINDIR}/utxrm
+MLINKS=	utx.8 utxrm.8
+
+.include <bsd.prog.mk>
diff -r a085b3559102 -r ea1903d719a7 head/usr.sbin/utx/utx.8
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/usr.sbin/utx/utx.8	Fri Mar 02 17:04:50 2012 +0200
@@ -0,0 +1,107 @@
+.\" Copyright (c) 2011-2012 Ed Schouten <ed at FreeBSD.org>
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD: head/usr.sbin/utx/utx.8 231530 2012-02-11 20:28:42Z ed $
+.\"
+.Dd February 11, 2012
+.Dt UTX 8
+.Os
+.Sh NAME
+.Nm utx ,
+.Nm utxrm
+.Nd manage the user accounting database
+.Sh SYNOPSIS
+.Nm
+.Cm boot
+.Nm
+.Cm shutdown
+.Nm
+.Cm rm
+.Ar identifier
+.Ar ...
+.Nm utxrm
+.Ar identifier
+.Ar ...
+.Sh DESCRIPTION
+The
+.Nm
+utility can be used to perform operations on the user accounting
+database, as done by
+.Xr pututxline 3 .
+.Pp
+The first argument to
+.Nm
+indicates an action to be performed:
+.Bl -tag -width ".Cm shutdown"
+.It Cm boot
+Write a boot time record to the user accounting database.
+This option should typically only be used by
+.Xr rc 8 .
+.It Cm shutdown
+Write a shutdown time record to the user accounting database.
+This option should typically only be used by
+.Xr rc 8 .
+.It Cm rm
+Remove stale sessions from the user accounting
+database, by referring to their
+.Ar identifier .
+Stale sessions can occur if a login service exits prematurely or fails
+to remove the session from the accounting database.
+.Pp
+Utilities such as
+.Xr w 1
+will not display the identifier corresponding with a login session,
+since its value is typically only of use by the process managing the
+record.
+The following command can be used to obtain all records from the user
+accounting database's active session table, including its identifiers:
+.Pp
+.Dl getent utmpx active
+.Pp
+Identifiers can either be supplied in hexadecimal form as displayed by
+.Xr getent 1 ,
+or as a string if the identifier allows such a representation.
+.Pp
+To remain backward compatible, this action can also be invoked directly
+by using the
+.Nm utxrm
+command.
+.El
+.Pp
+.Pp
+Because this utility requires write-access to the user accounting
+database, its use is limited to the super-user.
+.Sh SEE ALSO
+.Xr getent 1 ,
+.Xr w 1 ,
+.Xr pututxline 3 .
+.Sh HISTORY
+The
+.Nm
+utility replaced
+.Nm utxrm
+in
+.Fx 10.0 .
+.Sh AUTHORS
+.An Ed Schouten Aq ed at FreeBSD.org
diff -r a085b3559102 -r ea1903d719a7 head/usr.sbin/utx/utx.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/usr.sbin/utx/utx.c	Fri Mar 02 17:04:50 2012 +0200
@@ -0,0 +1,114 @@
+/*-
+ * Copyright (c) 2011-2012 Ed Schouten <ed at FreeBSD.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: head/usr.sbin/utx/utx.c 231530 2012-02-11 20:28:42Z ed $");
+
+#include <sys/time.h>
+#include <errno.h>
+#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <utmpx.h>
+
+static int
+b16_pton(const char *in, char *out, size_t len)
+{
+	size_t i;
+
+	for (i = 0; i < len * 2; i++)
+		if (!isxdigit((unsigned char)in[i]))
+			return (1);
+	for (i = 0; i < len; i++)
+		sscanf(&in[i * 2], "%02hhx", &out[i]);
+	return (0);
+}
+
+static int
+rm(char *id[])
+{
+	struct utmpx utx = { .ut_type = DEAD_PROCESS };
+	size_t len;
+	int ret = 0;
+
+	(void)gettimeofday(&utx.ut_tv, NULL);
+	for (; *id != NULL; id++) {
+		len = strlen(*id);
+		if (len <= sizeof(utx.ut_id)) {
+			/* Identifier as string. */
+			strncpy(utx.ut_id, *id, sizeof(utx.ut_id));
+		} else if (len != sizeof(utx.ut_id) * 2 ||
+		    b16_pton(*id, utx.ut_id, sizeof(utx.ut_id)) != 0) {
+			/* Also not hexadecimal. */
+			fprintf(stderr, "%s: Invalid identifier format\n", *id);
+			ret = 1;
+			continue;
+		}
+
+		/* Zap the entry. */
+		if (pututxline(&utx) == NULL) {
+			perror(*id);
+			ret = 1;
+		}
+	}
+	return (ret);
+}
+
+static int
+boot(short type)
+{
+	struct utmpx utx = { .ut_type = type };
+
+	(void)gettimeofday(&utx.ut_tv, NULL);
+	if (pututxline(&utx) == NULL) {
+		perror("pututxline");
+		return (1);
+	}
+	return (0);
+}
+
+int
+main(int argc, char *argv[])
+{
+
+	if (argc >= 2 && strcmp(getprogname(), "utxrm") == 0)
+		/* For compatibility. */
+		return (rm(&argv[1]));
+	else if (argc == 2 && strcmp(argv[1], "boot") == 0)
+		return (boot(BOOT_TIME));
+	else if (argc == 2 && strcmp(argv[1], "shutdown") == 0)
+		return (boot(SHUTDOWN_TIME));
+	else if (argc >= 3 && strcmp(argv[1], "rm") == 0)
+		return (rm(&argv[2]));
+
+	fprintf(stderr,
+	    "usage: utx boot\n"
+	    "       utx shutdown\n"
+	    "       utx rm identifier ...\n"
+	    "       utxrm identifier ...\n");
+	exit(1);
+}
diff -r a085b3559102 -r ea1903d719a7 head/usr.sbin/utxrm/Makefile
--- a/head/usr.sbin/utxrm/Makefile	Fri Mar 02 17:02:21 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-# $FreeBSD$
-
-PROG=	utxrm
-MAN=	utxrm.8
-
-.include <bsd.prog.mk>
diff -r a085b3559102 -r ea1903d719a7 head/usr.sbin/utxrm/utxrm.8
--- a/head/usr.sbin/utxrm/utxrm.8	Fri Mar 02 17:02:21 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-.\" Copyright (c) 2011 Ed Schouten <ed at FreeBSD.org>
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\"    notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\"    notice, this list of conditions and the following disclaimer in the
-.\"    documentation and/or other materials provided with the distribution.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" $FreeBSD$
-.\"
-.Dd February 19, 2011
-.Dt UTXRM 8
-.Os
-.Sh NAME
-.Nm utxrm
-.Nd remove sessions from the user accounting database
-.Sh SYNOPSIS
-.Nm
-.Ar identifier
-.Ar ...
-.Sh DESCRIPTION
-The
-.Nm
-utility can be used to remove stale sessions from the user accounting
-database, by referring to their
-.Ar identifier .
-Stale sessions can occur if a login service exits prematurely or fails
-to remove the session from the accounting database.
-.Pp
-Utilities such as
-.Xr w 1
-will not display the identifier corresponding with a login session,
-since its value is typically only of use by the process managing the
-record.
-The following command can be used to obtain all records from the user
-accounting database's active session table, including its identifiers:
-.Pp
-.Dl getent utmpx active
-.Pp
-Identifiers can either be supplied in hexadecimal form as displayed by
-.Xr getent 1 ,
-or as a string if the identifier allows such a representation.
-.Pp
-Because this utility requires write-access to the user accounting
-database, its use is limited to the super-user.
-.Sh SEE ALSO
-.Xr getent 1 ,
-.Xr w 1 ,
-.Xr pututxline 3 .
-.Sh HISTORY
-The
-.Nm
-utility appeared in
-.Fx 9.0 .
-.Sh AUTHORS
-.An Ed Schouten Aq ed at FreeBSD.org
diff -r a085b3559102 -r ea1903d719a7 head/usr.sbin/utxrm/utxrm.c
--- a/head/usr.sbin/utxrm/utxrm.c	Fri Mar 02 17:02:21 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/*-
- * Copyright (c) 2011 Ed Schouten <ed at FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/time.h>
-#include <errno.h>
-#include <ctype.h>
-#include <stdio.h>
-#include <string.h>
-#include <utmpx.h>
-
-static int
-b16_pton(const char *in, char *out, size_t len)
-{
-	size_t i;
-
-	for (i = 0; i < len * 2; i++)
-		if (!isxdigit((unsigned char)in[i]))
-			return (1);
-	for (i = 0; i < len; i++)
-		sscanf(&in[i * 2], "%02hhx", &out[i]);
-	return (0);
-}
-
-int
-main(int argc, char *argv[])
-{
-	struct utmpx utx = { .ut_type = DEAD_PROCESS };
-	size_t len;
-	int i, ret = 0;
-
-	if (argc < 2) {
-		fprintf(stderr, "usage: utxrm identifier ...\n");
-		return (1);
-	}
-
-	gettimeofday(&utx.ut_tv, NULL);
-	for (i = 1; i < argc; i++) {
-		len = strlen(argv[i]);
-		if (len <= sizeof(utx.ut_id)) {
-			/* Identifier as string. */
-			strncpy(utx.ut_id, argv[i], sizeof(utx.ut_id));
-		} else if (len != sizeof(utx.ut_id) * 2 ||
-		    b16_pton(argv[i], utx.ut_id, sizeof(utx.ut_id)) != 0) {
-			/* Also not hexadecimal. */
-			fprintf(stderr, "%s: Invalid identifier format\n",
-			    argv[i]);
-			ret = 1;
-			continue;
-		}
-
-		/* Zap the entry. */
-		if (pututxline(&utx) == NULL) {
-			perror(argv[i]);
-			ret = 1;
-		}
-	}
-	return (ret);
-}
diff -r a085b3559102 -r ea1903d719a7 head/usr.sbin/vipw/vipw.8
--- a/head/usr.sbin/vipw/vipw.8	Fri Mar 02 17:02:21 2012 +0200
+++ b/head/usr.sbin/vipw/vipw.8	Fri Mar 02 17:04:50 2012 +0200
@@ -26,9 +26,9 @@
 .\" SUCH DAMAGE.
 .\"
 .\"     @(#)vipw.8	8.1 (Berkeley) 6/6/93
-.\" $FreeBSD$
+.\" $FreeBSD: head/usr.sbin/vipw/vipw.8 231648 2012-02-14 09:29:37Z ed $
 .\"
-.Dd June 6, 1993
+.Dd February 14, 2012
 .Dt VIPW 8
 .Os
 .Sh NAME
@@ -112,8 +112,11 @@
 .Bx 4.0 .
 .Sh BUGS
 The mechanism for checking for password file modifications requires that
+the modification time of the password file changes.
+This means that in a default configuration where file system timestamps
+are not calculated with sub-second precision,
 .Ev EDITOR
-run for at least one second.
+has to run for at least one second.
 Non-interactive editor scripts should invoke
 .Xr sleep 1
 or equivalent to ensure this happens.
diff -r a085b3559102 -r ea1903d719a7 head/usr.sbin/wake/wake.c
--- a/head/usr.sbin/wake/wake.c	Fri Mar 02 17:02:21 2012 +0200
+++ b/head/usr.sbin/wake/wake.c	Fri Mar 02 17:04:50 2012 +0200
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: head/usr.sbin/wake/wake.c 232102 2012-02-24 07:54:08Z jh $");
 
 #include <sys/ioctl.h>
 #include <sys/socket.h>
@@ -78,7 +78,7 @@
 	if (get_ether(host, &macaddr) == -1)
 		return (-1);
 
-	return send_wakeup(bpf, &macaddr);
+	return (send_wakeup(bpf, &macaddr));
 }
 
 static int
@@ -111,10 +111,10 @@
 	int nifs;
 
 	if (dst == NULL || len == 0)
-		return 0;
+		return (0);
 
 	if (getifaddrs(&ifap) != 0)
-		return -1;
+		return (-1);
 
 	/* XXX also check the link state */
 	for (nifs = 0, ifa = ifap; ifa; ifa = ifa->ifa_next)
@@ -128,7 +128,7 @@
 		}
 
 	freeifaddrs(ifap);
-	return nifs == 1 ? 0 : -1;
+	return (nifs == 1 ? 0 : -1);
 }
 
 static int
@@ -183,7 +183,7 @@
 int
 main(int argc, char *argv[])
 {
-	int bpf, n;
+	int bpf, n, rval;
 	char ifname[IF_NAMESIZE];
 
 	if (argc < 2)
@@ -204,10 +204,13 @@
 
 	if (n >= argc)
 		usage();
-	for (; n < argc; n++)
-		if (wake(bpf, argv[n]))
+	rval = 0;
+	for (; n < argc; n++) {
+		if (wake(bpf, argv[n]) != 0) {
+			rval = 1;
 			warn("Cannot send Wake on LAN frame over `%s' to `%s'",
 			    ifname, argv[n]);
-
-	return (0);
+		}
+	}
+	exit(rval);
 }
diff -r a085b3559102 -r ea1903d719a7 head/usr.sbin/wpa/hostapd/hostapd.8
--- a/head/usr.sbin/wpa/hostapd/hostapd.8	Fri Mar 02 17:02:21 2012 +0200
+++ b/head/usr.sbin/wpa/hostapd/hostapd.8	Fri Mar 02 17:04:50 2012 +0200
@@ -22,7 +22,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\" $FreeBSD$
+.\" $FreeBSD: head/usr.sbin/wpa/hostapd/hostapd.8 231257 2012-02-09 08:33:04Z kevlo $
 .\"
 .Dd October 26, 2007
 .Dt HOSTAPD 8
@@ -112,6 +112,7 @@
 .Xr ipw 4 ,
 .Xr iwi 4 ,
 .Xr ral 4 ,
+.Xr run 4 ,
 .Xr ural 4 ,
 .Xr wi 4 ,
 .Xr hostapd.conf 5 ,
diff -r a085b3559102 -r ea1903d719a7 head/usr.sbin/yppush/Makefile
--- a/head/usr.sbin/yppush/Makefile	Fri Mar 02 17:02:21 2012 +0200
+++ b/head/usr.sbin/yppush/Makefile	Fri Mar 02 17:04:50 2012 +0200
@@ -1,4 +1,4 @@
-# $FreeBSD$
+# $FreeBSD: head/usr.sbin/yppush/Makefile 231118 2012-02-07 09:27:07Z dim $
 
 RPCDIR=	${.CURDIR}/../../include/rpcsvc
 .PATH: ${RPCDIR} ${.CURDIR}/../../usr.sbin/ypserv \
@@ -14,7 +14,7 @@
 
 WARNS?=	2
 
-RPCGEN= rpcgen -C
+RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -C
 
 CLEANFILES= ${GENSRCS}
 
diff -r a085b3559102 -r ea1903d719a7 head/usr.sbin/ypserv/Makefile
--- a/head/usr.sbin/ypserv/Makefile	Fri Mar 02 17:02:21 2012 +0200
+++ b/head/usr.sbin/ypserv/Makefile	Fri Mar 02 17:04:50 2012 +0200
@@ -1,4 +1,4 @@
-# $FreeBSD$
+# $FreeBSD: head/usr.sbin/ypserv/Makefile 231118 2012-02-07 09:27:07Z dim $
 
 RPCDIR=	${.CURDIR}/../../include/rpcsvc
 .PATH: ${RPCDIR}
@@ -17,7 +17,7 @@
 
 CLEANFILES= yp_svc.c ypxfr_clnt.c yp.h
 
-RPCGEN= rpcgen -I -C
+RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -I -C
 
 # We need to remove the 'static' keyword from _rpcsvcstate so that
 # yp_main.c can see it.


More information about the Zrouter-src-freebsd mailing list