CVS commit: src/lib/libperfuse

2014-01-06 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Mon Jan  6 08:56:34 UTC 2014

Modified Files:
src/lib/libperfuse: ops.c

Log Message:
For filesystems mounted without -o use_ino, readdir is not
able to fetch inode number. We perfom an addtional lookup
on each file to get it.

In that case, do not lookup .. from root, as it breaks
out of the filesystem and hits NULL pointers.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/lib/libperfuse/ops.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libperfuse/ops.c
diff -u src/lib/libperfuse/ops.c:1.62 src/lib/libperfuse/ops.c:1.63
--- src/lib/libperfuse/ops.c:1.62	Fri Jul 19 07:32:35 2013
+++ src/lib/libperfuse/ops.c	Mon Jan  6 08:56:34 2014
@@ -1,4 +1,4 @@
-/*  $NetBSD: ops.c,v 1.62 2013/07/19 07:32:35 manu Exp $ */
+/*  $NetBSD: ops.c,v 1.63 2014/01/06 08:56:34 manu Exp $ */
 
 /*-
  *  Copyright (c) 2010-2011 Emmanuel Dreyfus. All rights reserved.
@@ -644,13 +644,23 @@ fuse_to_dirent(struct puffs_usermount *p
 		 */
 		if (fd-ino == PERFUSE_UNKNOWN_INO) {
 			struct puffs_node *pn;
+			struct perfuse_node_data *pnd = PERFUSE_NODE_DATA(opc);
 
-			if (node_lookup_common(pu, opc, NULL, fd-name,
-	   NULL, pn) != 0) {
-DWARNX(node_lookup_common failed);
+			/* 
+			 * Avoid breaking out of fs 
+			 * by lookup to .. on root
+			 */
+			if ((strcmp(fd-name, ..) == 0)  
+			(pnd-pnd_nodeid == FUSE_ROOT_ID)) {
+fd-ino = FUSE_ROOT_ID;
 			} else {
-fd-ino = pn-pn_va.va_fileid;
-(void)perfuse_node_reclaim(pu, pn);
+if (node_lookup_common(pu, opc, NULL, fd-name,
+		   NULL, pn) != 0) {
+	DWARNX(node_lookup_common failed);
+} else {
+	fd-ino = pn-pn_va.va_fileid;
+	(void)perfuse_node_reclaim(pu, pn);
+}
 			}
 		}
 



CVS commit: src/share/man/man3lua

2014-01-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Jan  6 09:23:18 UTC 2014

Modified Files:
src/share/man/man3lua: intro.3lua sqlite.3lua syslog.3lua

Log Message:
Use Nx. Remove superfluous Pp. Increase column width to widest entry.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/share/man/man3lua/intro.3lua
cvs rdiff -u -r1.2 -r1.3 src/share/man/man3lua/sqlite.3lua
cvs rdiff -u -r1.1 -r1.2 src/share/man/man3lua/syslog.3lua

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man3lua/intro.3lua
diff -u src/share/man/man3lua/intro.3lua:1.4 src/share/man/man3lua/intro.3lua:1.5
--- src/share/man/man3lua/intro.3lua:1.4	Wed Nov 13 20:55:08 2013
+++ src/share/man/man3lua/intro.3lua	Mon Jan  6 09:23:18 2014
@@ -1,4 +1,4 @@
-.\	$NetBSD: intro.3lua,v 1.4 2013/11/13 20:55:08 mbalmer Exp $
+.\	$NetBSD: intro.3lua,v 1.5 2014/01/06 09:23:18 wiz Exp $
 .\
 .\ Copyright (c) 2013 Marc Balmer mbal...@netbsd.org. All rights reserved.
 .\
@@ -37,14 +37,15 @@
 This section provides an overview of the Lua modules, their
 functions, error returns and other common definitions and concepts.
 .Pp
-The Lua modules provided by NetBSD are:
+The Lua modules provided by
+.Nx
+are:
 .Pp
-.Bl -tag -width  -compact
+.Bl -tag -width syslog -compact
 .It Em gpio
 Access
 .Xr gpio 4
 pins.
-.Pp
 .It Em sqlite
 Access
 .Xr sqlite3 1

Index: src/share/man/man3lua/sqlite.3lua
diff -u src/share/man/man3lua/sqlite.3lua:1.2 src/share/man/man3lua/sqlite.3lua:1.3
--- src/share/man/man3lua/sqlite.3lua:1.2	Mon Dec 23 12:50:56 2013
+++ src/share/man/man3lua/sqlite.3lua	Mon Jan  6 09:23:18 2014
@@ -1,4 +1,4 @@
-.\	$NetBSD: sqlite.3lua,v 1.2 2013/12/23 12:50:56 njoly Exp $
+.\	$NetBSD: sqlite.3lua,v 1.3 2014/01/06 09:23:18 wiz Exp $
 .\
 .\ Copyright (c) 2013 Marc Balmer mbal...@netbsd.org. All rights reserved.
 .\
@@ -244,7 +244,8 @@ Out of memory.
 Attempt to write a readonly database.
 .Pp
 .It Dv sqlite.INTERRUPT
-Operation terminated by sqlite3_interrupt().
+Operation terminated by
+.Fn sqlite3_interrupt .
 .Pp
 .It Dv sqlite.IOERR
 Some kind of disk I/O error occurred.
@@ -253,7 +254,8 @@ Some kind of disk I/O error occurred.
 The database disk image is malformed.
 .Pp
 .It Dv sqlite.NOTFOUND
-Unknown opcode in sqlite3_file_control().
+Unknown opcode in
+.Fn sqlite3_file_control .
 .Pp
 .It Dv sqlite.FULL
 Insertion failed because database is full.

Index: src/share/man/man3lua/syslog.3lua
diff -u src/share/man/man3lua/syslog.3lua:1.1 src/share/man/man3lua/syslog.3lua:1.2
--- src/share/man/man3lua/syslog.3lua:1.1	Wed Nov 13 20:55:08 2013
+++ src/share/man/man3lua/syslog.3lua	Mon Jan  6 09:23:18 2014
@@ -1,4 +1,4 @@
-.\	$NetBSD: syslog.3lua,v 1.1 2013/11/13 20:55:08 mbalmer Exp $
+.\	$NetBSD: syslog.3lua,v 1.2 2014/01/06 09:23:18 wiz Exp $
 .\
 .\ Copyright (c) 2013 Marc Balmer mbal...@netbsd.org. All rights reserved.
 .\
@@ -200,8 +200,8 @@ with a priority not set in maskpri are r
 .Sh SEE ALSO
 .Xr lua 1 ,
 .Xr luac 1 ,
-.Xr intro 3lua ,
 .Xr syslog 3 ,
+.Xr intro 3lua ,
 .Xr syslogd 8
 .Sh HISTORY
 A



CVS commit: src/share/man/man3lua

2014-01-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Jan  6 09:25:08 UTC 2014

Modified Files:
src/share/man/man3lua: gpio.3lua

Log Message:
Fix article.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/share/man/man3lua/gpio.3lua

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man3lua/gpio.3lua
diff -u src/share/man/man3lua/gpio.3lua:1.2 src/share/man/man3lua/gpio.3lua:1.3
--- src/share/man/man3lua/gpio.3lua:1.2	Sun Oct 27 11:43:07 2013
+++ src/share/man/man3lua/gpio.3lua	Mon Jan  6 09:25:08 2014
@@ -1,4 +1,4 @@
-.\	$NetBSD: gpio.3lua,v 1.2 2013/10/27 11:43:07 mbalmer Exp $
+.\	$NetBSD: gpio.3lua,v 1.3 2014/01/06 09:25:08 wiz Exp $
 .\
 .\ Copyright (c) 2013 Marc Balmer mbal...@netbsd.org. All rights reserved.
 .\
@@ -166,7 +166,7 @@ end
 .Xr intro 3lua ,
 .Xr gpio 4
 .Sh HISTORY
-An
+A
 .Nm
 manual appeared in
 .Nx 7.0 .



CVS commit: src/share/man/man3lua

2014-01-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Jan  6 09:30:26 UTC 2014

Modified Files:
src/share/man/man3lua: sqlite.3lua

Log Message:
Use Fn for functions and Dv for null.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/share/man/man3lua/sqlite.3lua

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man3lua/sqlite.3lua
diff -u src/share/man/man3lua/sqlite.3lua:1.3 src/share/man/man3lua/sqlite.3lua:1.4
--- src/share/man/man3lua/sqlite.3lua:1.3	Mon Jan  6 09:23:18 2014
+++ src/share/man/man3lua/sqlite.3lua	Mon Jan  6 09:30:26 2014
@@ -1,4 +1,4 @@
-.\	$NetBSD: sqlite.3lua,v 1.3 2014/01/06 09:23:18 wiz Exp $
+.\	$NetBSD: sqlite.3lua,v 1.4 2014/01/06 09:30:26 wiz Exp $
 .\
 .\ Copyright (c) 2013 Marc Balmer mbal...@netbsd.org. All rights reserved.
 .\
@@ -86,7 +86,8 @@ Workstation applications using SQLite no
 function.
 .Pp
 .It Dv sqlite.shutdown()
-Deallocate any resources that were allocated by sqlite.initialize().
+Deallocate any resources that were allocated by
+.Fn sqlite.initialize .
 Workstation applications using SQLite normally do not need to invoke this
 function.
 .Pp
@@ -122,7 +123,7 @@ Return the SQLite3 library source id as 
 .El
 .Sh DATABASE FUNCTIONS
 Database functions operate on database objects returned by
-.Em sqlite.open() .
+.Fn sqlite.open .
 .Pp
 .Bl -tag -width  -compact
 .It Dv err = sqlite.close(db)
@@ -188,16 +189,22 @@ in the prepared statement
 .Ar stmt .
 .Pp
 .It Dv sqlite.reset(stmt)
-The sqlite.reset() function is called to reset a prepared statement object back
+The
+.Fn sqlite.reset
+function is called to reset a prepared statement object back
 to its initial state, ready to be re-executed.
 .Pp
 .It Dv sqlite.clear_bindings(stmt)
-Contrary to the intuition of many, sqlite.reset() does not reset the bindings on
-a prepared statement.
-Use this routine to reset all host parameters to NULL.
+Contrary to the intuition of many,
+.Fn sqlite.reset
+does not reset the bindings on a prepared statement.
+Use this routine to reset all host parameters to
+.Dv NULL .
 .Pp
 .It Dv sqlite.finalize(stmt)
-The sqlite.finalize() function is called to delete a prepared statement.
+The
+.Fn sqlite.finalize
+function is called to delete a prepared statement.
 .Pp
 .It Dv name = sqlite.column_name(stmt, cidx)
 Return the name assigned to a particular column in the result set of a SELECT
@@ -294,16 +301,20 @@ Authorization denied.
 Auxiliary database format error.
 .Pp
 .It Dv sqlite.RANGE
-2nd parameter to sqlite.bind() out of range.
+2nd parameter to
+.Fn sqlite.bind
+out of range.
 .Pp
 .It Dv sqlite.NOTADB
 File opened that is not a database file.
 .Pp
 .It Dv sqlite.ROW
-sqlite.step() has another row ready.
+.Fn sqlite.step
+has another row ready.
 .Pp
 .It Dv sqlite.DONE
-sqlite.step() has finished executing.
+.Fn sqlite.step
+has finished executing.
 .El
 .Sh SEE ALSO
 .Xr lua 1 ,



CVS commit: src/distrib/ews4800mips

2014-01-06 Thread Alan Barrett
Module Name:src
Committed By:   apb
Date:   Mon Jan  6 11:03:25 UTC 2014

Modified Files:
src/distrib/ews4800mips: Makefile

Log Message:
Add cdroms to the SUBDIR list for src/distrib/ews4800mips.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/distrib/ews4800mips/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/ews4800mips/Makefile
diff -u src/distrib/ews4800mips/Makefile:1.2 src/distrib/ews4800mips/Makefile:1.3
--- src/distrib/ews4800mips/Makefile:1.2	Tue Mar  6 21:57:00 2007
+++ src/distrib/ews4800mips/Makefile	Mon Jan  6 11:03:25 2014
@@ -1,6 +1,6 @@
-#	$NetBSD: Makefile,v 1.2 2007/03/06 21:57:00 bouyer Exp $
+#	$NetBSD: Makefile,v 1.3 2014/01/06 11:03:25 apb Exp $
 
-SUBDIR=		floppies
+SUBDIR=		floppies cdroms
 TARGETS+=	release
 
 iso_image:



CVS commit: src/etc

2014-01-06 Thread Alan Barrett
Module Name:src
Committed By:   apb
Date:   Mon Jan  6 11:21:34 UTC 2014

Modified Files:
src/etc: ntp.conf

Log Message:
Add several restrict lines to the default ntp.conf, with comments.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/etc/ntp.conf

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/etc/ntp.conf
diff -u src/etc/ntp.conf:1.15 src/etc/ntp.conf:1.16
--- src/etc/ntp.conf:1.15	Sat Dec 28 03:18:39 2013
+++ src/etc/ntp.conf	Mon Jan  6 11:21:34 2014
@@ -1,4 +1,4 @@
-# $NetBSD: ntp.conf,v 1.15 2013/12/28 03:18:39 christos Exp $
+# $NetBSD: ntp.conf,v 1.16 2014/01/06 11:21:34 apb Exp $
 #
 # NetBSD default Network Time Protocol (NTP) configuration file for ntpd
 
@@ -36,6 +36,46 @@ mdnstries	0
 # the following line
 # enable mode7
 
+# Access control restrictions.
+# See /usr/share/doc/html/ntp/accopt.html for syntax.
+# See http://support.ntp.org/bin/view/Support/AccessRestrictions for advice.
+# Last match wins.
+#
+# Some of the more common keywords are:
+#   ignore  Deny packets of all kinds.
+#   kod Send kiss-o'-death packets if clients exceed rate
+#   limits.
+#   nomodifyDeny attempts to modify the state of the server via
+#   ntpq or ntpdc queries.
+#   noquery Deny all ntpq and ntpdc queries.  Does not affect time
+#   synchronisation.
+#   nopeer  Prevent establishing an new peer association.
+#   Does not affect preconfigured peer associations.
+#   Does not affect client/server time synchronisation.
+#   noserve Deny all time synchronisation.  Does not affect ntpq or
+#   ntpdc queries.
+#   notrap  Deny the trap subset of the ntpdc control message protocol.
+#   notrust Deny packets that are not cryptographically authenticated.
+#
+# By default, either deny everything, or allow client/server time exchange
+# but deny configuration changes, queries, and peer associations that were not
+# explicitly configured.
+# (Uncomment one of the following restrict default lines.)
+#
+#restrict default ignore
+restrict default kod nopeer noquery
+
+# Fewer restrictions for the local subnet.
+# (Uncomment and adjust as appropriate.)
+#
+#restrict 192.0.2.0 mask 255.255.255.0 kod nomodify notrap nopeer
+#restrict 2001:db8:: mask :::  kod nomodify notrap nopeer
+
+# No restrictions for localhost.
+#
+restrict 127.0.0.1
+restrict ::1
+
 # Hereafter should be server or peer statements to configure other
 # hosts to exchange NTP packets with. Peers should be selected in such
 # a way that the network path to them is symmetric (that is, the series
@@ -56,9 +96,13 @@ mdnstries	0
 # Ideally, you should select at least three other systems to talk NTP
 # with, for an what I tell you three times is true effect.
 #
+# A restrict line for each configured peer or server might be necessary,
+# if the restrict default settings are very restrictive.  As a courtesy
+# to configured peers and servers, consider allowing them to query.
 
 #peer		an.ntp.peer.goes.here
 #server		an.ntp.server.goes.here
+#restrict	an.ntp.server.goes.here nomodify notrap
 
 # Public servers from the pool.ntp.org project. Volunteer's servers
 # are dynamically assigned to the CNAMES below via DNS round-robin.
@@ -75,6 +119,10 @@ mdnstries	0
 # to the NetBSD project.
 
 server		0.netbsd.pool.ntp.org
+restrict	0.netbsd.pool.ntp.org nomodify notrap
 server		1.netbsd.pool.ntp.org
+restrict	1.netbsd.pool.ntp.org nomodify notrap
 server		2.netbsd.pool.ntp.org
+restrict	2.netbsd.pool.ntp.org nomodify notrap
 server		3.netbsd.pool.ntp.org
+restrict	3.netbsd.pool.ntp.org nomodify notrap



CVS commit: src/etc

2014-01-06 Thread Alan Barrett
Module Name:src
Committed By:   apb
Date:   Mon Jan  6 11:25:03 UTC 2014

Modified Files:
src/etc: ntp.conf

Log Message:
Attempt to improve comments about how to choose servers,
and about what tos minsane does.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/etc/ntp.conf

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/etc/ntp.conf
diff -u src/etc/ntp.conf:1.16 src/etc/ntp.conf:1.17
--- src/etc/ntp.conf:1.16	Mon Jan  6 11:21:34 2014
+++ src/etc/ntp.conf	Mon Jan  6 11:25:03 2014
@@ -1,4 +1,4 @@
-# $NetBSD: ntp.conf,v 1.16 2014/01/06 11:21:34 apb Exp $
+# $NetBSD: ntp.conf,v 1.17 2014/01/06 11:25:03 apb Exp $
 #
 # NetBSD default Network Time Protocol (NTP) configuration file for ntpd
 
@@ -23,7 +23,8 @@ driftfile	/var/db/ntp.drift
 
 logconfig	-syncstatus
 
-# This will help minimize disruptions due to network congestion. Don't
+# Refuse to set the local clock if there are too few good peers or servers.
+# This may help minimize disruptions due to network congestion. Don't
 # do this if you configure only one server!
 
 tos		minsane 2
@@ -77,21 +78,18 @@ restrict 127.0.0.1
 restrict ::1
 
 # Hereafter should be server or peer statements to configure other
-# hosts to exchange NTP packets with. Peers should be selected in such
-# a way that the network path to them is symmetric (that is, the series
-# of links and routers used to get to the peer is the same one that the
-# peer uses to get back. NTP assumes such symmetry in its network delay
-# calculation. NTP will apply an incorrect adjustment to timestamps
-# received from the peer if the path is not symmetric. This can result
-# in clock skew (your system clock being maintained consistently wrong
-# by a certain amount).
-#
-# The best way to select symmetric peers is to make sure that the
-# network path to them is as short as possible (this reduces the chance
-# that there is more than one network path between you and your peer).
-# You can measure these distances with the traceroute(8)  program. The
-# best place to start looking for NTP peers for your system is within
-# your own network, or at your Internet Service Provider (ISP).
+# hosts to exchange NTP packets with.
+#
+# See http://support.ntp.org/bin/view/Support/DesigningYourNTPNetwork
+# and http://support.ntp.org/bin/view/Support/SelectingOffsiteNTPServers
+# for advice.
+#
+# Peers should be selected in such a way that the network path to them
+# is short, uncongested, and symmetric (that is, the series of links
+# and routers used to get to the peer is the same one that the peer
+# uses to get back).  The best place to start looking for NTP peers for
+# your system is within your own network, or at your Internet Service
+# Provider (ISP).
 #
 # Ideally, you should select at least three other systems to talk NTP
 # with, for an what I tell you three times is true effect.
@@ -104,8 +102,13 @@ restrict ::1
 #server		an.ntp.server.goes.here
 #restrict	an.ntp.server.goes.here nomodify notrap
 
-# Public servers from the pool.ntp.org project. Volunteer's servers
-# are dynamically assigned to the CNAMES below via DNS round-robin.
+# The pool.ntp.org project coordinates public time servers provided by
+# volunteers.  See http://www.pool.ntp.org.  The *.netbsd.pool.ntp.org
+# servers are intended to be used by default on NetBSD hosts, but
+# servers that are closer to you are likely to be better.  Consider
+# using servers specific to your country, a nearby country, or your
+# continent.
+#
 # The pool.ntp.org project needs more volunteers! The only criteria to
 # join are a nailed-up connection and a static IP address. For details,
 # see the web page:



CVS commit: src/etc

2014-01-06 Thread Alan Barrett
Module Name:src
Committed By:   apb
Date:   Mon Jan  6 11:26:06 UTC 2014

Modified Files:
src/etc: ntp.conf

Log Message:
Another comment change, missed in previous commit.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/etc/ntp.conf

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/etc/ntp.conf
diff -u src/etc/ntp.conf:1.17 src/etc/ntp.conf:1.18
--- src/etc/ntp.conf:1.17	Mon Jan  6 11:25:03 2014
+++ src/etc/ntp.conf	Mon Jan  6 11:26:06 2014
@@ -1,4 +1,4 @@
-# $NetBSD: ntp.conf,v 1.17 2014/01/06 11:25:03 apb Exp $
+# $NetBSD: ntp.conf,v 1.18 2014/01/06 11:26:06 apb Exp $
 #
 # NetBSD default Network Time Protocol (NTP) configuration file for ntpd
 
@@ -116,11 +116,6 @@ restrict ::1
 #	http://www.pool.ntp.org/join.html
 #
 
-# Depending on the vagaries of DNS can occasionally pull in the same
-# server twice. The following CNAMES are guaranteed to be disjoint, at
-# least over some short interval. The following servers are allocated
-# to the NetBSD project.
-
 server		0.netbsd.pool.ntp.org
 restrict	0.netbsd.pool.ntp.org nomodify notrap
 server		1.netbsd.pool.ntp.org



CVS commit: src/share/man/man9lua

2014-01-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Jan  6 13:03:33 UTC 2014

Modified Files:
src/share/man/man9lua: core.9lua pmf.9lua systm.9lua

Log Message:
Use more markup. Fix a typo.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/man/man9lua/core.9lua \
src/share/man/man9lua/pmf.9lua src/share/man/man9lua/systm.9lua

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man9lua/core.9lua
diff -u src/share/man/man9lua/core.9lua:1.1 src/share/man/man9lua/core.9lua:1.2
--- src/share/man/man9lua/core.9lua:1.1	Tue Oct 29 08:34:07 2013
+++ src/share/man/man9lua/core.9lua	Mon Jan  6 13:03:33 2014
@@ -1,4 +1,4 @@
-.\	$NetBSD: core.9lua,v 1.1 2013/10/29 08:34:07 mbalmer Exp $
+.\	$NetBSD: core.9lua,v 1.2 2014/01/06 13:03:33 wiz Exp $
 .\
 .\ Copyright (c) 2013 Marc Balmer mbal...@netbsd.org. All rights reserved.
 .\
@@ -65,7 +65,11 @@ Send
 to the console.
 .Pp
 .It Dv core.print_nolog(msg)
-The core.print_nolog() function is identical to the core.print() function,
+The
+.Fn core.print_nolog
+function is identical to the
+.Fn core.print
+function,
 except is does not send
 .Ar msg
 to lthe system og.
@@ -78,37 +82,53 @@ to the current process's controlling tty
 .It Dv core.aprint_normal(msg)
 Send
 .Ar msg
-to the console unless AB_QUIET is set.
+to the console unless
+.Dv AB_QUIET
+is set.
 Always sends to the log.
 .Pp
 .It Dv core.aprint_naive(msg)
 Send
 .Ar msg
-to the console only if AB_QUIET is set.
+to the console only if
+.Dv AB_QUIET
+is set.
 Never sends to the log.
 .Pp
 .It Dv core.aprint_verbose(msg)
 Send
 .Ar msg
-to the console only if AB_VERBOSE is set.
+to the console only if
+.Dv AB_VERBOSE
+is set.
 Always sends to the log.
 .Pp
 .It Dv core.aprint_debug(msg)
 Send
 .Ar msg
-to the console and the log only if AB_DEBUG is set.
+to the console and the log only if
+.Dv AB_DEBUG
+is set.
 .Pp
 .It Dv core.aprint_error(msg)
-Like core.aprint_normal(), but also keeps track of the number of times called.
+Like
+.Fn core.aprint_normal ,
+but also keeps track of the number of times called.
 This allows a subsystem to report the number of errors that occurred during a
 quiet or silent initialization phase.
 .Pp
 .It Dv count = core.aprint_get_error_count()
-The core.aprint_get_error_count() function reports the number of errors and
+The
+.Fn core.aprint_get_error_count
+function reports the number of errors and
 resets the counter to 0.
 .Pp
 .It Dv core.panic(msg)
-The core.panic() function terminates the NetBSD system.
+The
+.Fn core.panic
+function terminates the
+.Nx
+system.
 The message
 .Ar msg
 is printed to the console and saved in the variable
@@ -119,7 +139,7 @@ A newline character is added at the end 
 .Sh VARIABLES
 Upon initialisation, the
 .Nm
-module sets the following variables with the values of the correspondig kernel
+module sets the following variables with the values of the corresponding kernel
 variable:
 .Pp
 .Bl -tag -width  -compact
@@ -136,8 +156,8 @@ variable:
 .Sh SEE ALSO
 .Xr lua 1 ,
 .Xr luac 1 ,
-.Xr intro 9lua ,
-.Xr lua 4
+.Xr lua 4 ,
+.Xr intro 9lua
 .Sh HISTORY
 An
 .Nm
Index: src/share/man/man9lua/pmf.9lua
diff -u src/share/man/man9lua/pmf.9lua:1.1 src/share/man/man9lua/pmf.9lua:1.2
--- src/share/man/man9lua/pmf.9lua:1.1	Tue Oct 29 09:40:44 2013
+++ src/share/man/man9lua/pmf.9lua	Mon Jan  6 13:03:33 2014
@@ -1,4 +1,4 @@
-.\	$NetBSD: pmf.9lua,v 1.1 2013/10/29 09:40:44 mbalmer Exp $
+.\	$NetBSD: pmf.9lua,v 1.2 2014/01/06 13:03:33 wiz Exp $
 .\
 .\ Copyright (c) 2013 Marc Balmer mbal...@netbsd.org. All rights reserved.
 .\
@@ -83,9 +83,9 @@ Returns nil if the key is not present.
 .Sh SEE ALSO
 .Xr lua 1 ,
 .Xr luac 1 ,
-.Xr intro 9lua ,
 .Xr lua 4 ,
-.Xr pmf 9
+.Xr pmf 9 ,
+.Xr intro 9lua
 .Sh HISTORY
 An
 .Nm
Index: src/share/man/man9lua/systm.9lua
diff -u src/share/man/man9lua/systm.9lua:1.1 src/share/man/man9lua/systm.9lua:1.2
--- src/share/man/man9lua/systm.9lua:1.1	Mon Dec 16 23:54:26 2013
+++ src/share/man/man9lua/systm.9lua	Mon Jan  6 13:03:33 2014
@@ -1,4 +1,4 @@
-.\	$NetBSD: systm.9lua,v 1.1 2013/12/16 23:54:26 lneto Exp $
+.\	$NetBSD: systm.9lua,v 1.2 2014/01/06 13:03:33 wiz Exp $
 .\
 .\ Copyright (c) 2013 Marc Balmer mbal...@netbsd.org. All rights reserved.
 .\
@@ -65,7 +65,11 @@ Send
 to the console.
 .Pp
 .It Dv systm.print_nolog(msg)
-The systm.print_nolog() function is identical to the systm.print() function,
+The
+.Fn systm.print_nolog
+function is identical to the
+.Fn systm.print
+function,
 except is does not send
 .Ar msg
 to the system log.
@@ -99,16 +103,24 @@ Send
 to the console and the log only if AB_DEBUG is set.
 .Pp
 .It Dv systm.aprint_error(msg)
-Like systm.aprint_normal(), but also keeps track of the number of times called.
+Like
+.Fn systm.aprint_normal ,
+but also keeps track of the number of times called.
 This allows a subsystem to report the number of errors that occurred during a
 

CVS commit: src/share/man/man9lua

2014-01-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Jan  6 13:03:01 UTC 2014

Modified Files:
src/share/man/man9lua: intro.9lua

Log Message:
Add xrefs to pmf(9lua) and systm(9lua)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/share/man/man9lua/intro.9lua

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man9lua/intro.9lua
diff -u src/share/man/man9lua/intro.9lua:1.3 src/share/man/man9lua/intro.9lua:1.4
--- src/share/man/man9lua/intro.9lua:1.3	Sat Oct 26 17:06:51 2013
+++ src/share/man/man9lua/intro.9lua	Mon Jan  6 13:03:01 2014
@@ -1,4 +1,4 @@
-.\	$NetBSD: intro.9lua,v 1.3 2013/10/26 17:06:51 njoly Exp $
+.\	$NetBSD: intro.9lua,v 1.4 2014/01/06 13:03:01 wiz Exp $
 .\
 .\ Copyright (c) 2013 Marc Balmer mbal...@netbsd.org. All rights reserved.
 .\
@@ -40,7 +40,9 @@ functions, error returns and other commo
 .Xr lua 1 ,
 .Xr luac 1 ,
 .Xr intro 3lua ,
-.Xr lua 4
+.Xr lua 4 ,
+.Xr pmf 9lua ,
+.Xr systm 9lua
 .Sh HISTORY
 An
 .Nm



CVS commit: src/share/man/man9lua

2014-01-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Jan  6 13:05:47 UTC 2014

Removed Files:
src/share/man/man9lua: core.9lua

Log Message:
Remove core.9lua, now called systm.9lua.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r0 src/share/man/man9lua/core.9lua

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src

2014-01-06 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Mon Jan  6 13:59:00 UTC 2014

Modified Files:
src/crypto/external/bsd/netpgp/dist/src/libverify: libnetpgpverify.3
src/share/man/man9/man9.i386: bios32_service.9

Log Message:
Remove extra trailing spaces in functions arguments.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/crypto/external/bsd/netpgp/dist/src/libverify/libnetpgpverify.3
cvs rdiff -u -r1.6 -r1.7 src/share/man/man9/man9.i386/bios32_service.9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/crypto/external/bsd/netpgp/dist/src/libverify/libnetpgpverify.3
diff -u src/crypto/external/bsd/netpgp/dist/src/libverify/libnetpgpverify.3:1.4 src/crypto/external/bsd/netpgp/dist/src/libverify/libnetpgpverify.3:1.5
--- src/crypto/external/bsd/netpgp/dist/src/libverify/libnetpgpverify.3:1.4	Sat Jul 20 21:39:56 2013
+++ src/crypto/external/bsd/netpgp/dist/src/libverify/libnetpgpverify.3	Mon Jan  6 13:59:00 2014
@@ -1,4 +1,4 @@
-.\ $NetBSD: libnetpgpverify.3,v 1.4 2013/07/20 21:39:56 wiz Exp $
+.\ $NetBSD: libnetpgpverify.3,v 1.5 2014/01/06 13:59:00 njoly Exp $
 .\
 .\ Copyright (c) 2012 Alistair Crooks a...@netbsd.org
 .\ All rights reserved.
@@ -43,7 +43,7 @@
 .Fc
 .Ft size_t
 .Fo pgpv_get_verified
-.Fa pgpv_cursor_t *cursor size_t cookie  char **ret
+.Fa pgpv_cursor_t *cursor size_t cookie char **ret
 .Fc
 .Ft size_t
 .Fo pgpv_get_entry

Index: src/share/man/man9/man9.i386/bios32_service.9
diff -u src/share/man/man9/man9.i386/bios32_service.9:1.6 src/share/man/man9/man9.i386/bios32_service.9:1.7
--- src/share/man/man9/man9.i386/bios32_service.9:1.6	Wed Apr 30 13:10:59 2008
+++ src/share/man/man9/man9.i386/bios32_service.9	Mon Jan  6 13:59:00 2014
@@ -1,4 +1,4 @@
-.\ $NetBSD: bios32_service.9,v 1.6 2008/04/30 13:10:59 martin Exp $
+.\ $NetBSD: bios32_service.9,v 1.7 2014/01/06 13:59:00 njoly Exp $
 .\
 .\ Copyright (c) 2001 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -36,7 +36,7 @@
 .Sh SYNOPSIS
 .In i386/bios32.h
 .Ft int
-.Fn bios32_service uint32_t service  bios32_entry_t e \
+.Fn bios32_service uint32_t service bios32_entry_t e \
 bios32_entry_info_t ei
 .Sh DESCRIPTION
 The



CVS commit: src/external/bsd/nvi/dist/vi

2014-01-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jan  6 14:21:37 UTC 2014

Modified Files:
src/external/bsd/nvi/dist/vi: v_search.c

Log Message:
PR/48502: M. Levinson: vi(1) no longer moves the cursor when yanking text
using a mark (remove dangling else)


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/nvi/dist/vi/v_search.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/nvi/dist/vi/v_search.c
diff -u src/external/bsd/nvi/dist/vi/v_search.c:1.4 src/external/bsd/nvi/dist/vi/v_search.c:1.5
--- src/external/bsd/nvi/dist/vi/v_search.c:1.4	Wed Dec 25 12:18:39 2013
+++ src/external/bsd/nvi/dist/vi/v_search.c	Mon Jan  6 09:21:37 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: v_search.c,v 1.4 2013/12/25 17:18:39 christos Exp $ */
+/*	$NetBSD: v_search.c,v 1.5 2014/01/06 14:21:37 christos Exp $ */
 /*-
  * Copyright (c) 1992, 1993, 1994
  *	The Regents of the University of California.  All rights reserved.
@@ -525,7 +525,7 @@ v_correct(SCR *sp, VICMD *vp, int isdelt
 		m = vp-m_start;
 		vp-m_start = vp-m_stop;
 		vp-m_stop = m;
-	} else
+	}
 
 	/*
 	 * BACKWARD:



CVS commit: src

2014-01-06 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Mon Jan  6 14:50:33 UTC 2014

Modified Files:
src/distrib/sets/lists/debug: mi
src/distrib/sets/lists/tests: mi
src/tests/lib/libc/net: Makefile t_hostent.sh
Added Files:
src/tests/lib/libc/net: h_dns_server.c

Log Message:
Make t_hostent test cases that query the DNS work on systems with no
Internet connectivity, by hijacking DNS queries and /etc/resolv.conf
accesses using librumphijack and providing a minimal DNS server to
answer the queries.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.553 -r1.554 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.8 -r1.9 src/tests/lib/libc/net/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/net/h_dns_server.c
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/net/t_hostent.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/debug/mi
diff -u src/distrib/sets/lists/debug/mi:1.45 src/distrib/sets/lists/debug/mi:1.46
--- src/distrib/sets/lists/debug/mi:1.45	Sat Dec 28 02:32:01 2013
+++ src/distrib/sets/lists/debug/mi	Mon Jan  6 14:50:32 2014
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.45 2013/12/28 02:32:01 rjs Exp $
+# $NetBSD: mi,v 1.46 2014/01/06 14:50:32 gson Exp $
 
 ./etc/mtree/set.debug   comp-sys-root
 ./usr/lib/i18n/libBIG5_g.a			comp-c-debuglib		debuglib
@@ -1801,6 +1801,7 @@
 ./usr/libdata/debug/usr/tests/lib/libc/locale/t_wcstod.debug		tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/locale/t_wctomb.debug		tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/net/getaddrinfo/h_gai.debug	tests-lib-debug		debug,atf
+./usr/libdata/debug/usr/tests/lib/libc/net/h_dns_server.debug		tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/net/h_hostent.debug		tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/net/h_nsd_recurse.debug		tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/net/h_protoent.debug		tests-lib-debug		debug,atf

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.553 src/distrib/sets/lists/tests/mi:1.554
--- src/distrib/sets/lists/tests/mi:1.553	Thu Jan  2 16:46:40 2014
+++ src/distrib/sets/lists/tests/mi	Mon Jan  6 14:50:32 2014
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.553 2014/01/02 16:46:40 tho Exp $
+# $NetBSD: mi,v 1.554 2014/01/06 14:50:32 gson Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -1978,6 +1978,7 @@
 ./usr/tests/lib/libc/net/getaddrinfo/data/unsup_fam.exp		tests-lib-tests	atf
 ./usr/tests/lib/libc/net/getaddrinfo/h_gai	tests-lib-tests		atf
 ./usr/tests/lib/libc/net/getaddrinfo/t_getaddrinfo tests-lib-tests	atf
+./usr/tests/lib/libc/net/h_dns_server		tests-lib-tests	atf
 ./usr/tests/lib/libc/net/h_hostent		tests-lib-tests	atf
 ./usr/tests/lib/libc/net/h_nsd_recurse		tests-lib-tests	atf
 ./usr/tests/lib/libc/net/h_protoent		tests-lib-tests		atf

Index: src/tests/lib/libc/net/Makefile
diff -u src/tests/lib/libc/net/Makefile:1.8 src/tests/lib/libc/net/Makefile:1.9
--- src/tests/lib/libc/net/Makefile:1.8	Fri Aug 16 15:29:45 2013
+++ src/tests/lib/libc/net/Makefile	Mon Jan  6 14:50:32 2014
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.8 2013/08/16 15:29:45 christos Exp $
+# $NetBSD: Makefile,v 1.9 2014/01/06 14:50:32 gson Exp $
 
 .include bsd.own.mk
 
@@ -28,6 +28,7 @@ PROGS+=		h_nsd_recurse
 PROGS+=		h_protoent
 PROGS+=		h_servent
 PROGS+=		h_hostent
+PROGS+=		h_dns_server
 CPPFLAGS.h_hostent.c += -I${NETBSDSRCDIR}/lib/libc/net
 
 # For easy debugging, without installing libc

Index: src/tests/lib/libc/net/t_hostent.sh
diff -u src/tests/lib/libc/net/t_hostent.sh:1.3 src/tests/lib/libc/net/t_hostent.sh:1.4
--- src/tests/lib/libc/net/t_hostent.sh:1.3	Fri Dec 20 20:22:26 2013
+++ src/tests/lib/libc/net/t_hostent.sh	Mon Jan  6 14:50:32 2014
@@ -1,4 +1,4 @@
-# $NetBSD: t_hostent.sh,v 1.3 2013/12/20 20:22:26 christos Exp $
+# $NetBSD: t_hostent.sh,v 1.4 2014/01/06 14:50:32 gson Exp $
 #
 # Copyright (c) 2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -41,6 +41,26 @@ l4=localhost
 al4=127.0.0.1
 loc4=name=$l4, length=4, addrtype=2, aliases=[localhost. localhost.localdomain.] addr_list=[$al4]\n
 
+# Hijack DNS traffic using a single rump server instance and a DNS
+# server listening on its loopback address.  Also hijack file system
+# call to /etc, mapping them to the root file system of the rump 
+# server, so that we can control the contents of /etc/resolv.conf.
+
+start_dns_server() {
+	export RUMP_SERVER=unix:///tmp/rumpserver
+	rump_server -lrumpvfs -lrumpdev -lrumpnet \
+	 -lrumpnet_net -lrumpnet_netinet -lrumpnet_local \
+	 $RUMP_SERVER
+	HIJACK_DNS=LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK='path=/etc,socket=inet:inet6'
+	eval $HIJACK_DNS sh -c 'echo nameserver 127.0.0.1 /etc/resolv.conf'
+	eval $HIJACK_DNS 

CVS commit: src/share/man/man9

2014-01-06 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Mon Jan  6 14:57:10 UTC 2014

Modified Files:
src/share/man/man9: cardbus.9

Log Message:
Kill one more trailing space in function argument.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/share/man/man9/cardbus.9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man9/cardbus.9
diff -u src/share/man/man9/cardbus.9:1.17 src/share/man/man9/cardbus.9:1.18
--- src/share/man/man9/cardbus.9:1.17	Mon May 30 01:48:40 2011
+++ src/share/man/man9/cardbus.9	Mon Jan  6 14:57:10 2014
@@ -1,4 +1,4 @@
-.\ $NetBSD: cardbus.9,v 1.17 2011/05/30 01:48:40 dyoung Exp $
+.\ $NetBSD: cardbus.9,v 1.18 2014/01/06 14:57:10 njoly Exp $
 .\
 .\ Copyright (c) 2001 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -114,7 +114,7 @@
 int reg bus_space_tag_t tag bus_space_handle_t handle \
 bus_size_t size
 .Ft pcitag_t
-.Fn Cardbus_make_tag cardbus_devfunc_t ct 
+.Fn Cardbus_make_tag cardbus_devfunc_t ct
 .Ft pcireg_t
 .Fn Cardbus_conf_read cardbus_devfunc_t ct pcitag_t tag \
 int offs



CVS commit: src/tests/lib/libc/net

2014-01-06 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Mon Jan  6 16:42:57 UTC 2014

Modified Files:
src/tests/lib/libc/net: h_dns_server.c

Log Message:
Fix spelling of daemon.  Pointed out by Thomas Klausner.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/net/h_dns_server.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libc/net/h_dns_server.c
diff -u src/tests/lib/libc/net/h_dns_server.c:1.1 src/tests/lib/libc/net/h_dns_server.c:1.2
--- src/tests/lib/libc/net/h_dns_server.c:1.1	Mon Jan  6 14:50:32 2014
+++ src/tests/lib/libc/net/h_dns_server.c	Mon Jan  6 16:42:57 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: h_dns_server.c,v 1.1 2014/01/06 14:50:32 gson Exp $	*/
+/*	$NetBSD: h_dns_server.c,v 1.2 2014/01/06 16:42:57 gson Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: h_dns_server.c,v 1.1 2014/01/06 14:50:32 gson Exp $);
+__RCSID($NetBSD: h_dns_server.c,v 1.2 2014/01/06 16:42:57 gson Exp $);
 
 #include ctype.h
 #include err.h
@@ -133,7 +133,7 @@ name_eq(const unsigned char *a, const un
 
 /* XXX the daemon2_* functions should be in a library */
 
-int __deamon2_detach_pipe[2];
+int __daemon2_detach_pipe[2];
 
 static int
 daemon2_fork(void)
@@ -145,16 +145,16 @@ daemon2_fork(void)
 	/*
 	 * Set up the pipe, making sure the write end does not
 	 * get allocated one of the file descriptors that will
-	 * be closed in deamon2_detach().
+	 * be closed in daemon2_detach().
 	 */
 	for (i = 0; i  3; i++) {
-	r = pipe(__deamon2_detach_pipe);
+	r = pipe(__daemon2_detach_pipe);
 	if (r  0)
 		return -1;
-	if (__deamon2_detach_pipe[1] = STDERR_FILENO 
+	if (__daemon2_detach_pipe[1] = STDERR_FILENO 
 		(fd = open(_PATH_DEVNULL, O_RDWR, 0)) != -1) {
-		(void)dup2(fd, __deamon2_detach_pipe[0]);
-		(void)dup2(fd, __deamon2_detach_pipe[1]);
+		(void)dup2(fd, __daemon2_detach_pipe[0]);
+		(void)dup2(fd, __daemon2_detach_pipe[1]);
 		if (fd  STDERR_FILENO)
 			(void)close(fd);
 		continue;
@@ -167,16 +167,16 @@ daemon2_fork(void)
 		return -1;
 	} else if (r == 0) {
 		/* child */
-		close(__deamon2_detach_pipe[0]);
+		close(__daemon2_detach_pipe[0]);
 		return 0;
}
/* Parent */
 
-   (void) close(__deamon2_detach_pipe[1]);
+   (void) close(__daemon2_detach_pipe[1]);
 
for (;;) {
 	   char dummy;
-	   r = read(__deamon2_detach_pipe[0], dummy, 1);
+	   r = read(__daemon2_detach_pipe[0], dummy, 1);
 	   if (r  0) {
 		   if (errno == EINTR)
 			   continue;
@@ -190,7 +190,7 @@ daemon2_fork(void)
 }
 
 static int
-deamon2_detach(int nochdir, int noclose)
+daemon2_detach(int nochdir, int noclose)
 {
 	int r;
 	int fd;
@@ -210,7 +210,7 @@ deamon2_detach(int nochdir, int noclose)
 	}
 
 	while (1) {
-		r = write(__deamon2_detach_pipe[1], , 1);
+		r = write(__daemon2_detach_pipe[1], , 1);
 		if (r  0) {
 			if (errno == EINTR)
 continue;
@@ -224,7 +224,7 @@ deamon2_detach(int nochdir, int noclose)
 		}
 	}
 
-	(void) close(__deamon2_detach_pipe[1]);
+	(void) close(__daemon2_detach_pipe[1]);
 
 	return 0;
 }
@@ -276,7 +276,7 @@ int main(int argc, char **argv) {
 	f = fopen(pidfile_name, w);
 	fprintf(f, %d, getpid());
 	fclose(f);
-	deamon2_detach(0, 0);
+	daemon2_detach(0, 0);
 
 	for (;;) {
 		unsigned char buf[512];



CVS commit: [netbsd-6] src/distrib/sparc/ramdisk

2014-01-06 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Jan  6 18:55:51 UTC 2014

Modified Files:
src/distrib/sparc/ramdisk [netbsd-6]: Makefile

Log Message:
Apply patch (requested by bad in ticket #975):

Avoid libhack/gethost.c in the ramdisk as nothing needs the functions.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.41.8.1 src/distrib/sparc/ramdisk/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sparc/ramdisk/Makefile
diff -u src/distrib/sparc/ramdisk/Makefile:1.41 src/distrib/sparc/ramdisk/Makefile:1.41.8.1
--- src/distrib/sparc/ramdisk/Makefile:1.41	Tue Jun  9 11:06:09 2009
+++ src/distrib/sparc/ramdisk/Makefile	Mon Jan  6 18:55:51 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.41 2009/06/09 11:06:09 he Exp $
+#	$NetBSD: Makefile,v 1.41.8.1 2014/01/06 18:55:51 bouyer Exp $
 #
 # ramdisk.fs is the microroot filesystem intended for use with
 # the INSTALL kernel. It provides just enough tools to extract the
@@ -24,7 +24,6 @@ IMAGEDEPENDS+=	${CRUNCHBIN} dot.profile
 
 # Use stubs to eliminate some large stuff from libc
 HACKSRC=	${DISTRIBDIR}/utils/libhack
-HACKOBJS=	gethost.o
 .include	${HACKSRC}/Makefile.inc
 ${CRUNCHBIN}:	libhack.o
 



CVS commit: [netbsd-6] src/doc

2014-01-06 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Jan  6 18:56:52 UTC 2014

Modified Files:
src/doc [netbsd-6]: CHANGES-6.2

Log Message:
Update ticket #975 entry


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.72 -r1.1.2.73 src/doc/CHANGES-6.2

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES-6.2
diff -u src/doc/CHANGES-6.2:1.1.2.72 src/doc/CHANGES-6.2:1.1.2.73
--- src/doc/CHANGES-6.2:1.1.2.72	Mon Dec 23 22:59:52 2013
+++ src/doc/CHANGES-6.2	Mon Jan  6 18:56:52 2014
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.2,v 1.1.2.72 2013/12/23 22:59:52 riz Exp $
+# $NetBSD: CHANGES-6.2,v 1.1.2.73 2014/01/06 18:56:52 bouyer Exp $
 
 A complete list of changes from the 6.1 release until the 6.2 release:
 
@@ -1144,6 +1144,7 @@ lib/libc/net/getnameinfo.31.37-1.40
 lib/libc/net/getnameinfo.c1.51, 1.52, 1.54
 lib/libc/net/hostent.h	1.1, 1.2
 lib/libc/net/sethostent.c1.17-1.19
+distrib/sparc/ramdisk/Makefilepatch
 
 	Make getnameinfo(3) re-entrant (ahem __ypdomain).
 	Add not advertised reentrant functions: {get,set,end}hostent_r,



CVS commit: [netbsd-6] src/distrib/ews4800mips

2014-01-06 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Jan  6 19:03:19 UTC 2014

Modified Files:
src/distrib/ews4800mips [netbsd-6]: Makefile

Log Message:
Pull up following revision(s) (requested by apb in ticket #1009):
distrib/ews4800mips/Makefile: revision 1.3
Add cdroms to the SUBDIR list for src/distrib/ews4800mips.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.2.38.1 src/distrib/ews4800mips/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/ews4800mips/Makefile
diff -u src/distrib/ews4800mips/Makefile:1.2 src/distrib/ews4800mips/Makefile:1.2.38.1
--- src/distrib/ews4800mips/Makefile:1.2	Tue Mar  6 21:57:00 2007
+++ src/distrib/ews4800mips/Makefile	Mon Jan  6 19:03:19 2014
@@ -1,6 +1,6 @@
-#	$NetBSD: Makefile,v 1.2 2007/03/06 21:57:00 bouyer Exp $
+#	$NetBSD: Makefile,v 1.2.38.1 2014/01/06 19:03:19 bouyer Exp $
 
-SUBDIR=		floppies
+SUBDIR=		floppies cdroms
 TARGETS+=	release
 
 iso_image:



CVS commit: [netbsd-6-0] src/distrib/ews4800mips

2014-01-06 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Jan  6 19:03:24 UTC 2014

Modified Files:
src/distrib/ews4800mips [netbsd-6-0]: Makefile

Log Message:
Pull up following revision(s) (requested by apb in ticket #1009):
distrib/ews4800mips/Makefile: revision 1.3
Add cdroms to the SUBDIR list for src/distrib/ews4800mips.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.2.44.1 src/distrib/ews4800mips/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/ews4800mips/Makefile
diff -u src/distrib/ews4800mips/Makefile:1.2 src/distrib/ews4800mips/Makefile:1.2.44.1
--- src/distrib/ews4800mips/Makefile:1.2	Tue Mar  6 21:57:00 2007
+++ src/distrib/ews4800mips/Makefile	Mon Jan  6 19:03:24 2014
@@ -1,6 +1,6 @@
-#	$NetBSD: Makefile,v 1.2 2007/03/06 21:57:00 bouyer Exp $
+#	$NetBSD: Makefile,v 1.2.44.1 2014/01/06 19:03:24 bouyer Exp $
 
-SUBDIR=		floppies
+SUBDIR=		floppies cdroms
 TARGETS+=	release
 
 iso_image:



CVS commit: [netbsd-6-1] src/distrib/ews4800mips

2014-01-06 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Jan  6 19:03:28 UTC 2014

Modified Files:
src/distrib/ews4800mips [netbsd-6-1]: Makefile

Log Message:
Pull up following revision(s) (requested by apb in ticket #1009):
distrib/ews4800mips/Makefile: revision 1.3
Add cdroms to the SUBDIR list for src/distrib/ews4800mips.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.2.54.1 src/distrib/ews4800mips/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/ews4800mips/Makefile
diff -u src/distrib/ews4800mips/Makefile:1.2 src/distrib/ews4800mips/Makefile:1.2.54.1
--- src/distrib/ews4800mips/Makefile:1.2	Tue Mar  6 21:57:00 2007
+++ src/distrib/ews4800mips/Makefile	Mon Jan  6 19:03:28 2014
@@ -1,6 +1,6 @@
-#	$NetBSD: Makefile,v 1.2 2007/03/06 21:57:00 bouyer Exp $
+#	$NetBSD: Makefile,v 1.2.54.1 2014/01/06 19:03:28 bouyer Exp $
 
-SUBDIR=		floppies
+SUBDIR=		floppies cdroms
 TARGETS+=	release
 
 iso_image:



CVS commit: [netbsd-6] src

2014-01-06 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Jan  6 19:12:15 UTC 2014

Modified Files:
src/etc [netbsd-6]: ntp.conf
src/external/bsd/ntp/dist/ntpd [netbsd-6]: ntp_request.c

Log Message:
etc/ntp.conf1.16, 1.17, 1.18 via patch
external/bsd/ntp/dist/ntpd/ntp_request.cpatch

Patch from ntp 4.2.7p404 to prevent an amplifier and DoS attack.
Add several restrict lines to the default ntp.conf and
improve comments
[spz, ticket #1010]


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.14.2.1 src/etc/ntp.conf
cvs rdiff -u -r1.7 -r1.7.2.1 src/external/bsd/ntp/dist/ntpd/ntp_request.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/etc/ntp.conf
diff -u src/etc/ntp.conf:1.14 src/etc/ntp.conf:1.14.2.1
--- src/etc/ntp.conf:1.14	Mon Jan 16 22:20:45 2012
+++ src/etc/ntp.conf	Mon Jan  6 19:12:15 2014
@@ -1,4 +1,4 @@
-# $NetBSD: ntp.conf,v 1.14 2012/01/16 22:20:45 christos Exp $
+# $NetBSD: ntp.conf,v 1.14.2.1 2014/01/06 19:12:15 bouyer Exp $
 #
 # NetBSD default Network Time Protocol (NTP) configuration file for ntpd
 
@@ -23,7 +23,8 @@ driftfile	/var/db/ntp.drift
 
 logconfig	-syncstatus
 
-# This will help minimize disruptions due to network congestion. Don't
+# Refuse to set the local clock if there are too few good peers or servers.
+# This may help minimize disruptions due to network congestion. Don't
 # do this if you configure only one server!
 
 tos		minsane 2
@@ -32,22 +33,59 @@ tos		minsane 2
 #
 mdnstries	0
 
+# Access control restrictions.
+# See /usr/share/doc/html/ntp/accopt.html for syntax.
+# See http://support.ntp.org/bin/view/Support/AccessRestrictions for advice.
+# Last match wins.
+#
+# Some of the more common keywords are:
+#   ignore  Deny packets of all kinds.
+#   kod Send kiss-o'-death packets if clients exceed rate
+#   limits.
+#   nomodifyDeny attempts to modify the state of the server via
+#   ntpq or ntpdc queries.
+#   noquery Deny all ntpq and ntpdc queries.  Does not affect time
+#   synchronisation.
+#   nopeer  Prevent establishing an new peer association.
+#   Does not affect preconfigured peer associations.
+#   Does not affect client/server time synchronisation.
+#   noserve Deny all time synchronisation.  Does not affect ntpq or
+#   ntpdc queries.
+#   notrap  Deny the trap subset of the ntpdc control message protocol.
+#   notrust Deny packets that are not cryptographically authenticated.
+#
+# By default, either deny everything, or allow client/server time exchange
+# but deny configuration changes, queries, and peer associations that were not
+# explicitly configured.
+# (Uncomment one of the following restrict default lines.)
+#
+#restrict default ignore
+restrict default kod nopeer noquery
+
+# Fewer restrictions for the local subnet.
+# (Uncomment and adjust as appropriate.)
+#
+#restrict 192.0.2.0 mask 255.255.255.0 kod nomodify notrap nopeer
+#restrict 2001:db8:: mask :::  kod nomodify notrap nopeer
+
+# No restrictions for localhost.
+#
+restrict 127.0.0.1
+restrict ::1
+
 # Hereafter should be server or peer statements to configure other
-# hosts to exchange NTP packets with. Peers should be selected in such
-# a way that the network path to them is symmetric (that is, the series
-# of links and routers used to get to the peer is the same one that the
-# peer uses to get back. NTP assumes such symmetry in its network delay
-# calculation. NTP will apply an incorrect adjustment to timestamps
-# received from the peer if the path is not symmetric. This can result
-# in clock skew (your system clock being maintained consistently wrong
-# by a certain amount).
-#
-# The best way to select symmetric peers is to make sure that the
-# network path to them is as short as possible (this reduces the chance
-# that there is more than one network path between you and your peer).
-# You can measure these distances with the traceroute(8)  program. The
-# best place to start looking for NTP peers for your system is within
-# your own network, or at your Internet Service Provider (ISP).
+# hosts to exchange NTP packets with.
+#
+# See http://support.ntp.org/bin/view/Support/DesigningYourNTPNetwork
+# and http://support.ntp.org/bin/view/Support/SelectingOffsiteNTPServers
+# for advice.
+#
+# Peers should be selected in such a way that the network path to them
+# is short, uncongested, and symmetric (that is, the series of links
+# and routers used to get to the peer is the same one that the peer
+# uses to get back).  The best place to start looking for NTP peers for
+# your system is within your own network, or at your Internet Service
+# Provider (ISP).
 #
 # Ideally, you should select at least three other systems to talk NTP
 # with, for an what I tell you three 

CVS commit: [netbsd-6-0] src

2014-01-06 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Jan  6 19:12:17 UTC 2014

Modified Files:
src/etc [netbsd-6-0]: ntp.conf
src/external/bsd/ntp/dist/ntpd [netbsd-6-0]: ntp_request.c

Log Message:
etc/ntp.conf1.16, 1.17, 1.18 via patch
external/bsd/ntp/dist/ntpd/ntp_request.cpatch

Patch from ntp 4.2.7p404 to prevent an amplifier and DoS attack.
Add several restrict lines to the default ntp.conf and
improve comments
[spz, ticket #1010]


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.14.8.1 src/etc/ntp.conf
cvs rdiff -u -r1.7 -r1.7.8.1 src/external/bsd/ntp/dist/ntpd/ntp_request.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/etc/ntp.conf
diff -u src/etc/ntp.conf:1.14 src/etc/ntp.conf:1.14.8.1
--- src/etc/ntp.conf:1.14	Mon Jan 16 22:20:45 2012
+++ src/etc/ntp.conf	Mon Jan  6 19:12:17 2014
@@ -1,4 +1,4 @@
-# $NetBSD: ntp.conf,v 1.14 2012/01/16 22:20:45 christos Exp $
+# $NetBSD: ntp.conf,v 1.14.8.1 2014/01/06 19:12:17 bouyer Exp $
 #
 # NetBSD default Network Time Protocol (NTP) configuration file for ntpd
 
@@ -23,7 +23,8 @@ driftfile	/var/db/ntp.drift
 
 logconfig	-syncstatus
 
-# This will help minimize disruptions due to network congestion. Don't
+# Refuse to set the local clock if there are too few good peers or servers.
+# This may help minimize disruptions due to network congestion. Don't
 # do this if you configure only one server!
 
 tos		minsane 2
@@ -32,22 +33,59 @@ tos		minsane 2
 #
 mdnstries	0
 
+# Access control restrictions.
+# See /usr/share/doc/html/ntp/accopt.html for syntax.
+# See http://support.ntp.org/bin/view/Support/AccessRestrictions for advice.
+# Last match wins.
+#
+# Some of the more common keywords are:
+#   ignore  Deny packets of all kinds.
+#   kod Send kiss-o'-death packets if clients exceed rate
+#   limits.
+#   nomodifyDeny attempts to modify the state of the server via
+#   ntpq or ntpdc queries.
+#   noquery Deny all ntpq and ntpdc queries.  Does not affect time
+#   synchronisation.
+#   nopeer  Prevent establishing an new peer association.
+#   Does not affect preconfigured peer associations.
+#   Does not affect client/server time synchronisation.
+#   noserve Deny all time synchronisation.  Does not affect ntpq or
+#   ntpdc queries.
+#   notrap  Deny the trap subset of the ntpdc control message protocol.
+#   notrust Deny packets that are not cryptographically authenticated.
+#
+# By default, either deny everything, or allow client/server time exchange
+# but deny configuration changes, queries, and peer associations that were not
+# explicitly configured.
+# (Uncomment one of the following restrict default lines.)
+#
+#restrict default ignore
+restrict default kod nopeer noquery
+
+# Fewer restrictions for the local subnet.
+# (Uncomment and adjust as appropriate.)
+#
+#restrict 192.0.2.0 mask 255.255.255.0 kod nomodify notrap nopeer
+#restrict 2001:db8:: mask :::  kod nomodify notrap nopeer
+
+# No restrictions for localhost.
+#
+restrict 127.0.0.1
+restrict ::1
+
 # Hereafter should be server or peer statements to configure other
-# hosts to exchange NTP packets with. Peers should be selected in such
-# a way that the network path to them is symmetric (that is, the series
-# of links and routers used to get to the peer is the same one that the
-# peer uses to get back. NTP assumes such symmetry in its network delay
-# calculation. NTP will apply an incorrect adjustment to timestamps
-# received from the peer if the path is not symmetric. This can result
-# in clock skew (your system clock being maintained consistently wrong
-# by a certain amount).
-#
-# The best way to select symmetric peers is to make sure that the
-# network path to them is as short as possible (this reduces the chance
-# that there is more than one network path between you and your peer).
-# You can measure these distances with the traceroute(8)  program. The
-# best place to start looking for NTP peers for your system is within
-# your own network, or at your Internet Service Provider (ISP).
+# hosts to exchange NTP packets with.
+#
+# See http://support.ntp.org/bin/view/Support/DesigningYourNTPNetwork
+# and http://support.ntp.org/bin/view/Support/SelectingOffsiteNTPServers
+# for advice.
+#
+# Peers should be selected in such a way that the network path to them
+# is short, uncongested, and symmetric (that is, the series of links
+# and routers used to get to the peer is the same one that the peer
+# uses to get back).  The best place to start looking for NTP peers for
+# your system is within your own network, or at your Internet Service
+# Provider (ISP).
 #
 # Ideally, you should select at least three other systems to talk NTP
 # with, for an what I tell you 

CVS commit: [netbsd-6-0] src/doc

2014-01-06 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Jan  6 19:13:07 UTC 2014

Modified Files:
src/doc [netbsd-6-0]: CHANGES-6.0.4

Log Message:
tickets 1009 and 1010


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.11 -r1.1.2.12 src/doc/CHANGES-6.0.4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES-6.0.4
diff -u src/doc/CHANGES-6.0.4:1.1.2.11 src/doc/CHANGES-6.0.4:1.1.2.12
--- src/doc/CHANGES-6.0.4:1.1.2.11	Tue Dec 17 22:40:04 2013
+++ src/doc/CHANGES-6.0.4	Mon Jan  6 19:13:07 2014
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.0.4,v 1.1.2.11 2013/12/17 22:40:04 riz Exp $
+# $NetBSD: CHANGES-6.0.4,v 1.1.2.12 2014/01/06 19:13:07 bouyer Exp $
 
 A complete list of changes from the NetBSD 6.0.3 release to the NetBSD 6.0.4
 release:
@@ -131,3 +131,17 @@ sys/arch/xen/xen/evtchn.c			1.70
 but related to spin mutexes. Fixes port-xen/46313.
 	[bouyer, ticket #995]
 
+distrib/ews4800mips/Makefile			1.3
+
+	Add cdroms to the SUBDIR list for src/distrib/ews4800mips.
+	Should prevent the iso image from being created in the source tree
+	[apb, ticket #1009]
+
+etc/ntp.conf	1.16, 1.17, 1.18 via patch
+external/bsd/ntp/dist/ntpd/ntp_request.c	patch
+
+	Patch from ntp 4.2.7p404 to prevent an amplifier and DoS attack.
+	Add several restrict lines to the default ntp.conf and
+	improve comments
+	[spz, ticket #1010]
+



CVS commit: [netbsd-6] src/doc

2014-01-06 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Jan  6 19:13:15 UTC 2014

Modified Files:
src/doc [netbsd-6]: CHANGES-6.2

Log Message:
tickets 1009 and 1010


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.73 -r1.1.2.74 src/doc/CHANGES-6.2

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES-6.2
diff -u src/doc/CHANGES-6.2:1.1.2.73 src/doc/CHANGES-6.2:1.1.2.74
--- src/doc/CHANGES-6.2:1.1.2.73	Mon Jan  6 18:56:52 2014
+++ src/doc/CHANGES-6.2	Mon Jan  6 19:13:15 2014
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.2,v 1.1.2.73 2014/01/06 18:56:52 bouyer Exp $
+# $NetBSD: CHANGES-6.2,v 1.1.2.74 2014/01/06 19:13:15 bouyer Exp $
 
 A complete list of changes from the 6.1 release until the 6.2 release:
 
@@ -1153,3 +1153,17 @@ distrib/sparc/ramdisk/Makefilepatch
 	Implement no-check-names.
 	[bad, ticket #975]
 
+distrib/ews4800mips/Makefile			1.3
+
+	Add cdroms to the SUBDIR list for src/distrib/ews4800mips.
+	Should prevent the iso image from being created in the source tree
+	[apb, ticket #1009]
+
+etc/ntp.conf	1.16, 1.17, 1.18 via patch
+external/bsd/ntp/dist/ntpd/ntp_request.c	patch
+
+	Patch from ntp 4.2.7p404 to prevent an amplifier and DoS attack.
+	Add several restrict lines to the default ntp.conf and
+	improve comments
+	[spz, ticket #1010]
+



CVS commit: [netbsd-6-1] src/doc

2014-01-06 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Jan  6 19:13:04 UTC 2014

Modified Files:
src/doc [netbsd-6-1]: CHANGES-6.1.3

Log Message:
tickets 1009 and 1010


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.11 -r1.1.2.12 src/doc/CHANGES-6.1.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES-6.1.3
diff -u src/doc/CHANGES-6.1.3:1.1.2.11 src/doc/CHANGES-6.1.3:1.1.2.12
--- src/doc/CHANGES-6.1.3:1.1.2.11	Tue Dec 17 22:40:30 2013
+++ src/doc/CHANGES-6.1.3	Mon Jan  6 19:13:04 2014
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.1.3,v 1.1.2.11 2013/12/17 22:40:30 riz Exp $
+# $NetBSD: CHANGES-6.1.3,v 1.1.2.12 2014/01/06 19:13:04 bouyer Exp $
 
 A complete list of changes from the NetBSD 6.1.1 release to the NetBSD 6.1.2
 release:
@@ -139,3 +139,17 @@ sys/arch/xen/xen/evtchn.c			1.70
 but related to spin mutexes. Fixes port-xen/46313.
 	[bouyer, ticket #995]
 
+distrib/ews4800mips/Makefile			1.3
+
+	Add cdroms to the SUBDIR list for src/distrib/ews4800mips.
+	Should prevent the iso image from being created in the source tree
+	[apb, ticket #1009]
+
+etc/ntp.conf	1.16, 1.17, 1.18 via patch
+external/bsd/ntp/dist/ntpd/ntp_request.c	patch
+
+	Patch from ntp 4.2.7p404 to prevent an amplifier and DoS attack.
+	Add several restrict lines to the default ntp.conf and
+	improve comments
+	[spz, ticket #1010]
+



CVS commit: [netbsd-6-1] src

2014-01-06 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Jan  6 19:12:23 UTC 2014

Modified Files:
src/etc [netbsd-6-1]: ntp.conf
src/external/bsd/ntp/dist/ntpd [netbsd-6-1]: ntp_request.c

Log Message:
etc/ntp.conf1.16, 1.17, 1.18 via patch
external/bsd/ntp/dist/ntpd/ntp_request.cpatch

Patch from ntp 4.2.7p404 to prevent an amplifier and DoS attack.
Add several restrict lines to the default ntp.conf and
improve comments
[spz, ticket #1010]


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.14.16.1 src/etc/ntp.conf
cvs rdiff -u -r1.7 -r1.7.16.1 src/external/bsd/ntp/dist/ntpd/ntp_request.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/etc/ntp.conf
diff -u src/etc/ntp.conf:1.14 src/etc/ntp.conf:1.14.16.1
--- src/etc/ntp.conf:1.14	Mon Jan 16 22:20:45 2012
+++ src/etc/ntp.conf	Mon Jan  6 19:12:23 2014
@@ -1,4 +1,4 @@
-# $NetBSD: ntp.conf,v 1.14 2012/01/16 22:20:45 christos Exp $
+# $NetBSD: ntp.conf,v 1.14.16.1 2014/01/06 19:12:23 bouyer Exp $
 #
 # NetBSD default Network Time Protocol (NTP) configuration file for ntpd
 
@@ -23,7 +23,8 @@ driftfile	/var/db/ntp.drift
 
 logconfig	-syncstatus
 
-# This will help minimize disruptions due to network congestion. Don't
+# Refuse to set the local clock if there are too few good peers or servers.
+# This may help minimize disruptions due to network congestion. Don't
 # do this if you configure only one server!
 
 tos		minsane 2
@@ -32,22 +33,59 @@ tos		minsane 2
 #
 mdnstries	0
 
+# Access control restrictions.
+# See /usr/share/doc/html/ntp/accopt.html for syntax.
+# See http://support.ntp.org/bin/view/Support/AccessRestrictions for advice.
+# Last match wins.
+#
+# Some of the more common keywords are:
+#   ignore  Deny packets of all kinds.
+#   kod Send kiss-o'-death packets if clients exceed rate
+#   limits.
+#   nomodifyDeny attempts to modify the state of the server via
+#   ntpq or ntpdc queries.
+#   noquery Deny all ntpq and ntpdc queries.  Does not affect time
+#   synchronisation.
+#   nopeer  Prevent establishing an new peer association.
+#   Does not affect preconfigured peer associations.
+#   Does not affect client/server time synchronisation.
+#   noserve Deny all time synchronisation.  Does not affect ntpq or
+#   ntpdc queries.
+#   notrap  Deny the trap subset of the ntpdc control message protocol.
+#   notrust Deny packets that are not cryptographically authenticated.
+#
+# By default, either deny everything, or allow client/server time exchange
+# but deny configuration changes, queries, and peer associations that were not
+# explicitly configured.
+# (Uncomment one of the following restrict default lines.)
+#
+#restrict default ignore
+restrict default kod nopeer noquery
+
+# Fewer restrictions for the local subnet.
+# (Uncomment and adjust as appropriate.)
+#
+#restrict 192.0.2.0 mask 255.255.255.0 kod nomodify notrap nopeer
+#restrict 2001:db8:: mask :::  kod nomodify notrap nopeer
+
+# No restrictions for localhost.
+#
+restrict 127.0.0.1
+restrict ::1
+
 # Hereafter should be server or peer statements to configure other
-# hosts to exchange NTP packets with. Peers should be selected in such
-# a way that the network path to them is symmetric (that is, the series
-# of links and routers used to get to the peer is the same one that the
-# peer uses to get back. NTP assumes such symmetry in its network delay
-# calculation. NTP will apply an incorrect adjustment to timestamps
-# received from the peer if the path is not symmetric. This can result
-# in clock skew (your system clock being maintained consistently wrong
-# by a certain amount).
-#
-# The best way to select symmetric peers is to make sure that the
-# network path to them is as short as possible (this reduces the chance
-# that there is more than one network path between you and your peer).
-# You can measure these distances with the traceroute(8)  program. The
-# best place to start looking for NTP peers for your system is within
-# your own network, or at your Internet Service Provider (ISP).
+# hosts to exchange NTP packets with.
+#
+# See http://support.ntp.org/bin/view/Support/DesigningYourNTPNetwork
+# and http://support.ntp.org/bin/view/Support/SelectingOffsiteNTPServers
+# for advice.
+#
+# Peers should be selected in such a way that the network path to them
+# is short, uncongested, and symmetric (that is, the series of links
+# and routers used to get to the peer is the same one that the peer
+# uses to get back).  The best place to start looking for NTP peers for
+# your system is within your own network, or at your Internet Service
+# Provider (ISP).
 #
 # Ideally, you should select at least three other systems to talk NTP
 # with, for an what I tell you 

CVS commit: [netbsd-5] src

2014-01-06 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Jan  6 19:24:35 UTC 2014

Modified Files:
src/dist/ntp/ntpd [netbsd-5]: ntp_request.c
src/etc [netbsd-5]: ntp.conf

Log Message:
etc/ntp.conf1.16, 1.17, 1.18 via patch
external/bsd/ntp/dist/ntpd/ntp_request.cpatch

Patch from ntp 4.2.7p404 to prevent an amplifier and DoS attack.
Add several restrict lines to the default ntp.conf and
improve comments
[spz, ticket #1895]


To generate a diff of this commit:
cvs rdiff -u -r1.8.4.1 -r1.8.4.2 src/dist/ntp/ntpd/ntp_request.c
cvs rdiff -u -r1.9 -r1.9.20.1 src/etc/ntp.conf

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/dist/ntp/ntpd/ntp_request.c
diff -u src/dist/ntp/ntpd/ntp_request.c:1.8.4.1 src/dist/ntp/ntpd/ntp_request.c:1.8.4.2
--- src/dist/ntp/ntpd/ntp_request.c:1.8.4.1	Wed Dec  9 04:48:24 2009
+++ src/dist/ntp/ntpd/ntp_request.c	Mon Jan  6 19:24:35 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_request.c,v 1.8.4.1 2009/12/09 04:48:24 snj Exp $	*/
+/*	$NetBSD: ntp_request.c,v 1.8.4.2 2014/01/06 19:24:35 bouyer Exp $	*/
 
 /*
  * ntp_request.c - respond to information requests
@@ -84,8 +84,7 @@ static	void	do_resaddflags	P((struct soc
 static	void	do_ressubflags	P((struct sockaddr_storage *, struct interface *, struct req_pkt *));
 static	void	do_unrestrict	P((struct sockaddr_storage *, struct interface *, struct req_pkt *));
 static	void	do_restrict	P((struct sockaddr_storage *, struct interface *, struct req_pkt *, int));
-static	void	mon_getlist_0	P((struct sockaddr_storage *, struct interface *, struct req_pkt *));
-static	void	mon_getlist_1	P((struct sockaddr_storage *, struct interface *, struct req_pkt *));
+static	void	mon_getlist	P((struct sockaddr_storage *, struct interface *, struct req_pkt *));
 static	void	reset_stats	P((struct sockaddr_storage *, struct interface *, struct req_pkt *));
 static	void	reset_peer	P((struct sockaddr_storage *, struct interface *, struct req_pkt *));
 static	void	do_key_reread	P((struct sockaddr_storage *, struct interface *, struct req_pkt *));
@@ -145,8 +144,8 @@ static	struct req_proc ntp_codes[] = {
 sizeof(struct conf_restrict), do_ressubflags },
 	{ REQ_UNRESTRICT, AUTH, v4sizeof(struct conf_restrict),
 sizeof(struct conf_restrict), do_unrestrict },
-	{ REQ_MON_GETLIST,	NOAUTH,	0, 0,	mon_getlist_0 },
-	{ REQ_MON_GETLIST_1,	NOAUTH,	0, 0,	mon_getlist_1 },
+	{ REQ_MON_GETLIST,	NOAUTH,	0, 0,	mon_getlist },
+	{ REQ_MON_GETLIST_1,	NOAUTH,	0, 0,	mon_getlist },
 	{ REQ_RESET_STATS, AUTH, sizeof(struct reset_flags), 0, reset_stats },
 	{ REQ_RESET_PEER,  AUTH, v4sizeof(struct conf_unpeer),
 sizeof(struct conf_unpeer), reset_peer },
@@ -601,6 +600,9 @@ process_private(
 process_private: failed auth mod_okay %d\n,
 mod_okay);
 #endif
+			if (!mod_okay) {
+sys_restricted++;
+			}
 			req_ack(srcadr, inter, inpkt, INFO_ERR_AUTH);
 			return;
 		}
@@ -822,35 +824,42 @@ peer_info (
 	struct req_pkt *inpkt
 	)
 {
-	register struct info_peer_list *ipl;
+	struct info_peer_list ipl;
 	register struct peer *pp;
 	register struct info_peer *ip;
 	register int items;
+	size_t item_sz;
+	char * datap;
 	register int i, j;
 	struct sockaddr_storage addr;
 	extern struct peer *sys_peer;
 	l_fp ltmp;
 
-	memset((char *)addr, 0, sizeof addr);
 	items = INFO_NITEMS(inpkt-err_nitems);
-	ipl = (struct info_peer_list *) inpkt-data;
-
+	item_sz = INFO_ITEMSIZE(inpkt-mbz_itemsize);
+	datap = inpkt-data;
+	if (item_sz != sizeof(ipl)) {
+		req_ack(srcadr, inter, inpkt, INFO_ERR_FMT);
+		return;
+	}
 	ip = (struct info_peer *)prepare_pkt(srcadr, inter, inpkt,
 	v6sizeof(struct info_peer));
 	while (items--  0  ip != 0) {
+		memset(ipl,0,sizeof(ipl));
+		memcpy(ipl, datap, item_sz);
 		memset((char *)addr, 0, sizeof(addr));
-		NSRCPORT(addr) = ipl-port;
-		if (client_v6_capable  ipl-v6_flag != 0) {
+		NSRCPORT(addr) = ipl.port;
+		if (client_v6_capable  ipl.v6_flag != 0) {
 			addr.ss_family = AF_INET6;
-			GET_INADDR6(addr) = ipl-addr6;
+			GET_INADDR6(addr) = ipl.addr6;
 		} else {
 			addr.ss_family = AF_INET;
-			GET_INADDR(addr) = ipl-addr;
+			GET_INADDR(addr) = ipl.addr;
 		}
 #ifdef HAVE_SA_LEN_IN_STRUCT_SOCKADDR
 		addr.ss_len = SOCKLEN(addr);
 #endif
-		ipl++;
+		datap += item_sz;
 		if ((pp = findexistingpeer(addr, (struct peer *)0, -1)) == 0)
 		continue;
 		if (pp-srcadr.ss_family == AF_INET6) {
@@ -954,10 +963,12 @@ peer_stats (
 	struct req_pkt *inpkt
 	)
 {
-	register struct info_peer_list *ipl;
+	struct info_peer_list ipl;
 	register struct peer *pp;
 	register struct info_peer_stats *ip;
 	register int items;
+	size_t item_sz;
+	char * datap;
 	struct sockaddr_storage addr;
 	extern struct peer *sys_peer;
 
@@ -966,18 +977,25 @@ peer_stats (
 	 printf(peer_stats: called\n);
 #endif
 	items = INFO_NITEMS(inpkt-err_nitems);
-	ipl = (struct info_peer_list *) 

CVS commit: [netbsd-5-2] src

2014-01-06 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Jan  6 19:24:42 UTC 2014

Modified Files:
src/dist/ntp/ntpd [netbsd-5-2]: ntp_request.c
src/etc [netbsd-5-2]: ntp.conf

Log Message:
etc/ntp.conf1.16, 1.17, 1.18 via patch
external/bsd/ntp/dist/ntpd/ntp_request.cpatch

Patch from ntp 4.2.7p404 to prevent an amplifier and DoS attack.
Add several restrict lines to the default ntp.conf and
improve comments
[spz, ticket #1895]


To generate a diff of this commit:
cvs rdiff -u -r1.8.4.1 -r1.8.4.1.6.1 src/dist/ntp/ntpd/ntp_request.c
cvs rdiff -u -r1.9 -r1.9.36.1 src/etc/ntp.conf

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/dist/ntp/ntpd/ntp_request.c
diff -u src/dist/ntp/ntpd/ntp_request.c:1.8.4.1 src/dist/ntp/ntpd/ntp_request.c:1.8.4.1.6.1
--- src/dist/ntp/ntpd/ntp_request.c:1.8.4.1	Wed Dec  9 04:48:24 2009
+++ src/dist/ntp/ntpd/ntp_request.c	Mon Jan  6 19:24:42 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_request.c,v 1.8.4.1 2009/12/09 04:48:24 snj Exp $	*/
+/*	$NetBSD: ntp_request.c,v 1.8.4.1.6.1 2014/01/06 19:24:42 bouyer Exp $	*/
 
 /*
  * ntp_request.c - respond to information requests
@@ -84,8 +84,7 @@ static	void	do_resaddflags	P((struct soc
 static	void	do_ressubflags	P((struct sockaddr_storage *, struct interface *, struct req_pkt *));
 static	void	do_unrestrict	P((struct sockaddr_storage *, struct interface *, struct req_pkt *));
 static	void	do_restrict	P((struct sockaddr_storage *, struct interface *, struct req_pkt *, int));
-static	void	mon_getlist_0	P((struct sockaddr_storage *, struct interface *, struct req_pkt *));
-static	void	mon_getlist_1	P((struct sockaddr_storage *, struct interface *, struct req_pkt *));
+static	void	mon_getlist	P((struct sockaddr_storage *, struct interface *, struct req_pkt *));
 static	void	reset_stats	P((struct sockaddr_storage *, struct interface *, struct req_pkt *));
 static	void	reset_peer	P((struct sockaddr_storage *, struct interface *, struct req_pkt *));
 static	void	do_key_reread	P((struct sockaddr_storage *, struct interface *, struct req_pkt *));
@@ -145,8 +144,8 @@ static	struct req_proc ntp_codes[] = {
 sizeof(struct conf_restrict), do_ressubflags },
 	{ REQ_UNRESTRICT, AUTH, v4sizeof(struct conf_restrict),
 sizeof(struct conf_restrict), do_unrestrict },
-	{ REQ_MON_GETLIST,	NOAUTH,	0, 0,	mon_getlist_0 },
-	{ REQ_MON_GETLIST_1,	NOAUTH,	0, 0,	mon_getlist_1 },
+	{ REQ_MON_GETLIST,	NOAUTH,	0, 0,	mon_getlist },
+	{ REQ_MON_GETLIST_1,	NOAUTH,	0, 0,	mon_getlist },
 	{ REQ_RESET_STATS, AUTH, sizeof(struct reset_flags), 0, reset_stats },
 	{ REQ_RESET_PEER,  AUTH, v4sizeof(struct conf_unpeer),
 sizeof(struct conf_unpeer), reset_peer },
@@ -601,6 +600,9 @@ process_private(
 process_private: failed auth mod_okay %d\n,
 mod_okay);
 #endif
+			if (!mod_okay) {
+sys_restricted++;
+			}
 			req_ack(srcadr, inter, inpkt, INFO_ERR_AUTH);
 			return;
 		}
@@ -822,35 +824,42 @@ peer_info (
 	struct req_pkt *inpkt
 	)
 {
-	register struct info_peer_list *ipl;
+	struct info_peer_list ipl;
 	register struct peer *pp;
 	register struct info_peer *ip;
 	register int items;
+	size_t item_sz;
+	char * datap;
 	register int i, j;
 	struct sockaddr_storage addr;
 	extern struct peer *sys_peer;
 	l_fp ltmp;
 
-	memset((char *)addr, 0, sizeof addr);
 	items = INFO_NITEMS(inpkt-err_nitems);
-	ipl = (struct info_peer_list *) inpkt-data;
-
+	item_sz = INFO_ITEMSIZE(inpkt-mbz_itemsize);
+	datap = inpkt-data;
+	if (item_sz != sizeof(ipl)) {
+		req_ack(srcadr, inter, inpkt, INFO_ERR_FMT);
+		return;
+	}
 	ip = (struct info_peer *)prepare_pkt(srcadr, inter, inpkt,
 	v6sizeof(struct info_peer));
 	while (items--  0  ip != 0) {
+		memset(ipl,0,sizeof(ipl));
+		memcpy(ipl, datap, item_sz);
 		memset((char *)addr, 0, sizeof(addr));
-		NSRCPORT(addr) = ipl-port;
-		if (client_v6_capable  ipl-v6_flag != 0) {
+		NSRCPORT(addr) = ipl.port;
+		if (client_v6_capable  ipl.v6_flag != 0) {
 			addr.ss_family = AF_INET6;
-			GET_INADDR6(addr) = ipl-addr6;
+			GET_INADDR6(addr) = ipl.addr6;
 		} else {
 			addr.ss_family = AF_INET;
-			GET_INADDR(addr) = ipl-addr;
+			GET_INADDR(addr) = ipl.addr;
 		}
 #ifdef HAVE_SA_LEN_IN_STRUCT_SOCKADDR
 		addr.ss_len = SOCKLEN(addr);
 #endif
-		ipl++;
+		datap += item_sz;
 		if ((pp = findexistingpeer(addr, (struct peer *)0, -1)) == 0)
 		continue;
 		if (pp-srcadr.ss_family == AF_INET6) {
@@ -954,10 +963,12 @@ peer_stats (
 	struct req_pkt *inpkt
 	)
 {
-	register struct info_peer_list *ipl;
+	struct info_peer_list ipl;
 	register struct peer *pp;
 	register struct info_peer_stats *ip;
 	register int items;
+	size_t item_sz;
+	char * datap;
 	struct sockaddr_storage addr;
 	extern struct peer *sys_peer;
 
@@ -966,18 +977,25 @@ peer_stats (
 	 printf(peer_stats: called\n);
 #endif
 	items = INFO_NITEMS(inpkt-err_nitems);
-	ipl = (struct 

CVS commit: [netbsd-5-1] src

2014-01-06 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Jan  6 19:24:39 UTC 2014

Modified Files:
src/dist/ntp/ntpd [netbsd-5-1]: ntp_request.c
src/etc [netbsd-5-1]: ntp.conf

Log Message:
etc/ntp.conf1.16, 1.17, 1.18 via patch
external/bsd/ntp/dist/ntpd/ntp_request.cpatch

Patch from ntp 4.2.7p404 to prevent an amplifier and DoS attack.
Add several restrict lines to the default ntp.conf and
improve comments
[spz, ticket #1895]


To generate a diff of this commit:
cvs rdiff -u -r1.8.4.1 -r1.8.4.1.2.1 src/dist/ntp/ntpd/ntp_request.c
cvs rdiff -u -r1.9 -r1.9.28.1 src/etc/ntp.conf

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/dist/ntp/ntpd/ntp_request.c
diff -u src/dist/ntp/ntpd/ntp_request.c:1.8.4.1 src/dist/ntp/ntpd/ntp_request.c:1.8.4.1.2.1
--- src/dist/ntp/ntpd/ntp_request.c:1.8.4.1	Wed Dec  9 04:48:24 2009
+++ src/dist/ntp/ntpd/ntp_request.c	Mon Jan  6 19:24:39 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_request.c,v 1.8.4.1 2009/12/09 04:48:24 snj Exp $	*/
+/*	$NetBSD: ntp_request.c,v 1.8.4.1.2.1 2014/01/06 19:24:39 bouyer Exp $	*/
 
 /*
  * ntp_request.c - respond to information requests
@@ -84,8 +84,7 @@ static	void	do_resaddflags	P((struct soc
 static	void	do_ressubflags	P((struct sockaddr_storage *, struct interface *, struct req_pkt *));
 static	void	do_unrestrict	P((struct sockaddr_storage *, struct interface *, struct req_pkt *));
 static	void	do_restrict	P((struct sockaddr_storage *, struct interface *, struct req_pkt *, int));
-static	void	mon_getlist_0	P((struct sockaddr_storage *, struct interface *, struct req_pkt *));
-static	void	mon_getlist_1	P((struct sockaddr_storage *, struct interface *, struct req_pkt *));
+static	void	mon_getlist	P((struct sockaddr_storage *, struct interface *, struct req_pkt *));
 static	void	reset_stats	P((struct sockaddr_storage *, struct interface *, struct req_pkt *));
 static	void	reset_peer	P((struct sockaddr_storage *, struct interface *, struct req_pkt *));
 static	void	do_key_reread	P((struct sockaddr_storage *, struct interface *, struct req_pkt *));
@@ -145,8 +144,8 @@ static	struct req_proc ntp_codes[] = {
 sizeof(struct conf_restrict), do_ressubflags },
 	{ REQ_UNRESTRICT, AUTH, v4sizeof(struct conf_restrict),
 sizeof(struct conf_restrict), do_unrestrict },
-	{ REQ_MON_GETLIST,	NOAUTH,	0, 0,	mon_getlist_0 },
-	{ REQ_MON_GETLIST_1,	NOAUTH,	0, 0,	mon_getlist_1 },
+	{ REQ_MON_GETLIST,	NOAUTH,	0, 0,	mon_getlist },
+	{ REQ_MON_GETLIST_1,	NOAUTH,	0, 0,	mon_getlist },
 	{ REQ_RESET_STATS, AUTH, sizeof(struct reset_flags), 0, reset_stats },
 	{ REQ_RESET_PEER,  AUTH, v4sizeof(struct conf_unpeer),
 sizeof(struct conf_unpeer), reset_peer },
@@ -601,6 +600,9 @@ process_private(
 process_private: failed auth mod_okay %d\n,
 mod_okay);
 #endif
+			if (!mod_okay) {
+sys_restricted++;
+			}
 			req_ack(srcadr, inter, inpkt, INFO_ERR_AUTH);
 			return;
 		}
@@ -822,35 +824,42 @@ peer_info (
 	struct req_pkt *inpkt
 	)
 {
-	register struct info_peer_list *ipl;
+	struct info_peer_list ipl;
 	register struct peer *pp;
 	register struct info_peer *ip;
 	register int items;
+	size_t item_sz;
+	char * datap;
 	register int i, j;
 	struct sockaddr_storage addr;
 	extern struct peer *sys_peer;
 	l_fp ltmp;
 
-	memset((char *)addr, 0, sizeof addr);
 	items = INFO_NITEMS(inpkt-err_nitems);
-	ipl = (struct info_peer_list *) inpkt-data;
-
+	item_sz = INFO_ITEMSIZE(inpkt-mbz_itemsize);
+	datap = inpkt-data;
+	if (item_sz != sizeof(ipl)) {
+		req_ack(srcadr, inter, inpkt, INFO_ERR_FMT);
+		return;
+	}
 	ip = (struct info_peer *)prepare_pkt(srcadr, inter, inpkt,
 	v6sizeof(struct info_peer));
 	while (items--  0  ip != 0) {
+		memset(ipl,0,sizeof(ipl));
+		memcpy(ipl, datap, item_sz);
 		memset((char *)addr, 0, sizeof(addr));
-		NSRCPORT(addr) = ipl-port;
-		if (client_v6_capable  ipl-v6_flag != 0) {
+		NSRCPORT(addr) = ipl.port;
+		if (client_v6_capable  ipl.v6_flag != 0) {
 			addr.ss_family = AF_INET6;
-			GET_INADDR6(addr) = ipl-addr6;
+			GET_INADDR6(addr) = ipl.addr6;
 		} else {
 			addr.ss_family = AF_INET;
-			GET_INADDR(addr) = ipl-addr;
+			GET_INADDR(addr) = ipl.addr;
 		}
 #ifdef HAVE_SA_LEN_IN_STRUCT_SOCKADDR
 		addr.ss_len = SOCKLEN(addr);
 #endif
-		ipl++;
+		datap += item_sz;
 		if ((pp = findexistingpeer(addr, (struct peer *)0, -1)) == 0)
 		continue;
 		if (pp-srcadr.ss_family == AF_INET6) {
@@ -954,10 +963,12 @@ peer_stats (
 	struct req_pkt *inpkt
 	)
 {
-	register struct info_peer_list *ipl;
+	struct info_peer_list ipl;
 	register struct peer *pp;
 	register struct info_peer_stats *ip;
 	register int items;
+	size_t item_sz;
+	char * datap;
 	struct sockaddr_storage addr;
 	extern struct peer *sys_peer;
 
@@ -966,18 +977,25 @@ peer_stats (
 	 printf(peer_stats: called\n);
 #endif
 	items = INFO_NITEMS(inpkt-err_nitems);
-	ipl = (struct 

CVS commit: [netbsd-5] src/distrib/ews4800mips

2014-01-06 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Jan  6 19:26:46 UTC 2014

Modified Files:
src/distrib/ews4800mips [netbsd-5]: Makefile

Log Message:
Pull up following revision(s) (requested by apb in ticket #1894):
distrib/ews4800mips/Makefile: revision 1.3
Add cdroms to the SUBDIR list for src/distrib/ews4800mips.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.2.20.1 src/distrib/ews4800mips/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/ews4800mips/Makefile
diff -u src/distrib/ews4800mips/Makefile:1.2 src/distrib/ews4800mips/Makefile:1.2.20.1
--- src/distrib/ews4800mips/Makefile:1.2	Tue Mar  6 21:57:00 2007
+++ src/distrib/ews4800mips/Makefile	Mon Jan  6 19:26:46 2014
@@ -1,6 +1,6 @@
-#	$NetBSD: Makefile,v 1.2 2007/03/06 21:57:00 bouyer Exp $
+#	$NetBSD: Makefile,v 1.2.20.1 2014/01/06 19:26:46 bouyer Exp $
 
-SUBDIR=		floppies
+SUBDIR=		floppies cdroms
 TARGETS+=	release
 
 iso_image:



CVS commit: [netbsd-5-2] src/distrib/ews4800mips

2014-01-06 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Jan  6 19:26:54 UTC 2014

Modified Files:
src/distrib/ews4800mips [netbsd-5-2]: Makefile

Log Message:
Pull up following revision(s) (requested by apb in ticket #1894):
distrib/ews4800mips/Makefile: revision 1.3
Add cdroms to the SUBDIR list for src/distrib/ews4800mips.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.2.46.1 src/distrib/ews4800mips/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/ews4800mips/Makefile
diff -u src/distrib/ews4800mips/Makefile:1.2 src/distrib/ews4800mips/Makefile:1.2.46.1
--- src/distrib/ews4800mips/Makefile:1.2	Tue Mar  6 21:57:00 2007
+++ src/distrib/ews4800mips/Makefile	Mon Jan  6 19:26:54 2014
@@ -1,6 +1,6 @@
-#	$NetBSD: Makefile,v 1.2 2007/03/06 21:57:00 bouyer Exp $
+#	$NetBSD: Makefile,v 1.2.46.1 2014/01/06 19:26:54 bouyer Exp $
 
-SUBDIR=		floppies
+SUBDIR=		floppies cdroms
 TARGETS+=	release
 
 iso_image:



CVS commit: [netbsd-5-1] src/distrib/ews4800mips

2014-01-06 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Jan  6 19:26:54 UTC 2014

Modified Files:
src/distrib/ews4800mips [netbsd-5-1]: Makefile

Log Message:
Pull up following revision(s) (requested by apb in ticket #1894):
distrib/ews4800mips/Makefile: revision 1.3
Add cdroms to the SUBDIR list for src/distrib/ews4800mips.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.2.28.1 src/distrib/ews4800mips/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/ews4800mips/Makefile
diff -u src/distrib/ews4800mips/Makefile:1.2 src/distrib/ews4800mips/Makefile:1.2.28.1
--- src/distrib/ews4800mips/Makefile:1.2	Tue Mar  6 21:57:00 2007
+++ src/distrib/ews4800mips/Makefile	Mon Jan  6 19:26:54 2014
@@ -1,6 +1,6 @@
-#	$NetBSD: Makefile,v 1.2 2007/03/06 21:57:00 bouyer Exp $
+#	$NetBSD: Makefile,v 1.2.28.1 2014/01/06 19:26:54 bouyer Exp $
 
-SUBDIR=		floppies
+SUBDIR=		floppies cdroms
 TARGETS+=	release
 
 iso_image:



CVS commit: [netbsd-5] src/doc

2014-01-06 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Jan  6 19:29:01 UTC 2014

Modified Files:
src/doc [netbsd-5]: CHANGES-5.3

Log Message:
tickets 1894 and 1895


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.44 -r1.1.2.45 src/doc/CHANGES-5.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES-5.3
diff -u src/doc/CHANGES-5.3:1.1.2.44 src/doc/CHANGES-5.3:1.1.2.45
--- src/doc/CHANGES-5.3:1.1.2.44	Mon Dec 23 23:13:19 2013
+++ src/doc/CHANGES-5.3	Mon Jan  6 19:29:01 2014
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.3,v 1.1.2.44 2013/12/23 23:13:19 riz Exp $
+# $NetBSD: CHANGES-5.3,v 1.1.2.45 2014/01/06 19:29:01 bouyer Exp $
 
 A complete list of changes from the NetBSD 5.2 release to the NetBSD 5.3
 release:
@@ -679,3 +679,17 @@ lib/libc/net/sethostent.c1.17-1.19 v
 	Implement no-check-names.
 	[bad, ticket #1887]
 
+etc/ntp.conf	1.16, 1.17, 1.18 via patch
+external/bsd/ntp/dist/ntpd/ntp_request.c	patch
+
+	Patch from ntp 4.2.7p404 to prevent an amplifier and DoS attack.
+	Add several restrict lines to the default ntp.conf and
+	improve comments
+	[spz, ticket #1895]
+
+distrib/ews4800mips/Makefile			1.3
+
+	Add cdroms to the SUBDIR list for src/distrib/ews4800mips.
+	Should prevent the iso image from being created in the source tree
+	[apb, ticket #1894]
+



CVS commit: [netbsd-5-2] src/doc

2014-01-06 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Jan  6 19:29:04 UTC 2014

Modified Files:
src/doc [netbsd-5-2]: CHANGES-5.2.2

Log Message:
tickets 1894 and 1895


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.6 -r1.1.2.7 src/doc/CHANGES-5.2.2

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES-5.2.2
diff -u src/doc/CHANGES-5.2.2:1.1.2.6 src/doc/CHANGES-5.2.2:1.1.2.7
--- src/doc/CHANGES-5.2.2:1.1.2.6	Wed Dec 18 04:06:26 2013
+++ src/doc/CHANGES-5.2.2	Mon Jan  6 19:29:04 2014
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.2.2,v 1.1.2.6 2013/12/18 04:06:26 riz Exp $
+# $NetBSD: CHANGES-5.2.2,v 1.1.2.7 2014/01/06 19:29:04 bouyer Exp $
 
 A complete list of changes from the NetBSD 5.2 release to the NetBSD 5.2.1
 release:
@@ -40,3 +40,17 @@ usr.sbin/ndp/ndp.c1.42
 	obey all local alignement requirements.
 	[martin, ticket #1892]
 
+etc/ntp.conf	1.16, 1.17, 1.18 via patch
+external/bsd/ntp/dist/ntpd/ntp_request.c	patch
+
+	Patch from ntp 4.2.7p404 to prevent an amplifier and DoS attack.
+	Add several restrict lines to the default ntp.conf and
+	improve comments
+	[spz, ticket #1895]
+
+distrib/ews4800mips/Makefile			1.3
+
+	Add cdroms to the SUBDIR list for src/distrib/ews4800mips.
+	Should prevent the iso image from being created in the source tree
+	[apb, ticket #1894]
+



CVS commit: [netbsd-5-1] src/doc

2014-01-06 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Jan  6 19:29:05 UTC 2014

Modified Files:
src/doc [netbsd-5-1]: CHANGES-5.1.4

Log Message:
tickets 1894 and 1895


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.6 -r1.1.2.7 src/doc/CHANGES-5.1.4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES-5.1.4
diff -u src/doc/CHANGES-5.1.4:1.1.2.6 src/doc/CHANGES-5.1.4:1.1.2.7
--- src/doc/CHANGES-5.1.4:1.1.2.6	Wed Dec 18 04:07:13 2013
+++ src/doc/CHANGES-5.1.4	Mon Jan  6 19:29:05 2014
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.1.4,v 1.1.2.6 2013/12/18 04:07:13 riz Exp $
+# $NetBSD: CHANGES-5.1.4,v 1.1.2.7 2014/01/06 19:29:05 bouyer Exp $
 
 A complete list of changes from the NetBSD 5.1.2 release to the NetBSD 5.1.3
 release:
@@ -40,3 +40,17 @@ usr.sbin/ndp/ndp.c1.42
 	obey all local alignement requirements.
 	[martin, ticket #1892]
 
+etc/ntp.conf	1.16, 1.17, 1.18 via patch
+external/bsd/ntp/dist/ntpd/ntp_request.c	patch
+
+	Patch from ntp 4.2.7p404 to prevent an amplifier and DoS attack.
+	Add several restrict lines to the default ntp.conf and
+	improve comments
+	[spz, ticket #1895]
+
+distrib/ews4800mips/Makefile			1.3
+
+	Add cdroms to the SUBDIR list for src/distrib/ews4800mips.
+	Should prevent the iso image from being created in the source tree
+	[apb, ticket #1894]
+



CVS commit: src/crypto/external/bsd/netpgp/dist/src/lib

2014-01-06 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon Jan  6 21:12:19 UTC 2014

Modified Files:
src/crypto/external/bsd/netpgp/dist/src/lib: errors.h netpgpsdk.h

Log Message:
Add __printflike where necessary.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/crypto/external/bsd/netpgp/dist/src/lib/errors.h
cvs rdiff -u -r1.10 -r1.11 \
src/crypto/external/bsd/netpgp/dist/src/lib/netpgpsdk.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/crypto/external/bsd/netpgp/dist/src/lib/errors.h
diff -u src/crypto/external/bsd/netpgp/dist/src/lib/errors.h:1.7 src/crypto/external/bsd/netpgp/dist/src/lib/errors.h:1.8
--- src/crypto/external/bsd/netpgp/dist/src/lib/errors.h:1.7	Mon Mar  5 02:20:18 2012
+++ src/crypto/external/bsd/netpgp/dist/src/lib/errors.h	Mon Jan  6 21:12:19 2014
@@ -135,7 +135,7 @@ const char *pgp_errcode(const pgp_er
 void 
 pgp_push_error(pgp_error_t **, pgp_errcode_t,
 		int,
-		const char *, int, const char *,...);
+		const char *, int, const char *,...) __printflike(6, 7);
 void pgp_print_error(pgp_error_t *);
 void pgp_print_errors(pgp_error_t *);
 void pgp_free_errors(pgp_error_t *);

Index: src/crypto/external/bsd/netpgp/dist/src/lib/netpgpsdk.h
diff -u src/crypto/external/bsd/netpgp/dist/src/lib/netpgpsdk.h:1.10 src/crypto/external/bsd/netpgp/dist/src/lib/netpgpsdk.h:1.11
--- src/crypto/external/bsd/netpgp/dist/src/lib/netpgpsdk.h:1.10	Sun Nov  7 08:39:59 2010
+++ src/crypto/external/bsd/netpgp/dist/src/lib/netpgpsdk.h	Mon Jan  6 21:12:19 2014
@@ -63,9 +63,9 @@ unsigned   pgp_check_sig(const uint8_t *
 
 const char *pgp_get_info(const char *type);
 
-int pgp_asprintf(char **, const char *, ...);
+int pgp_asprintf(char **, const char *, ...) __printflike(2, 3);
 
-void netpgp_log(const char *, ...);
+void netpgp_log(const char *, ...) __printflike(1, 2);
 
 int netpgp_strcasecmp(const char *, const char *);
 char *netpgp_strdup(const char *);



CVS commit: src/crypto/external/bsd/netpgp/dist/src

2014-01-06 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon Jan  6 21:15:15 UTC 2014

Modified Files:
src/crypto/external/bsd/netpgp/dist/src/libbn: misc.h
src/crypto/external/bsd/netpgp/dist/src/libverify: libverify.c

Log Message:
Add __printflike.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/crypto/external/bsd/netpgp/dist/src/libbn/misc.h
cvs rdiff -u -r1.4 -r1.5 \
src/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/crypto/external/bsd/netpgp/dist/src/libbn/misc.h
diff -u src/crypto/external/bsd/netpgp/dist/src/libbn/misc.h:1.2 src/crypto/external/bsd/netpgp/dist/src/libbn/misc.h:1.3
--- src/crypto/external/bsd/netpgp/dist/src/libbn/misc.h:1.2	Tue Nov 20 05:26:25 2012
+++ src/crypto/external/bsd/netpgp/dist/src/libbn/misc.h	Mon Jan  6 21:15:15 2014
@@ -45,7 +45,8 @@ void *netpgp_allocate(size_t /*n*/, size
 void netpgp_deallocate(void */*ptr*/, size_t /*size*/);
 
 #ifndef _KERNEL
-void logmessage(const int /*level*/, const char */*fmt*/, ...);
+void logmessage(const int /*level*/, const char */*fmt*/, ...)
+__printflike(2, 3);
 #endif
 
 __END_DECLS

Index: src/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c
diff -u src/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c:1.4 src/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c:1.5
--- src/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c:1.4	Thu Nov 22 11:26:28 2012
+++ src/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c	Mon Jan  6 21:15:15 2014
@@ -2046,7 +2046,7 @@ read_all_packets(pgpv_t *pgp, pgpv_mem_t
 }
 
 /* create a filename, read it, and then parse according to op */
-static int
+__printflike(3, 4) static int
 read_binary_file(pgpv_t *pgp, const char *op, const char *fmt, ...)
 {
 	va_list	args;



CVS commit: src/usr.bin/genassym

2014-01-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jan  6 22:43:15 UTC 2014

Modified Files:
src/usr.bin/genassym: genassym.sh

Log Message:
- use just the basename for program name
- quote variables
- use mktemp to create directories (from jtc)
- exit on errors


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/genassym/genassym.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/genassym/genassym.sh
diff -u src/usr.bin/genassym/genassym.sh:1.7 src/usr.bin/genassym/genassym.sh:1.8
--- src/usr.bin/genassym/genassym.sh:1.7	Tue Jul  5 01:19:02 2011
+++ src/usr.bin/genassym/genassym.sh	Mon Jan  6 17:43:15 2014
@@ -1,5 +1,5 @@
 #!/bin/sh -
-#	$NetBSD: genassym.sh,v 1.7 2011/07/05 05:19:02 matt Exp $
+#	$NetBSD: genassym.sh,v 1.8 2014/01/06 22:43:15 christos Exp $
 #
 # Copyright (c) 1997 Matthias Pfaller.
 # All rights reserved.
@@ -25,7 +25,7 @@
 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #
 
-progname=${0}
+progname=$(basename ${0})
 : ${AWK:=awk}
 
 ccode=0		# generate temporary C file, compile it, execute result
@@ -37,6 +37,8 @@ usage()
 	echo usage: ${progname} [-c | -f] -- compiler command 2
 }
 
+set -e
+
 while getopts cf i
 do
 	case $i in
@@ -48,7 +50,7 @@ do
 		;;
 	esac
 done
-shift $(($OPTIND - 1))
+shift $(($OPTIND - 1))
 if [ $# -eq 0 ]; then
 	usage
 	exit 1
@@ -56,7 +58,7 @@ fi
 
 # Deal with any leading environment settings..
 
-while [ $1 ]
+while [ -n $1 ]
 do
 	case $1 in
 	*=*)
@@ -69,9 +71,10 @@ do
 	esac
 done
 
-genassym_temp=/tmp/genassym.$$
+genassym_temp=$(mktemp -d ${TMPDIR-/tmp}/genassym.XX)
+
 
-if ! mkdir $genassym_temp; then
+if [ ! -d $genassym_temp ]; then
 	echo ${progname}: unable to create temporary directory 2
 	exit 1
 fi
@@ -191,21 +194,21 @@ END {
 		printf(return(0); }\n);
 	}
 }
-' ccode=$ccode fcode=$fcode  ${genassym_temp}/assym.c || exit 1
+' ccode=$ccode fcode=$fcode  ${genassym_temp}/assym.c || exit 1
 
-if [ $ccode = 1 ] ; then
-	$@ ${genassym_temp}/assym.c -o ${genassym_temp}/genassym  \
-	${genassym_temp}/genassym
-elif [ $fcode = 1 ]; then
+if [ $ccode = 1 ]; then
+	$@ ${genassym_temp}/assym.c -o ${genassym_temp}/genassym  \
+	${genassym_temp}/genassym
+elif [ $fcode = 1 ]; then
 	# Kill all of the # and $ modifiers; locore.s already
 	# prepends the correct constant modifier.
-	$@ -S ${genassym_temp}/assym.c -o - | sed -e 's/\$//g' | \
+	$@ -S ${genassym_temp}/assym.c -o - | sed -e 's/\$//g' | \
 	sed -n 's/.*XYZZY//gp'
 else
 	# Kill all of the # and $ modifiers; locore.s already
 	# prepends the correct constant modifier.
-	$@ -S ${genassym_temp}/assym.c -o -  \
-	${genassym_temp}/genassym.out  \
-	sed -e 's/#//g' -e 's/\$//g'  ${genassym_temp}/genassym.out | \
+	$@ -S ${genassym_temp}/assym.c -o -  \
+	${genassym_temp}/genassym.out  \
+	sed -e 's/#//g' -e 's/\$//g'  ${genassym_temp}/genassym.out | \
 	sed -n 's/.*XYZZY/#define/gp'
 fi



CVS commit: src/crypto/external/bsd/netpgp/dist/src/libverify

2014-01-06 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon Jan  6 22:59:10 UTC 2014

Modified Files:
src/crypto/external/bsd/netpgp/dist/src/libverify: libverify.c

Log Message:
Move __printflike to the prototype. Add explicit cast for void * -
char * to make GCC happy.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c
diff -u src/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c:1.5 src/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c:1.6
--- src/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c:1.5	Mon Jan  6 21:15:15 2014
+++ src/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c	Mon Jan  6 22:59:10 2014
@@ -145,7 +145,8 @@
 
 /* Forward declarations */
 static int read_all_packets(pgpv_t */*pgp*/, pgpv_mem_t */*mem*/, const char */*op*/);
-static int read_binary_file(pgpv_t */*pgp*/, const char */*op*/, const char */*fmt*/, ...);
+static int read_binary_file(pgpv_t */*pgp*/, const char */*op*/, const char */*fmt*/, ...)
+__printflike(3, 4);
 static int read_binary_memory(pgpv_t */*pgp*/, const char */*op*/, const void */*memory*/, size_t /*size*/);
 static int pgpv_find_keyid(pgpv_t */*pgp*/, const char */*strkeyid*/, uint8_t */*keyid*/);
 
@@ -2046,7 +2047,7 @@ read_all_packets(pgpv_t *pgp, pgpv_mem_t
 }
 
 /* create a filename, read it, and then parse according to op */
-__printflike(3, 4) static int
+static int
 read_binary_file(pgpv_t *pgp, const char *op, const char *fmt, ...)
 {
 	va_list	args;
@@ -2335,7 +2336,7 @@ pgpv_read_pubring(pgpv_t *pgp, const voi
 	if (keyring) {
 		return (size  0) ?
 			read_binary_memory(pgp, pubring, keyring, (size_t)size) :
-			read_binary_file(pgp, pubring, %s, keyring);
+			read_binary_file(pgp, pubring, %s, (const char *)keyring);
 	}
 	return read_binary_file(pgp, pubring, %s/%s, nonnull_getenv(HOME), .gnupg/pubring.gpg);
 }



CVS commit: src/crypto/external/bsd/netpgp/dist/src/libverify

2014-01-06 Thread Hisashi T Fujinaka
Module Name:src
Committed By:   htodd
Date:   Mon Jan  6 23:23:10 UTC 2014

Modified Files:
src/crypto/external/bsd/netpgp/dist/src/libverify: libverify.c

Log Message:
Fix build (cast to const char *).


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
src/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c
diff -u src/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c:1.6 src/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c:1.7
--- src/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c:1.6	Mon Jan  6 22:59:10 2014
+++ src/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c	Mon Jan  6 23:23:10 2014
@@ -1880,7 +1880,7 @@ setup_data(pgpv_cursor_t *cursor, pgpv_t
 		if (is_armored(buf, sizeof(buf))) {
 			read_ascii_armor_file(cursor, p);
 		} else {
-			read_binary_file(pgp, signature, %s, p);
+			read_binary_file(pgp, signature, %s, (const char *)p);
 		}
 		fclose(fp);
 	} else {



CVS commit: src/external/bsd/llvm/include

2014-01-06 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Jan  7 01:59:36 UTC 2014

Modified Files:
src/external/bsd/llvm/include: Makefile

Log Message:
Replace with a simple -e x for sed.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/external/bsd/llvm/include/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/llvm/include/Makefile
diff -u src/external/bsd/llvm/include/Makefile:1.27 src/external/bsd/llvm/include/Makefile:1.28
--- src/external/bsd/llvm/include/Makefile:1.27	Sun Jan  5 16:38:06 2014
+++ src/external/bsd/llvm/include/Makefile	Tue Jan  7 01:59:36 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.27 2014/01/05 16:38:06 joerg Exp $
+#	$NetBSD: Makefile,v 1.28 2014/01/07 01:59:36 joerg Exp $
 
 .include bsd.init.mk
 
@@ -150,9 +150,9 @@ CLEANFILES+=	llvm/Config/config.h llvm/C
 llvm/Config/config.h: ${LLVM_TOPLEVEL}/Makefile.inc ${LLVM_TOPLEVEL}/config/llvm/Config/config.h.in
 	mkdir -p ${.TARGET:H}
 	${TOOL_SED} -e /LLVM_DEFAULT_TARGET_TRIPLE/d -e /LLVM_NATIVE_/d \
-	-e /LLVM_VERSION_/d -e /PACKAGE_VERSION/d \
-	 ${LLVM_TOPLEVEL}/config/llvm/Config/config.h.in | \
-	head -n -1  ${.TARGET}.tmp
+	-e /LLVM_VERSION_/d -e /PACKAGE_VERSION/d -e 'x' \
+	 ${LLVM_TOPLEVEL}/config/llvm/Config/config.h.in \
+	 ${.TARGET}.tmp
 	printf '#define LLVM_DEFAULT_TARGET_TRIPLE ${MACHINE_GNU_PLATFORM}\n'  ${.TARGET}.tmp
 	printf '#define PACKAGE_VERSION ${LLVM_VERSION} (trunk ${LLVM_REVISION})\n'  ${.TARGET}.tmp
 	printf '#define LLVM_VERSION_MAJOR ${LLVM_VERSION:C,\.[0-9]*,,}\n'  ${.TARGET}.tmp
@@ -163,9 +163,9 @@ llvm/Config/config.h: ${LLVM_TOPLEVEL}/M
 llvm/Config/llvm-config.h: ${LLVM_TOPLEVEL}/Makefile.inc ${LLVM_TOPLEVEL}/config/llvm/Config/llvm-config.h.in
 	mkdir -p ${.TARGET:H}
 	${TOOL_SED} -e /LLVM_DEFAULT_TARGET_TRIPLE/d -e /LLVM_NATIVE_/d \
-	-e /LLVM_VERSION_/d -e /PACKAGE_VERSION/d \
-	 ${LLVM_TOPLEVEL}/config/llvm/Config/llvm-config.h.in | \
-	head -n -1  ${.TARGET}.tmp
+	-e /LLVM_VERSION_/d -e /PACKAGE_VERSION/d -e 'x' \
+	 ${LLVM_TOPLEVEL}/config/llvm/Config/llvm-config.h.in \
+	 ${.TARGET}.tmp
 	printf '#define LLVM_DEFAULT_TARGET_TRIPLE ${MACHINE_GNU_PLATFORM}\n'  ${.TARGET}.tmp
 	printf '#define LLVM_VERSION_MAJOR ${LLVM_VERSION:C,\.[0-9]*,,}\n'  ${.TARGET}.tmp
 	printf '#define LLVM_VERSION_MINOR ${LLVM_VERSION:C,[0-9]*\.,,}\n'  ${.TARGET}.tmp



CVS commit: src/external/bsd/atf/dist

2014-01-06 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Jan  7 02:06:42 UTC 2014

Modified Files:
src/external/bsd/atf/dist/atf-c: error.h tc.c tc.h
src/external/bsd/atf/dist/atf-c++: tests.cpp
src/external/bsd/atf/dist/atf-c/detail: dynstr.c dynstr.h fs.c fs.h
sanity.c test_helpers.c text.h tp_main.c

Log Message:
Format string annotations and fixes for resulting fallout.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.4 -r1.2 src/external/bsd/atf/dist/atf-c/error.h
cvs rdiff -u -r1.12 -r1.13 src/external/bsd/atf/dist/atf-c/tc.c
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/atf/dist/atf-c/tc.h
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/atf/dist/atf-c++/tests.cpp
cvs rdiff -u -r1.1.1.2 -r1.2 src/external/bsd/atf/dist/atf-c/detail/dynstr.c \
src/external/bsd/atf/dist/atf-c/detail/dynstr.h \
src/external/bsd/atf/dist/atf-c/detail/fs.c \
src/external/bsd/atf/dist/atf-c/detail/fs.h \
src/external/bsd/atf/dist/atf-c/detail/text.h
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/atf/dist/atf-c/detail/sanity.c
cvs rdiff -u -r1.5 -r1.6 \
src/external/bsd/atf/dist/atf-c/detail/test_helpers.c
cvs rdiff -u -r1.1.1.4 -r1.2 src/external/bsd/atf/dist/atf-c/detail/tp_main.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/atf-c/error.h
diff -u src/external/bsd/atf/dist/atf-c/error.h:1.1.1.4 src/external/bsd/atf/dist/atf-c/error.h:1.2
--- src/external/bsd/atf/dist/atf-c/error.h:1.1.1.4	Mon Jan 16 22:36:30 2012
+++ src/external/bsd/atf/dist/atf-c/error.h	Tue Jan  7 02:06:42 2014
@@ -33,6 +33,7 @@
 #include stdbool.h
 #include stddef.h
 
+#include atf-c/defs.h
 #include atf-c/error_fwd.h
 
 /* -
@@ -62,7 +63,8 @@ void atf_error_format(const atf_error_t,
  * Common error types.
  * - */
 
-atf_error_t atf_libc_error(int, const char *, ...);
+atf_error_t atf_libc_error(int, const char *, ...)
+ATF_DEFS_ATTRIBUTE_FORMAT_PRINTF(2, 3);
 int atf_libc_error_code(const atf_error_t);
 const char *atf_libc_error_msg(const atf_error_t);
 

Index: src/external/bsd/atf/dist/atf-c/tc.c
diff -u src/external/bsd/atf/dist/atf-c/tc.c:1.12 src/external/bsd/atf/dist/atf-c/tc.c:1.13
--- src/external/bsd/atf/dist/atf-c/tc.c:1.12	Mon Jan 16 22:41:30 2012
+++ src/external/bsd/atf/dist/atf-c/tc.c	Tue Jan  7 02:06:42 2014
@@ -79,12 +79,14 @@ struct context {
 static void context_init(struct context *, const atf_tc_t *, const char *);
 static void check_fatal_error(atf_error_t);
 static void report_fatal_error(const char *, ...)
+ATF_DEFS_ATTRIBUTE_FORMAT_PRINTF(1, 2)
 ATF_DEFS_ATTRIBUTE_NORETURN;
 static atf_error_t write_resfile(const int, const char *, const int,
  const atf_dynstr_t *);
 static void create_resfile(const char *, const char *, const int,
atf_dynstr_t *);
 static void error_in_expect(struct context *, const char *, ...)
+ATF_DEFS_ATTRIBUTE_FORMAT_PRINTF(2, 3)
 ATF_DEFS_ATTRIBUTE_NORETURN;
 static void validate_expect(struct context *);
 static void expected_failure(struct context *, atf_dynstr_t *)
@@ -97,9 +99,11 @@ static void pass(struct context *)
 static void skip(struct context *, atf_dynstr_t *)
 ATF_DEFS_ATTRIBUTE_NORETURN;
 static void format_reason_ap(atf_dynstr_t *, const char *, const size_t,
- const char *, va_list);
+ const char *, va_list)
+ATF_DEFS_ATTRIBUTE_FORMAT_PRINTF(4, 0);
 static void format_reason_fmt(atf_dynstr_t *, const char *, const size_t,
-  const char *, ...);
+  const char *, ...)
+ATF_DEFS_ATTRIBUTE_FORMAT_PRINTF(4, 5);
 static void errno_test(struct context *, const char *, const size_t,
const int, const char *, const bool,
void (*)(struct context *, atf_dynstr_t *));
@@ -571,7 +575,7 @@ atf_tc_init(atf_tc_t *tc, const char *id
 if (atf_is_error(err))
 goto err_vars;
 
-err = atf_tc_set_md_var(tc, ident, ident);
+err = atf_tc_set_md_var(tc, ident, %s, ident);
 if (atf_is_error(err))
 goto err_map;
 
@@ -787,28 +791,35 @@ atf_tc_set_md_var(atf_tc_t *tc, const ch
  * - */
 
 static void _atf_tc_fail(struct context *, const char *, va_list)
+ATF_DEFS_ATTRIBUTE_FORMAT_PRINTF(2, 0)
 ATF_DEFS_ATTRIBUTE_NORETURN;
-static void _atf_tc_fail_nonfatal(struct context *, const char *, va_list);
+static void _atf_tc_fail_nonfatal(struct context *, const char *, va_list)
+ATF_DEFS_ATTRIBUTE_FORMAT_PRINTF(2, 0);
 static void _atf_tc_fail_check(struct context *, const char *, const size_t,
-const char *, va_list);
+const char *, va_list)
+   

CVS commit: src/usr.bin

2014-01-06 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Jan  7 02:07:09 UTC 2014

Modified Files:
src/usr.bin/flock: flock.c
src/usr.bin/ftp: ssl.h
src/usr.bin/units: units.c

Log Message:
Annotate functions using format strings.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/flock/flock.c
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/ftp/ssl.h
cvs rdiff -u -r1.24 -r1.25 src/usr.bin/units/units.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/flock/flock.c
diff -u src/usr.bin/flock/flock.c:1.8 src/usr.bin/flock/flock.c:1.9
--- src/usr.bin/flock/flock.c:1.8	Tue Oct 29 16:02:15 2013
+++ src/usr.bin/flock/flock.c	Tue Jan  7 02:07:08 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: flock.c,v 1.8 2013/10/29 16:02:15 christos Exp $	*/
+/*	$NetBSD: flock.c,v 1.9 2014/01/07 02:07:08 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: flock.c,v 1.8 2013/10/29 16:02:15 christos Exp $);
+__RCSID($NetBSD: flock.c,v 1.9 2014/01/07 02:07:08 joerg Exp $);
 
 #include stdio.h
 #include string.h
@@ -63,7 +63,7 @@ static struct option flock_longopts[] = 
 
 static sig_atomic_t timeout_expired;
 
-static __dead void
+static __dead __printflike(1, 2) void
 usage(const char *fmt, ...) 
 {
 	if (fmt) {

Index: src/usr.bin/ftp/ssl.h
diff -u src/usr.bin/ftp/ssl.h:1.1 src/usr.bin/ftp/ssl.h:1.2
--- src/usr.bin/ftp/ssl.h:1.1	Fri Dec 21 18:07:36 2012
+++ src/usr.bin/ftp/ssl.h	Tue Jan  7 02:07:08 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ssl.h,v 1.1 2012/12/21 18:07:36 christos Exp $	*/
+/*	$NetBSD: ssl.h,v 1.2 2014/01/07 02:07:08 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,8 @@
 #define FETCH struct fetch_connect
 struct fetch_connect;
 
-int fetch_printf(struct fetch_connect *, const char *fmt, ...);
+int fetch_printf(struct fetch_connect *, const char *fmt, ...)
+__printflike(2, 3);
 int fetch_fileno(struct fetch_connect *);
 int fetch_error(struct fetch_connect *);
 int fetch_flush(struct fetch_connect *);

Index: src/usr.bin/units/units.c
diff -u src/usr.bin/units/units.c:1.24 src/usr.bin/units/units.c:1.25
--- src/usr.bin/units/units.c:1.24	Sun Jan  6 00:19:13 2013
+++ src/usr.bin/units/units.c	Tue Jan  7 02:07:09 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: units.c,v 1.24 2013/01/06 00:19:13 wiz Exp $	*/
+/*	$NetBSD: units.c,v 1.25 2014/01/07 02:07:09 joerg Exp $	*/
 
 /*
  * units.c   Copyright (c) 1993 by Adrian Mariano (adr...@cam.cornell.edu)
@@ -105,7 +105,7 @@ dupstr(const char *str)
 }
 
 
-static void
+static __printflike(1, 2) void
 mywarnx(const char *fmt, ...)
 {
 	va_list args;



CVS commit: src/lib/libpam/modules

2014-01-06 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Jan  7 02:07:43 UTC 2014

Modified Files:
src/lib/libpam/modules/pam_lastlog: pam_lastlog.c
src/lib/libpam/modules/pam_login_access: login_access.c
src/lib/libpam/modules/pam_radius: pam_radius.c

Log Message:
Annotate logit to provide transitive format string checks.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/lib/libpam/modules/pam_lastlog/pam_lastlog.c
cvs rdiff -u -r1.7 -r1.8 \
src/lib/libpam/modules/pam_login_access/login_access.c
cvs rdiff -u -r1.7 -r1.8 src/lib/libpam/modules/pam_radius/pam_radius.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libpam/modules/pam_lastlog/pam_lastlog.c
diff -u src/lib/libpam/modules/pam_lastlog/pam_lastlog.c:1.14 src/lib/libpam/modules/pam_lastlog/pam_lastlog.c:1.15
--- src/lib/libpam/modules/pam_lastlog/pam_lastlog.c:1.14	Tue Jan  3 19:02:55 2012
+++ src/lib/libpam/modules/pam_lastlog/pam_lastlog.c	Tue Jan  7 02:07:43 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pam_lastlog.c,v 1.14 2012/01/03 19:02:55 christos Exp $	*/
+/*	$NetBSD: pam_lastlog.c,v 1.15 2014/01/07 02:07:43 joerg Exp $	*/
 
 /*-
  * Copyright (c) 1980, 1987, 1988, 1991, 1993, 1994
@@ -47,7 +47,7 @@
 #ifdef __FreeBSD__
 __FBSDID($FreeBSD: src/lib/libpam/modules/pam_lastlog/pam_lastlog.c,v 1.20 2004/01/26 19:28:37 des Exp $);
 #else
-__RCSID($NetBSD: pam_lastlog.c,v 1.14 2012/01/03 19:02:55 christos Exp $);
+__RCSID($NetBSD: pam_lastlog.c,v 1.15 2014/01/07 02:07:43 joerg Exp $);
 #endif
 
 #include sys/param.h
@@ -95,6 +95,7 @@ static void domsg(pam_handle_t *, time_t
 size_t);
 #endif
 
+__printflike(2, 3)
 static void
 logit(int level, const char *fmt, ...)
 {

Index: src/lib/libpam/modules/pam_login_access/login_access.c
diff -u src/lib/libpam/modules/pam_login_access/login_access.c:1.7 src/lib/libpam/modules/pam_login_access/login_access.c:1.8
--- src/lib/libpam/modules/pam_login_access/login_access.c:1.7	Sun Dec 29 22:54:58 2013
+++ src/lib/libpam/modules/pam_login_access/login_access.c	Tue Jan  7 02:07:43 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: login_access.c,v 1.7 2013/12/29 22:54:58 christos Exp $	*/
+/*	$NetBSD: login_access.c,v 1.8 2014/01/07 02:07:43 joerg Exp $	*/
 
 /*
  * This module implements a simple but effective form of login access
@@ -19,7 +19,7 @@ static char sccsid[] = %Z% %M% %I% %E% 
 #ifdef __FreeBSD__
 __FBSDID($FreeBSD: src/lib/libpam/modules/pam_login_access/login_access.c,v 1.12 2004/03/05 08:10:18 markm Exp $);
 #else
-__RCSID($NetBSD: login_access.c,v 1.7 2013/12/29 22:54:58 christos Exp $);
+__RCSID($NetBSD: login_access.c,v 1.8 2014/01/07 02:07:43 joerg Exp $);
 #endif
 
 #include sys/types.h
@@ -56,6 +56,7 @@ static int	user_match(const char *, cons
 
 /* login_access - match username/group and host/tty with access control file */
 
+__printflike(2, 3)
 static void
 logit(int level, const char *fmt, ...)
 {

Index: src/lib/libpam/modules/pam_radius/pam_radius.c
diff -u src/lib/libpam/modules/pam_radius/pam_radius.c:1.7 src/lib/libpam/modules/pam_radius/pam_radius.c:1.8
--- src/lib/libpam/modules/pam_radius/pam_radius.c:1.7	Fri Nov  3 18:55:40 2006
+++ src/lib/libpam/modules/pam_radius/pam_radius.c	Tue Jan  7 02:07:43 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pam_radius.c,v 1.7 2006/11/03 18:55:40 christos Exp $	*/
+/*	$NetBSD: pam_radius.c,v 1.8 2014/01/07 02:07:43 joerg Exp $	*/
 
 /*-
  * Copyright 1998 Juniper Networks, Inc.
@@ -40,7 +40,7 @@
 #ifdef __FreeBSD__
 __FBSDID($FreeBSD: src/lib/libpam/modules/pam_radius/pam_radius.c,v 1.22 2004/06/25 12:32:45 kan Exp $);
 #else
-__RCSID($NetBSD: pam_radius.c,v 1.7 2006/11/03 18:55:40 christos Exp $);
+__RCSID($NetBSD: pam_radius.c,v 1.8 2014/01/07 02:07:43 joerg Exp $);
 #endif
 
 #include sys/param.h
@@ -76,6 +76,7 @@ static int	 do_accept(pam_handle_t *, st
 static int	 do_challenge(pam_handle_t *, struct rad_handle *,
 		const char *);
 
+__printflike(2, 3)
 static void
 logit(int level, const char *fmt, ...)
 {



CVS commit: src/external/bsd/libevent/dist

2014-01-06 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Jan  7 02:09:01 UTC 2014

Modified Files:
src/external/bsd/libevent/dist: log-internal.h log.c

Log Message:
Add format string checks for _warn_helper.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/libevent/dist/log-internal.h
cvs rdiff -u -r1.1.1.2 -r1.2 src/external/bsd/libevent/dist/log.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/libevent/dist/log-internal.h
diff -u src/external/bsd/libevent/dist/log-internal.h:1.2 src/external/bsd/libevent/dist/log-internal.h:1.3
--- src/external/bsd/libevent/dist/log-internal.h:1.2	Thu Apr 11 16:56:41 2013
+++ src/external/bsd/libevent/dist/log-internal.h	Tue Jan  7 02:09:01 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: log-internal.h,v 1.2 2013/04/11 16:56:41 christos Exp $	*/
+/*	$NetBSD: log-internal.h,v 1.3 2014/01/07 02:09:01 joerg Exp $	*/
 /*
  * Copyright (c) 2000-2007 Niels Provos pro...@citi.umich.edu
  * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
@@ -31,7 +31,7 @@
 #include event2/util.h
 
 #ifdef __GNUC__
-#define EV_CHECK_FMT(a,b) __attribute__((format(printf, a, b)))
+#define EV_CHECK_FMT(a,b) __attribute__((__format__(__printf__, a, b)))
 #define EV_NORETURN __attribute__((noreturn))
 #else
 #define EV_CHECK_FMT(a,b)
@@ -55,6 +55,4 @@ void _event_debugx(const char *fmt, ...)
 #define event_debug(x) do {;} while (/*CONSTCOND*/0)
 #endif
 
-#undef EV_CHECK_FMT
-
 #endif

Index: src/external/bsd/libevent/dist/log.c
diff -u src/external/bsd/libevent/dist/log.c:1.1.1.2 src/external/bsd/libevent/dist/log.c:1.2
--- src/external/bsd/libevent/dist/log.c:1.1.1.2	Thu Apr 11 16:43:26 2013
+++ src/external/bsd/libevent/dist/log.c	Tue Jan  7 02:09:01 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: log.c,v 1.1.1.2 2013/04/11 16:43:26 christos Exp $	*/
+/*	$NetBSD: log.c,v 1.2 2014/01/07 02:09:01 joerg Exp $	*/
 /*	$OpenBSD: err.c,v 1.2 2002/06/25 15:50:15 mickey Exp $	*/
 
 /*
@@ -40,7 +40,7 @@
 
 #include event2/event-config.h
 #include sys/cdefs.h
-__RCSID($NetBSD: log.c,v 1.1.1.2 2013/04/11 16:43:26 christos Exp $);
+__RCSID($NetBSD: log.c,v 1.2 2014/01/07 02:09:01 joerg Exp $);
 
 #ifdef WIN32
 #include winsock2.h
@@ -60,7 +60,7 @@ __RCSID($NetBSD: log.c,v 1.1.1.2 2013/0
 #include log-internal.h
 
 static void _warn_helper(int severity, const char *errstr, const char *fmt,
-va_list ap);
+va_list ap) EV_CHECK_FMT(3, 0);
 static void event_log(int severity, const char *msg);
 static void event_exit(int errcode) EV_NORETURN;
 



CVS commit: src/external/bsd/libarchive/dist/libarchive_fe

2014-01-06 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Jan  7 02:09:37 UTC 2014

Modified Files:
src/external/bsd/libarchive/dist/libarchive_fe: err.c err.h

Log Message:
Annotate warnc/errc for format string checking.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/bsd/libarchive/dist/libarchive_fe/err.c \
src/external/bsd/libarchive/dist/libarchive_fe/err.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/libarchive/dist/libarchive_fe/err.c
diff -u src/external/bsd/libarchive/dist/libarchive_fe/err.c:1.1.1.1 src/external/bsd/libarchive/dist/libarchive_fe/err.c:1.2
--- src/external/bsd/libarchive/dist/libarchive_fe/err.c:1.1.1.1	Sat Feb 20 02:49:07 2010
+++ src/external/bsd/libarchive/dist/libarchive_fe/err.c	Tue Jan  7 02:09:37 2014
@@ -42,7 +42,7 @@ __FBSDID($FreeBSD$);
 
 const char *lafe_progname;
 
-static void
+static __printflike(2, 0) void
 lafe_vwarnc(int code, const char *fmt, va_list ap)
 {
 	fprintf(stderr, %s: , lafe_progname);
Index: src/external/bsd/libarchive/dist/libarchive_fe/err.h
diff -u src/external/bsd/libarchive/dist/libarchive_fe/err.h:1.1.1.1 src/external/bsd/libarchive/dist/libarchive_fe/err.h:1.2
--- src/external/bsd/libarchive/dist/libarchive_fe/err.h:1.1.1.1	Sat Feb 20 02:49:07 2010
+++ src/external/bsd/libarchive/dist/libarchive_fe/err.h	Tue Jan  7 02:09:37 2014
@@ -35,7 +35,8 @@
 
 extern const char *lafe_progname;
 
-void	lafe_warnc(int code, const char *fmt, ...);
-void	lafe_errc(int eval, int code, const char *fmt, ...) __LA_DEAD;
+void	lafe_warnc(int code, const char *fmt, ...) __printflike(2, 3);
+void	lafe_errc(int eval, int code, const char *fmt, ...)
+__LA_DEAD __printflike(3, 4);
 
 #endif



CVS commit: src/external/bsd/ntp/dist/ntpd

2014-01-06 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Jan  7 02:10:49 UTC 2014

Modified Files:
src/external/bsd/ntp/dist/ntpd: refclock_parse.c

Log Message:
Fix format strings.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/bsd/ntp/dist/ntpd/refclock_parse.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/refclock_parse.c
diff -u src/external/bsd/ntp/dist/ntpd/refclock_parse.c:1.11 src/external/bsd/ntp/dist/ntpd/refclock_parse.c:1.12
--- src/external/bsd/ntp/dist/ntpd/refclock_parse.c:1.11	Sun Jan  5 15:13:36 2014
+++ src/external/bsd/ntp/dist/ntpd/refclock_parse.c	Tue Jan  7 02:10:49 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: refclock_parse.c,v 1.11 2014/01/05 15:13:36 kardel Exp $	*/
+/*	$NetBSD: refclock_parse.c,v 1.12 2014/01/07 02:10:49 joerg Exp $	*/
 
 /*
  * /src/NTP/REPOSITORY/ntp4-dev/ntpd/refclock_parse.c,v 4.81 2009/05/01 10:15:29 kardel RELEASE_20090105_A
@@ -2464,7 +2464,7 @@ init_iobinding(
  ** support routines
  **/
 
-static char *
+static __printflike(4, 5) char *
 ap(char *buffer, size_t len, char *pos, const char *fmt, ...)
 {
 	va_list va;
@@ -5552,28 +5552,28 @@ trimbletsip_message(
 t = ap(pbuffer, sizeof(pbuffer), t, illegal value 0x%02x, mb(0)  0xFF);
 break;
 			case 0x00:
-t = ap(pbuffer, sizeof(pbuffer), t, doing position fixes, BUFFER_SIZE(pbuffer, t));
+t = ap(pbuffer, sizeof(pbuffer), t, doing position fixes);
 break;
 			case 0x01:
-t = ap(pbuffer, sizeof(pbuffer), t, no GPS time yet, BUFFER_SIZE(pbuffer, t));
+t = ap(pbuffer, sizeof(pbuffer), t, no GPS time yet);
 break;
 			case 0x03:
-t = ap(pbuffer, sizeof(pbuffer), t, PDOP too high, BUFFER_SIZE(pbuffer, t));
+t = ap(pbuffer, sizeof(pbuffer), t, PDOP too high);
 break;
 			case 0x08:
-t = ap(pbuffer, sizeof(pbuffer), t, no usable satellites, BUFFER_SIZE(pbuffer, t));
+t = ap(pbuffer, sizeof(pbuffer), t, no usable satellites);
 break;
 			case 0x09:
-t = ap(pbuffer, sizeof(pbuffer), t, only ONE usable satellite, BUFFER_SIZE(pbuffer, t));
+t = ap(pbuffer, sizeof(pbuffer), t, only ONE usable satellite);
 break;
 			case 0x0A:
-t = ap(pbuffer, sizeof(pbuffer), t, only TWO usable satellites, BUFFER_SIZE(pbuffer, t));
+t = ap(pbuffer, sizeof(pbuffer), t, only TWO usable satellites);
 break;
 			case 0x0B:
-t = ap(pbuffer, sizeof(pbuffer), t, only THREE usable satellites, BUFFER_SIZE(pbuffer, t));
+t = ap(pbuffer, sizeof(pbuffer), t, only THREE usable satellites);
 break;
 			case 0x0C:
-t = ap(pbuffer, sizeof(pbuffer), t, the chosen satellite is unusable, BUFFER_SIZE(pbuffer, t));
+t = ap(pbuffer, sizeof(pbuffer), t, the chosen satellite is unusable);
 break;
 			}
 



CVS commit: src/external/bsd/tmux/dist

2014-01-06 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Jan  7 02:11:30 UTC 2014

Modified Files:
src/external/bsd/tmux/dist: input.c log.c tmux.h

Log Message:
Format string verification


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/tmux/dist/input.c
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/tmux/dist/log.c
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/tmux/dist/tmux.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/tmux/dist/input.c
diff -u src/external/bsd/tmux/dist/input.c:1.4 src/external/bsd/tmux/dist/input.c:1.5
--- src/external/bsd/tmux/dist/input.c:1.4	Wed Aug 17 19:28:36 2011
+++ src/external/bsd/tmux/dist/input.c	Tue Jan  7 02:11:29 2014
@@ -1,4 +1,4 @@
-/* $Id: input.c,v 1.4 2011/08/17 19:28:36 jmmv Exp $ */
+/* $Id: input.c,v 1.5 2014/01/07 02:11:29 joerg Exp $ */
 
 /*
  * Copyright (c) 2007 Nicholas Marriott n...@users.sourceforge.net
@@ -49,7 +49,7 @@
 /* Helper functions. */
 int	input_split(struct input_ctx *);
 int	input_get(struct input_ctx *, u_int, int, int);
-void	input_reply(struct input_ctx *, const char *, ...);
+void	input_reply(struct input_ctx *, const char *, ...) __printflike(2, 3);
 
 /* Transition entry/exit handlers. */
 void	input_clear(struct input_ctx *);

Index: src/external/bsd/tmux/dist/log.c
diff -u src/external/bsd/tmux/dist/log.c:1.2 src/external/bsd/tmux/dist/log.c:1.3
--- src/external/bsd/tmux/dist/log.c:1.2	Thu Aug 25 16:41:51 2011
+++ src/external/bsd/tmux/dist/log.c	Tue Jan  7 02:11:29 2014
@@ -1,4 +1,4 @@
-/* $Id: log.c,v 1.2 2011/08/25 16:41:51 joerg Exp $ */
+/* $Id: log.c,v 1.3 2014/01/07 02:11:29 joerg Exp $ */
 
 /*
  * Copyright (c) 2007 Nicholas Marriott n...@users.sourceforge.net
@@ -39,7 +39,7 @@ FILE   *log_file;
 /* Debug level. */
 int	log_level;
 
-void		 log_vwrite(int, const char *, va_list);
+void		 log_vwrite(int, const char *, va_list) __printflike(2, 0);
 __dead void	 log_vfatal(const char *, va_list);
 
 /* Open logging to tty. */
@@ -105,6 +105,8 @@ log_vwrite(int pri, const char *msg, va_
 }
 
 /* Log a warning with error string. */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored -Wformat-nonliteral
 void printflike1
 log_warn(const char *msg, ...)
 {
@@ -118,6 +120,7 @@ log_warn(const char *msg, ...)
 	free(fmt);
 	va_end(ap);
 }
+#pragma GCC diagnostic push
 
 /* Log a warning. */
 void printflike1

Index: src/external/bsd/tmux/dist/tmux.h
diff -u src/external/bsd/tmux/dist/tmux.h:1.3 src/external/bsd/tmux/dist/tmux.h:1.4
--- src/external/bsd/tmux/dist/tmux.h:1.3	Sat Sep 17 01:50:08 2011
+++ src/external/bsd/tmux/dist/tmux.h	Tue Jan  7 02:11:29 2014
@@ -1,4 +1,4 @@
-/* $Id: tmux.h,v 1.3 2011/09/17 01:50:08 christos Exp $ */
+/* $Id: tmux.h,v 1.4 2014/01/07 02:11:29 joerg Exp $ */
 
 /*
  * Copyright (c) 2007 Nicholas Marriott n...@users.sourceforge.net
@@ -80,6 +80,9 @@ extern char   **environ;
 #define unused __attribute__ ((unused))
 
 /* Attribute to make gcc check printf-like arguments. */
+#define vprintflike2 __attribute__ ((format (printf, 2, 0)))
+#define vprintflike3 __attribute__ ((format (printf, 3, 0)))
+#define vprintflike5 __attribute__ ((format (printf, 5, 0)))
 #define printflike1 __attribute__ ((format (printf, 1, 2)))
 #define printflike2 __attribute__ ((format (printf, 2, 3)))
 #define printflike3 __attribute__ ((format (printf, 3, 4)))
@@ -1803,7 +1806,7 @@ void printflike3 screen_write_puts(struc
 	 struct grid_cell *, const char *, ...);
 void printflike5 screen_write_nputs(struct screen_write_ctx *,
 	 ssize_t, struct grid_cell *, int, const char *, ...);
-void	 screen_write_vnputs(struct screen_write_ctx *,
+void vprintflike5 screen_write_vnputs(struct screen_write_ctx *,
 	 ssize_t, struct grid_cell *, int, const char *, va_list);
 void	 screen_write_parsestyle(
 	 struct grid_cell *, struct grid_cell *, const char *);
@@ -1980,13 +1983,13 @@ extern const struct window_mode window_c
 extern const struct window_mode window_copy_mode;
 void		 window_copy_init_from_pane(struct window_pane *);
 void		 window_copy_init_for_output(struct window_pane *);
-void		 window_copy_add(struct window_pane *, const char *, ...);
-void		 window_copy_vadd(struct window_pane *, const char *, va_list);
+void printflike2 window_copy_add(struct window_pane *, const char *, ...);
+void vprintflike2 window_copy_vadd(struct window_pane *, const char *, va_list);
 void		 window_copy_pageup(struct window_pane *);
 
 /* window-choose.c */
 extern const struct window_mode window_choose_mode;
-void		 window_choose_vadd(
+void vprintflike3 window_choose_vadd(
 		 struct window_pane *, int, const char *, va_list);
 void printflike3 window_choose_add(
 		 struct window_pane *, int, const char *, ...);
@@ -2066,9 +2069,9 @@ void		*xmalloc(size_t);
 void		*xrealloc(void *, size_t, size_t);
 void		 xfree(void *);
 int printflike2	 xasprintf(char **, const char *, 

CVS commit: src/external/bsd/file/dist/src

2014-01-06 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Jan  7 02:12:07 UTC 2014

Modified Files:
src/external/bsd/file/dist/src: file.h funcs.c

Log Message:
Format string checks for file_vprintf and file_error_core


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/file/dist/src/file.h
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/file/dist/src/funcs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/src/file.h
diff -u src/external/bsd/file/dist/src/file.h:1.9 src/external/bsd/file/dist/src/file.h:1.10
--- src/external/bsd/file/dist/src/file.h:1.9	Sun Dec  1 19:32:15 2013
+++ src/external/bsd/file/dist/src/file.h	Tue Jan  7 02:12:07 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: file.h,v 1.9 2013/12/01 19:32:15 christos Exp $	*/
+/*	$NetBSD: file.h,v 1.10 2014/01/07 02:12:07 joerg Exp $	*/
 
 /*
  * Copyright (c) Ian F. Darwin 1986-1995.
@@ -417,7 +417,8 @@ protected int file_buffer(struct magic_s
 size_t);
 protected int file_fsmagic(struct magic_set *, const char *, struct stat *);
 protected int file_pipe2file(struct magic_set *, int, const void *, size_t);
-protected int file_vprintf(struct magic_set *, const char *, va_list);
+protected int file_vprintf(struct magic_set *, const char *, va_list)
+__attribute__((__format__(__printf__, 2, 0)));
 protected size_t file_printedlen(const struct magic_set *);
 protected int file_replace(struct magic_set *, const char *, const char *);
 protected int file_printf(struct magic_set *, const char *, ...)

Index: src/external/bsd/file/dist/src/funcs.c
diff -u src/external/bsd/file/dist/src/funcs.c:1.6 src/external/bsd/file/dist/src/funcs.c:1.7
--- src/external/bsd/file/dist/src/funcs.c:1.6	Sun Dec  1 19:32:15 2013
+++ src/external/bsd/file/dist/src/funcs.c	Tue Jan  7 02:12:07 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: funcs.c,v 1.6 2013/12/01 19:32:15 christos Exp $	*/
+/*	$NetBSD: funcs.c,v 1.7 2014/01/07 02:12:07 joerg Exp $	*/
 
 /*
  * Copyright (c) Christos Zoulas 2003.
@@ -32,7 +32,7 @@
 #if 0
 FILE_RCSID(@(#)$File: funcs.c,v 1.64 2013/11/19 23:49:44 christos Exp $)
 #else
-__RCSID($NetBSD: funcs.c,v 1.6 2013/12/01 19:32:15 christos Exp $);
+__RCSID($NetBSD: funcs.c,v 1.7 2014/01/07 02:12:07 joerg Exp $);
 #endif
 #endif	/* lint */
 
@@ -101,6 +101,7 @@ file_printf(struct magic_set *ms, const 
  * error - print best error message possible
  */
 /*VARARGS*/
+__attribute__((__format__(__printf__, 3, 0)))
 private void
 file_error_core(struct magic_set *ms, int error, const char *f, va_list va,
 size_t lineno)



CVS commit: src/external/bsd/fetch/dist/libfetch

2014-01-06 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Jan  7 02:13:00 UTC 2014

Modified Files:
src/external/bsd/fetch/dist/libfetch: common.h ftp.c http.c

Log Message:
Annotate format strings. Add a bunch of int casts for size limits.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.7 -r1.2 src/external/bsd/fetch/dist/libfetch/common.h
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/fetch/dist/libfetch/ftp.c
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/fetch/dist/libfetch/http.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/fetch/dist/libfetch/common.h
diff -u src/external/bsd/fetch/dist/libfetch/common.h:1.1.1.7 src/external/bsd/fetch/dist/libfetch/common.h:1.2
--- src/external/bsd/fetch/dist/libfetch/common.h:1.1.1.7	Wed Mar 24 20:51:42 2010
+++ src/external/bsd/fetch/dist/libfetch/common.h	Tue Jan  7 02:13:00 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: common.h,v 1.1.1.7 2010/03/24 20:51:42 joerg Exp $	*/
+/*	$NetBSD: common.h,v 1.2 2014/01/07 02:13:00 joerg Exp $	*/
 /*-
  * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav
  * All rights reserved.
@@ -90,7 +90,7 @@ struct fetcherr {
 
 void		 fetch_seterr(struct fetcherr *, int);
 void		 fetch_syserr(void);
-void		 fetch_info(const char *, ...);
+void		 fetch_info(const char *, ...) __printflike(1, 2);
 int		 fetch_default_port(const char *);
 int		 fetch_default_proxy_port(const char *);
 int		 fetch_bind(int, int, const char *);

Index: src/external/bsd/fetch/dist/libfetch/ftp.c
diff -u src/external/bsd/fetch/dist/libfetch/ftp.c:1.6 src/external/bsd/fetch/dist/libfetch/ftp.c:1.7
--- src/external/bsd/fetch/dist/libfetch/ftp.c:1.6	Sat Oct 19 22:58:40 2013
+++ src/external/bsd/fetch/dist/libfetch/ftp.c	Tue Jan  7 02:13:00 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ftp.c,v 1.6 2013/10/19 22:58:40 mrg Exp $	*/
+/*	$NetBSD: ftp.c,v 1.7 2014/01/07 02:13:00 joerg Exp $	*/
 /*-
  * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav
  * Copyright (c) 2008, 2009, 2010 Joerg Sonnenberger jo...@netbsd.org
@@ -198,6 +198,7 @@ ftp_chkerr(conn_t *conn)
 /*
  * Send a command and check reply
  */
+__printflike(2, 3)
 static int
 ftp_cmd(conn_t *conn, const char *fmt, ...)
 {
@@ -391,7 +392,7 @@ ftp_cwd(conn_t *conn, const char *path, 
 			++beg, ++i;
 		for (++i; dst + i  end  dst[i] != '/'; ++i)
 			/* nothing */ ;
-		e = ftp_cmd(conn, CWD %.*s\r\n, dst + i - beg, beg);
+		e = ftp_cmd(conn, CWD %.*s\r\n, (int)(dst + i - beg), beg);
 		if (e != FTP_FILE_ACTION_OK) {
 			free(dst);
 			ftp_seterr(e);
@@ -489,7 +490,7 @@ ftp_stat(conn_t *conn, const char *file,
 		return (-1);
 	}
 
-	e = ftp_cmd(conn, SIZE %.*s\r\n, filenamelen, filename);
+	e = ftp_cmd(conn, SIZE %.*s\r\n, (int)filenamelen, filename);
 	if (e != FTP_FILE_STATUS) {
 		ftp_seterr(e);
 		return (-1);
@@ -506,7 +507,7 @@ ftp_stat(conn_t *conn, const char *file,
 	if (us-size == 0)
 		us-size = -1;
 
-	e = ftp_cmd(conn, MDTM %.*s\r\n, filenamelen, filename);
+	e = ftp_cmd(conn, MDTM %.*s\r\n, (int)filenamelen, filename);
 	if (e != FTP_FILE_STATUS) {
 		ftp_seterr(e);
 		return (-1);
@@ -851,7 +852,7 @@ retry_mode:
 			e = ftp_cmd(conn, %s%s%s\r\n, oper, *op_arg ?   : , op_arg);
 		else
 			e = ftp_cmd(conn, %s %.*s\r\n, oper,
-			filenamelen, filename);
+			(int)filenamelen, filename);
 		if (e != FTP_CONNECTION_ALREADY_OPEN  e != FTP_OPEN_DATA_CONNECTION)
 			goto ouch;
 
@@ -948,7 +949,7 @@ retry_mode:
 			e = ftp_cmd(conn, %s%s%s\r\n, oper, *op_arg ?   : , op_arg);
 		else
 			e = ftp_cmd(conn, %s %.*s\r\n, oper,
-			filenamelen, filename);
+			(int)filenamelen, filename);
 		if (e != FTP_CONNECTION_ALREADY_OPEN  e != FTP_OPEN_DATA_CONNECTION)
 			goto ouch;
 

Index: src/external/bsd/fetch/dist/libfetch/http.c
diff -u src/external/bsd/fetch/dist/libfetch/http.c:1.2 src/external/bsd/fetch/dist/libfetch/http.c:1.3
--- src/external/bsd/fetch/dist/libfetch/http.c:1.2	Sat Jun 25 20:27:01 2011
+++ src/external/bsd/fetch/dist/libfetch/http.c	Tue Jan  7 02:13:00 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: http.c,v 1.2 2011/06/25 20:27:01 christos Exp $	*/
+/*	$NetBSD: http.c,v 1.3 2014/01/07 02:13:00 joerg Exp $	*/
 /*-
  * Copyright (c) 2000-2004 Dag-Erling Coïdan Smørgrav
  * Copyright (c) 2003 Thomas Klausner w...@netbsd.org
@@ -404,6 +404,7 @@ static struct {
 /*
  * Send a formatted line; optionally echo to terminal
  */
+__printflike(2, 3)
 static int
 http_cmd(conn_t *conn, const char *fmt, ...)
 {



CVS commit: src/crypto/external/bsd/openssh/dist

2014-01-06 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Jan  7 02:13:39 UTC 2014

Modified Files:
src/crypto/external/bsd/openssh/dist: log.h

Log Message:
Format string checks for do_log.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/crypto/external/bsd/openssh/dist/log.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/crypto/external/bsd/openssh/dist/log.h
diff -u src/crypto/external/bsd/openssh/dist/log.h:1.6 src/crypto/external/bsd/openssh/dist/log.h:1.7
--- src/crypto/external/bsd/openssh/dist/log.h:1.6	Fri Nov  8 19:18:25 2013
+++ src/crypto/external/bsd/openssh/dist/log.h	Tue Jan  7 02:13:39 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: log.h,v 1.6 2013/11/08 19:18:25 christos Exp $	*/
+/*	$NetBSD: log.h,v 1.7 2014/01/07 02:13:39 joerg Exp $	*/
 /* $OpenBSD: log.h,v 1.20 2013/04/07 02:10:33 dtucker Exp $ */
 
 /*
@@ -71,6 +71,7 @@ void debug3(const char *, ...) __att
 void	 set_log_handler(log_handler_fn *, void *);
 void	 do_log2(LogLevel, const char *, ...)
 __attribute__((format(printf, 2, 3)));
-void	 do_log(LogLevel, const char *, va_list);
+void	 do_log(LogLevel, const char *, va_list)
+__attribute__((format(printf, 2, 0)));
 void	 cleanup_exit(int) __attribute__((noreturn));
 #endif



CVS commit: src/external/bsd/nvi/dist/common

2014-01-06 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Jan  7 02:14:02 UTC 2014

Modified Files:
src/external/bsd/nvi/dist/common: common.h

Log Message:
Check format strings for ex_printf.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/nvi/dist/common/common.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/nvi/dist/common/common.h
diff -u src/external/bsd/nvi/dist/common/common.h:1.2 src/external/bsd/nvi/dist/common/common.h:1.3
--- src/external/bsd/nvi/dist/common/common.h:1.2	Fri Nov 22 15:52:05 2013
+++ src/external/bsd/nvi/dist/common/common.h	Tue Jan  7 02:14:02 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: common.h,v 1.2 2013/11/22 15:52:05 christos Exp $ */
+/*	$NetBSD: common.h,v 1.3 2014/01/07 02:14:02 joerg Exp $ */
 /*-
  * Copyright (c) 1991, 1993, 1994
  *	The Regents of the University of California.  All rights reserved.
@@ -57,6 +57,8 @@ typedef struct _tagq		TAGQ;
 typedef struct _text		TEXT;
 typedef struct _win		WIN;
 
+int ex_printf(SCR *, const char *, ...) __printflike(2, 3);
+
 /* Autoindent state. */
 typedef enum { C_NOTSET, C_CARATSET, C_ZEROSET } carat_t;
 



CVS commit: src/external/bsd/pkg_install/dist/lib

2014-01-06 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Jan  7 02:15:27 UTC 2014

Modified Files:
src/external/bsd/pkg_install/dist/lib: lib.h

Log Message:
xasprintf uses format strings.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/pkg_install/dist/lib/lib.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/pkg_install/dist/lib/lib.h
diff -u src/external/bsd/pkg_install/dist/lib/lib.h:1.6 src/external/bsd/pkg_install/dist/lib/lib.h:1.7
--- src/external/bsd/pkg_install/dist/lib/lib.h:1.6	Sat Jun 26 00:17:13 2010
+++ src/external/bsd/pkg_install/dist/lib/lib.h	Tue Jan  7 02:15:27 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: lib.h,v 1.6 2010/06/26 00:17:13 joerg Exp $ */
+/* $NetBSD: lib.h,v 1.7 2014/01/07 02:15:27 joerg Exp $ */
 
 /* from FreeBSD Id: lib.h,v 1.25 1997/10/08 07:48:03 charnier Exp */
 
@@ -421,7 +421,7 @@ char *xstrdup(const char *);
 void *xrealloc(void *, size_t);
 void *xcalloc(size_t, size_t);
 void *xmalloc(size_t);
-char *xasprintf(const char *, ...);
+char *xasprintf(const char *, ...) __printflike(1, 2);
 
 /* Externs */
 extern Boolean Verbose;



CVS commit: src/external/bsd/openpam/dist/lib

2014-01-06 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Jan  7 02:15:02 UTC 2014

Modified Files:
src/external/bsd/openpam/dist/lib: openpam_log.c

Log Message:
Ignore non-literal format strings, the modifications can't be expressed
with the current framework.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/openpam/dist/lib/openpam_log.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/openpam/dist/lib/openpam_log.c
diff -u src/external/bsd/openpam/dist/lib/openpam_log.c:1.5 src/external/bsd/openpam/dist/lib/openpam_log.c:1.6
--- src/external/bsd/openpam/dist/lib/openpam_log.c:1.5	Fri Dec 27 20:10:21 2013
+++ src/external/bsd/openpam/dist/lib/openpam_log.c	Tue Jan  7 02:15:02 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: openpam_log.c,v 1.5 2013/12/27 20:10:21 christos Exp $	*/
+/*	$NetBSD: openpam_log.c,v 1.6 2014/01/07 02:15:02 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2002-2003 Networks Associates Technology, Inc.
@@ -96,6 +96,7 @@ openpam_log(int level, const char *fmt, 
 
 #else
 
+#pragma GCC diagnostic ignored -Wformat-nonliteral
 void
 _openpam_log(int level, const char *func, const char *fmt, ...)
 {



CVS commit: src/share/mk

2014-01-06 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Jan  7 02:16:42 UTC 2014

Modified Files:
src/share/mk: bsd.sys.mk

Log Message:
Non-literal format strings should be an error by default for clang.


To generate a diff of this commit:
cvs rdiff -u -r1.231 -r1.232 src/share/mk/bsd.sys.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/mk/bsd.sys.mk
diff -u src/share/mk/bsd.sys.mk:1.231 src/share/mk/bsd.sys.mk:1.232
--- src/share/mk/bsd.sys.mk:1.231	Mon Dec 16 21:34:16 2013
+++ src/share/mk/bsd.sys.mk	Tue Jan  7 02:16:41 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.sys.mk,v 1.231 2013/12/16 21:34:16 matt Exp $
+#	$NetBSD: bsd.sys.mk,v 1.232 2014/01/07 02:16:41 joerg Exp $
 #
 # Build definitions used for NetBSD source tree builds.
 
@@ -68,7 +68,6 @@ CFLAGS+=	-Wold-style-definition
 CFLAGS+=	-Wconversion
 .endif
 CFLAGS+=	-Wsign-compare -Wformat=2
-CFLAGS+=	${${ACTIVE_CC} == clang:? -Wno-error=format-nonliteral :}
 CFLAGS+=	${${ACTIVE_CC} == gcc:? -Wno-format-zero-length :}
 .endif
 .if ${WARNS}  3  defined(HAVE_LLVM)



CVS commit: src/distrib/notes/common

2014-01-06 Thread Masatake Daimon
Module Name:src
Committed By:   pho
Date:   Tue Jan  7 04:46:02 UTC 2014

Modified Files:
src/distrib/notes/common: main

Log Message:
Add pho@ to NetBSD Developers.


To generate a diff of this commit:
cvs rdiff -u -r1.499 -r1.500 src/distrib/notes/common/main

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/notes/common/main
diff -u src/distrib/notes/common/main:1.499 src/distrib/notes/common/main:1.500
--- src/distrib/notes/common/main:1.499	Thu Jan  2 22:22:18 2014
+++ src/distrib/notes/common/main	Tue Jan  7 04:46:02 2014
@@ -1,4 +1,4 @@
-.\	$NetBSD: main,v 1.499 2014/01/02 22:22:18 tho Exp $
+.\	$NetBSD: main,v 1.500 2014/01/07 04:46:02 pho Exp $
 .\
 .\ Copyright (c) 1999-2012 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -1151,6 +1151,7 @@ If you're one of them, and would like to
 .It Ta Thomas Cort Ta Mt tc...@netbsd.org
 .It Ta Chuck Cranor Ta Mt ch...@netbsd.org
 .It Ta Alistair Crooks Ta Mt a...@netbsd.org
+.It Ta Masatake Daimon Ta Mt p...@netbsd.org
 .It Ta Johan Danielsson Ta Mt j...@netbsd.org
 .It Ta John Darrow Ta Mt jdar...@netbsd.org
 .It Ta Jed Davis Ta Mt j...@netbsd.org



CVS commit: xsrc/external/mit/libXfont/dist/src/bitmap

2014-01-06 Thread Thomas Klausner
Module Name:xsrc
Committed By:   wiz
Date:   Tue Jan  7 07:41:59 UTC 2014

Modified Files:
xsrc/external/mit/libXfont/dist/src/bitmap: bdfread.c

Log Message:
CVS-2013-6462:
From aeabb3efa6905e11c479e2e5319f2b6b3ab22009 Mon Sep 17 00:00:00 2001
From: Alan Coopersmith alan.coopersm...@oracle.com
Date: Mon, 23 Dec 2013 18:34:02 -0800
Subject: [PATCH:libXfont 1/2] CVE-2013-: unlimited sscanf can overflow
 stack buffer in bdfReadCharacters()

Fixes cppcheck warning:
 [lib/libXfont/src/bitmap/bdfread.c:341]: (warning)
  scanf without field width limits can crash with huge input data.

Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com
Reviewed-by: Matthieu Herrb matth...@herrb.eu
Reviewed-by: Jeremy Huddleston Sequoia jerem...@apple.com
---
 src/bitmap/bdfread.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.3 -r1.2 \
xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c
diff -u xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c:1.1.1.3 xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c:1.2
--- xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c:1.1.1.3	Fri May 31 01:08:57 2013
+++ xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c	Tue Jan  7 07:41:59 2014
@@ -338,7 +338,7 @@ bdfReadCharacters(FontFilePtr file, Font
 	charcharName[100];
 	int ignore;
 
-	if (sscanf((char *) line, STARTCHAR %s, charName) != 1) {
+	if (sscanf((char *) line, STARTCHAR %99s, charName) != 1) {
 	bdfError(bad character name in BDF file\n);
 	goto BAILOUT;	/* bottom of function, free and return error */
 	}



CVS commit: xsrc/xfree/xc/lib/font/bitmap

2014-01-06 Thread Thomas Klausner
Module Name:xsrc
Committed By:   wiz
Date:   Tue Jan  7 07:43:16 UTC 2014

Modified Files:
xsrc/xfree/xc/lib/font/bitmap: bdfread.c

Log Message:
CVE-2013-6462:
From aeabb3efa6905e11c479e2e5319f2b6b3ab22009 Mon Sep 17 00:00:00 2001
From: Alan Coopersmith alan.coopersm...@oracle.com
Date: Mon, 23 Dec 2013 18:34:02 -0800
Subject: [PATCH:libXfont 1/2] CVE-2013-: unlimited sscanf can overflow
 stack buffer in bdfReadCharacters()

Fixes cppcheck warning:
 [lib/libXfont/src/bitmap/bdfread.c:341]: (warning)
  scanf without field width limits can crash with huge input data.

Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com
Reviewed-by: Matthieu Herrb matth...@herrb.eu
Reviewed-by: Jeremy Huddleston Sequoia jerem...@apple.com
---
 src/bitmap/bdfread.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 xsrc/xfree/xc/lib/font/bitmap/bdfread.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: xsrc/xfree/xc/lib/font/bitmap/bdfread.c
diff -u xsrc/xfree/xc/lib/font/bitmap/bdfread.c:1.2 xsrc/xfree/xc/lib/font/bitmap/bdfread.c:1.3
--- xsrc/xfree/xc/lib/font/bitmap/bdfread.c:1.2	Tue Apr  3 20:10:34 2007
+++ xsrc/xfree/xc/lib/font/bitmap/bdfread.c	Tue Jan  7 07:43:16 2014
@@ -340,7 +340,7 @@ bdfReadCharacters(FontFilePtr file, Font
 	charcharName[100];
 	int ignore;
 
-	if (sscanf((char *) line, STARTCHAR %s, charName) != 1) {
+	if (sscanf((char *) line, STARTCHAR %99s, charName) != 1) {
 	bdfError(bad character name in BDF file\n);
 	goto BAILOUT;	/* bottom of function, free and return error */
 	}



CVS commit: xsrc/external/mit/libXfont/dist/src/bitmap

2014-01-06 Thread Thomas Klausner
Module Name:xsrc
Committed By:   wiz
Date:   Tue Jan  7 07:42:25 UTC 2014

Modified Files:
xsrc/external/mit/libXfont/dist/src/bitmap: bdfread.c

Log Message:
Additional hardening from upstream:

From f8b21df399fbedd08da88752181b8a290a38d890 Mon Sep 17 00:00:00 2001
From: Alan Coopersmith alan.coopersm...@oracle.com
Date: Mon, 23 Dec 2013 19:01:11 -0800
Subject: [PATCH:libXfont 2/2] Limit additional sscanf strings to fit buffer
 sizes

None of these could currently result in buffer overflow, as the input
and output buffers were the same size, but adding limits helps ensure
we keep it that way, if we ever resize any of these in the future.

Fixes cppcheck warnings:
 [lib/libXfont/src/bitmap/bdfread.c:547]: (warning)
  scanf without field width limits can crash with huge input data.
 [lib/libXfont/src/bitmap/bdfread.c:553]: (warning)
  scanf without field width limits can crash with huge input data.
 [lib/libXfont/src/bitmap/bdfread.c:636]: (warning)
  scanf without field width limits can crash with huge input data.

Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com
Reviewed-by: Matthieu Herrb matth...@herrb.eu
Reviewed-by: Jeremy Huddleston Sequoia jerem...@apple.com
---
 src/bitmap/bdfread.c |   14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c
diff -u xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c:1.2 xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c:1.3
--- xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c:1.2	Tue Jan  7 07:41:59 2014
+++ xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c	Tue Jan  7 07:42:25 2014
@@ -69,6 +69,7 @@ from The Open Group.
 #define INDICES 256
 #define MAXENCODING 0x
 #define BDFLINELEN  1024
+#define BDFLINESTR  %1023s /* scanf specifier to read a BDFLINELEN string */
 
 static Bool bdfPadToTerminal(FontPtr pFont);
 extern int  bdfFileLineNum;
@@ -544,13 +545,18 @@ bdfReadHeader(FontFilePtr file, bdfFileS
 unsigned charlineBuf[BDFLINELEN];
 
 line = bdfGetLine(file, lineBuf, BDFLINELEN);
-if (!line || sscanf((char *) line, STARTFONT %s, namebuf) != 1 ||
+if (!line ||
+sscanf((char *) line, STARTFONT  BDFLINESTR, namebuf) != 1 ||
 	!bdfStrEqual(namebuf, 2.1)) {
 	bdfError(bad 'STARTFONT'\n);
 	return (FALSE);
 }
 line = bdfGetLine(file, lineBuf, BDFLINELEN);
-if (!line || sscanf((char *) line, FONT %[^\n], pState-fontName) != 1) {
+#if MAXFONTNAMELEN != 1024
+# error need to adjust sscanf length limit to be MAXFONTNAMELEN - 1
+#endif
+if (!line ||
+sscanf((char *) line, FONT %1023[^\n], pState-fontName) != 1) {
 	bdfError(bad 'FONT'\n);
 	return (FALSE);
 }
@@ -633,7 +639,9 @@ bdfReadProperties(FontFilePtr file, Font
 	while (*line  isspace(*line))
 	line++;
 
-	switch (sscanf((char *) line, %s%s%s, namebuf, secondbuf, thirdbuf)) {
+	switch (sscanf((char *) line,
+   BDFLINESTR BDFLINESTR BDFLINESTR,
+   namebuf, secondbuf, thirdbuf)) {
 	default:
 	bdfError(missing '%s' parameter value\n, namebuf);
 	goto BAILOUT;



CVS commit: xsrc/xfree/xc/lib/font/bitmap

2014-01-06 Thread Thomas Klausner
Module Name:xsrc
Committed By:   wiz
Date:   Tue Jan  7 07:43:47 UTC 2014

Modified Files:
xsrc/xfree/xc/lib/font/bitmap: bdfread.c

Log Message:
Additional hardening after CVE-2013-6462:

From f8b21df399fbedd08da88752181b8a290a38d890 Mon Sep 17 00:00:00 2001
From: Alan Coopersmith alan.coopersm...@oracle.com
Date: Mon, 23 Dec 2013 19:01:11 -0800
Subject: [PATCH:libXfont 2/2] Limit additional sscanf strings to fit buffer
 sizes

None of these could currently result in buffer overflow, as the input
and output buffers were the same size, but adding limits helps ensure
we keep it that way, if we ever resize any of these in the future.

Fixes cppcheck warnings:
 [lib/libXfont/src/bitmap/bdfread.c:547]: (warning)
  scanf without field width limits can crash with huge input data.
 [lib/libXfont/src/bitmap/bdfread.c:553]: (warning)
  scanf without field width limits can crash with huge input data.
 [lib/libXfont/src/bitmap/bdfread.c:636]: (warning)
  scanf without field width limits can crash with huge input data.

Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com
Reviewed-by: Matthieu Herrb matth...@herrb.eu
Reviewed-by: Jeremy Huddleston Sequoia jerem...@apple.com
---
 src/bitmap/bdfread.c |   14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 xsrc/xfree/xc/lib/font/bitmap/bdfread.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: xsrc/xfree/xc/lib/font/bitmap/bdfread.c
diff -u xsrc/xfree/xc/lib/font/bitmap/bdfread.c:1.3 xsrc/xfree/xc/lib/font/bitmap/bdfread.c:1.4
--- xsrc/xfree/xc/lib/font/bitmap/bdfread.c:1.3	Tue Jan  7 07:43:16 2014
+++ xsrc/xfree/xc/lib/font/bitmap/bdfread.c	Tue Jan  7 07:43:47 2014
@@ -70,6 +70,7 @@ from The Open Group.
 #define INDICES 256
 #define MAXENCODING 0x
 #define BDFLINELEN  1024
+#define BDFLINESTR  %1023s /* scanf specifier to read a BDFLINELEN string */
 
 static Bool bdfPadToTerminal(FontPtr pFont);
 extern int  bdfFileLineNum;
@@ -549,13 +550,18 @@ bdfReadHeader(FontFilePtr file, bdfFileS
 unsigned charlineBuf[BDFLINELEN];
 
 line = bdfGetLine(file, lineBuf, BDFLINELEN);
-if (!line || sscanf((char *) line, STARTFONT %s, namebuf) != 1 ||
+if (!line ||
+sscanf((char *) line, STARTFONT  BDFLINESTR, namebuf) != 1 ||
 	!bdfStrEqual(namebuf, 2.1)) {
 	bdfError(bad 'STARTFONT'\n);
 	return (FALSE);
 }
 line = bdfGetLine(file, lineBuf, BDFLINELEN);
-if (!line || sscanf((char *) line, FONT %[^\n], pState-fontName) != 1) {
+#if MAXFONTNAMELEN != 1024
+# error need to adjust sscanf length limit to be MAXFONTNAMELEN - 1
+#endif
+if (!line ||
+sscanf((char *) line, FONT %1023[^\n], pState-fontName) != 1) {
 	bdfError(bad 'FONT'\n);
 	return (FALSE);
 }
@@ -639,7 +645,9 @@ bdfReadProperties(FontFilePtr file, Font
 	while (*line  isspace(*line))
 	line++;
 
-	switch (sscanf((char *) line, %s%s%s, namebuf, secondbuf, thirdbuf)) {
+	switch (sscanf((char *) line,
+   BDFLINESTR BDFLINESTR BDFLINESTR,
+   namebuf, secondbuf, thirdbuf)) {
 	default:
 	bdfError(missing '%s' parameter value\n, namebuf);
 	goto BAILOUT;



CVS commit: src/sys

2014-01-06 Thread David Laight
Module Name:src
Committed By:   dsl
Date:   Tue Jan  7 07:59:03 UTC 2014

Modified Files:
src/sys/kern: core_netbsd.c
src/sys/uvm: uvm_coredump.c

Log Message:
Re-instate the zero length sections in elf core dumps (they probably help
  describe the process memory layout).
Fudge the a.out core code to not dump the entire contents.
I'm not sue that anything can read a.out core files - more progress might
  be made on such dumps by converting the a.out file to elf!


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/kern/core_netbsd.c
cvs rdiff -u -r1.5 -r1.6 src/sys/uvm/uvm_coredump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/core_netbsd.c
diff -u src/sys/kern/core_netbsd.c:1.21 src/sys/kern/core_netbsd.c:1.22
--- src/sys/kern/core_netbsd.c:1.21	Fri Jan  3 21:12:18 2014
+++ src/sys/kern/core_netbsd.c	Tue Jan  7 07:59:03 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: core_netbsd.c,v 1.21 2014/01/03 21:12:18 dsl Exp $	*/
+/*	$NetBSD: core_netbsd.c,v 1.22 2014/01/07 07:59:03 dsl Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -45,7 +45,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: core_netbsd.c,v 1.21 2014/01/03 21:12:18 dsl Exp $);
+__KERNEL_RCSID(0, $NetBSD: core_netbsd.c,v 1.22 2014/01/07 07:59:03 dsl Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_coredump.h
@@ -133,7 +133,12 @@ CORENAME(coredump_writesegs_netbsd)(stru
 	 */
 	CORE_SETMAGIC(cseg, CORESEGMAGIC, CORE_GETMID(cs-core), flag);
 	cseg.c_addr = us-start;
-	cseg.c_size = us-end - us-start;
+
+	if (us-start == us-realend)
+		/* Not really wanted, but counted... */
+		cseg.c_size = 0;
+	else
+		cseg.c_size = us-end - us-start;
 
 	error = coredump_write(cs-iocookie, UIO_SYSSPACE,
 	cseg, cs-core.c_seghdrsize);

Index: src/sys/uvm/uvm_coredump.c
diff -u src/sys/uvm/uvm_coredump.c:1.5 src/sys/uvm/uvm_coredump.c:1.6
--- src/sys/uvm/uvm_coredump.c:1.5	Fri Jan  3 21:12:18 2014
+++ src/sys/uvm/uvm_coredump.c	Tue Jan  7 07:59:03 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_coredump.c,v 1.5 2014/01/03 21:12:18 dsl Exp $	*/
+/*	$NetBSD: uvm_coredump.c,v 1.6 2014/01/07 07:59:03 dsl Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -62,7 +62,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uvm_coredump.c,v 1.5 2014/01/03 21:12:18 dsl Exp $);
+__KERNEL_RCSID(0, $NetBSD: uvm_coredump.c,v 1.6 2014/01/07 07:59:03 dsl Exp $);
 
 /*
  * uvm_coredump.c: glue functions for coredump
@@ -186,10 +186,6 @@ uvm_coredump_walkmap(struct proc *p, int
 			}
 		}
 
-		/* Ignore empty sections */
-		if (state.start == state.realend)
-			continue;
-		
 		vm_map_unlock_read(map);
 		error = (*func)(state);
 		if (error)