CVS commit: src/share/man/man9

2009-05-27 Thread John Nemeth
Module Name:src
Committed By:   jnemeth
Date:   Thu May 28 06:49:30 UTC 2009

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

Log Message:
clarify vnode locking for vn_rdwr()


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/share/man/man9/vnsubr.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/vnsubr.9
diff -u src/share/man/man9/vnsubr.9:1.35 src/share/man/man9/vnsubr.9:1.36
--- src/share/man/man9/vnsubr.9:1.35	Wed May 27 23:01:27 2009
+++ src/share/man/man9/vnsubr.9	Thu May 28 06:49:30 2009
@@ -1,4 +1,4 @@
-.\" $NetBSD: vnsubr.9,v 1.35 2009/05/27 23:01:27 jnemeth Exp $
+.\" $NetBSD: vnsubr.9,v 1.36 2009/05/28 06:49:30 jnemeth Exp $
 .\"
 .\" Copyright (c) 2001, 2005, 2006 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd May 27, 2009
+.Dd May 28, 2009
 .Dt VNSUBR 9
 .Os
 .Sh NAME
@@ -193,13 +193,23 @@
 .Fa rw
 specifies whether the I/O is a read (UIO_READ) or write (UIO_WRITE)
 operation.
-The unlocked vnode is specified by
+The vnode is specified by
 .Fa vp .
 The arguments
 .Fa l
 and
 .Fa cred
 are the calling lwp and its credentials.
+If
+.Fa ioflg
+contains
+.Dq IO_NODELOCKED ,
+it is expected that the vnode is locked.
+.Fa ioflg
+will be passed to
+.Fn VOP_READ
+/
+.Fn VOP_WRITE .
 The remaining arguments specify the uio parameters.
 For further information on these parameters see
 .Xr uiomove 9 .



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

2009-05-27 Thread Alistair G. Crooks
Module Name:src
Committed By:   agc
Date:   Thu May 28 01:52:43 UTC 2009

Modified Files:
src/crypto/external/bsd/netpgp/dist: TODO
src/crypto/external/bsd/netpgp/dist/src/lib: compress.c crypto.c
keyring.c misc.c packet-parse.c packet-print.c reader.c signature.c
validate.c version.h

Log Message:
CHANGES 1.99.6 -> 1.99.7

+ added to the regression tests
+ get rid of some magic constants, replace with more obvious names
+ zero out the memory used for a passphrase before freeing it in one place


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/crypto/external/bsd/netpgp/dist/TODO
cvs rdiff -u -r1.9 -r1.10 \
src/crypto/external/bsd/netpgp/dist/src/lib/compress.c
cvs rdiff -u -r1.13 -r1.14 \
src/crypto/external/bsd/netpgp/dist/src/lib/crypto.c \
src/crypto/external/bsd/netpgp/dist/src/lib/keyring.c \
src/crypto/external/bsd/netpgp/dist/src/lib/misc.c \
src/crypto/external/bsd/netpgp/dist/src/lib/version.h
cvs rdiff -u -r1.16 -r1.17 \
src/crypto/external/bsd/netpgp/dist/src/lib/packet-parse.c \
src/crypto/external/bsd/netpgp/dist/src/lib/signature.c
cvs rdiff -u -r1.14 -r1.15 \
src/crypto/external/bsd/netpgp/dist/src/lib/packet-print.c
cvs rdiff -u -r1.15 -r1.16 \
src/crypto/external/bsd/netpgp/dist/src/lib/reader.c \
src/crypto/external/bsd/netpgp/dist/src/lib/validate.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/TODO
diff -u src/crypto/external/bsd/netpgp/dist/TODO:1.13 src/crypto/external/bsd/netpgp/dist/TODO:1.14
--- src/crypto/external/bsd/netpgp/dist/TODO:1.13	Wed May 27 00:38:26 2009
+++ src/crypto/external/bsd/netpgp/dist/TODO	Thu May 28 01:52:42 2009
@@ -1,6 +1,7 @@
 To Do
 =
 separate verify program
+separate key management program
 separate from libcrypto?
 64-bit offsets
 default compression when signing?

Index: src/crypto/external/bsd/netpgp/dist/src/lib/compress.c
diff -u src/crypto/external/bsd/netpgp/dist/src/lib/compress.c:1.9 src/crypto/external/bsd/netpgp/dist/src/lib/compress.c:1.10
--- src/crypto/external/bsd/netpgp/dist/src/lib/compress.c:1.9	Sat May 16 06:30:38 2009
+++ src/crypto/external/bsd/netpgp/dist/src/lib/compress.c	Thu May 28 01:52:43 2009
@@ -57,7 +57,7 @@
 
 #if defined(__NetBSD__)
 __COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: compress.c,v 1.9 2009/05/16 06:30:38 agc Exp $");
+__RCSID("$NetBSD: compress.c,v 1.10 2009/05/28 01:52:43 agc Exp $");
 #endif
 
 #ifdef HAVE_ZLIB_H
@@ -300,6 +300,7 @@
 {
 	z_decompress_t z;
 	bz_decompress_t bz;
+	const int	printerrors = 1;
 	int ret;
 
 	switch (type) {
@@ -394,7 +395,7 @@
 		return 0;
 	}
 
-	ret = __ops_parse(parse_info, 0);
+	ret = __ops_parse(parse_info, !printerrors);
 
 	__ops_reader_pop(parse_info);
 

Index: src/crypto/external/bsd/netpgp/dist/src/lib/crypto.c
diff -u src/crypto/external/bsd/netpgp/dist/src/lib/crypto.c:1.13 src/crypto/external/bsd/netpgp/dist/src/lib/crypto.c:1.14
--- src/crypto/external/bsd/netpgp/dist/src/lib/crypto.c:1.13	Mon May 25 06:43:32 2009
+++ src/crypto/external/bsd/netpgp/dist/src/lib/crypto.c	Thu May 28 01:52:43 2009
@@ -54,7 +54,7 @@
 
 #if defined(__NetBSD__)
 __COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: crypto.c,v 1.13 2009/05/25 06:43:32 agc Exp $");
+__RCSID("$NetBSD: crypto.c,v 1.14 2009/05/28 01:52:43 agc Exp $");
 #endif
 
 #include 
@@ -290,6 +290,7 @@
 			__ops_cbfunc_t *cb_get_passphrase)
 {
 	__ops_parseinfo_t	*parse = NULL;
+	const int		 printerrors = 1;
 	char			*filename = NULL;
 	int			 fd_in = 0;
 	int			 fd_out = 0;
@@ -353,7 +354,7 @@
 	}
 
 	/* Do it */
-	__ops_parse(parse, 1);
+	__ops_parse(parse, printerrors);
 
 	/* Unsetup */
 	if (use_armour) {
Index: src/crypto/external/bsd/netpgp/dist/src/lib/keyring.c
diff -u src/crypto/external/bsd/netpgp/dist/src/lib/keyring.c:1.13 src/crypto/external/bsd/netpgp/dist/src/lib/keyring.c:1.14
--- src/crypto/external/bsd/netpgp/dist/src/lib/keyring.c:1.13	Wed May 27 00:38:27 2009
+++ src/crypto/external/bsd/netpgp/dist/src/lib/keyring.c	Thu May 28 01:52:43 2009
@@ -57,7 +57,7 @@
 
 #if defined(__NetBSD__)
 __COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: keyring.c,v 1.13 2009/05/27 00:38:27 agc Exp $");
+__RCSID("$NetBSD: keyring.c,v 1.14 2009/05/28 01:52:43 agc Exp $");
 #endif
 
 #ifdef HAVE_FCNTL_H
@@ -218,7 +218,7 @@
 
 typedef struct {
 	const __ops_keydata_t	*key;
-	char			*pphrase;
+	char			*passphrase;
 	__ops_seckey_t		*seckey;
 } decrypt_t;
 
@@ -229,7 +229,6 @@
 	decrypt_t		*decrypt;
 
 	decrypt = __ops_parse_cb_get_arg(cbinfo);
-
 	switch (pkt->tag) {
 	case OPS_PARSER_PTAG:
 	case OPS_PTAG_CT_USER_ID:
@@ -240,7 +239,7 @@
 		break;
 
 	case OPS_GET_PASSPHRASE:
-		*content->skey_passphrase.p

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

2009-05-27 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Thu May 28 00:32:07 UTC 2009

Modified Files:
src/crypto/external/bsd/netpgp/dist: configure
src/crypto/external/bsd/netpgp/dist/tests: Makefile.in

Log Message:
regenerate


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/crypto/external/bsd/netpgp/dist/configure
cvs rdiff -u -r1.1 -r1.2 \
src/crypto/external/bsd/netpgp/dist/tests/Makefile.in

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/configure
diff -u src/crypto/external/bsd/netpgp/dist/configure:1.15 src/crypto/external/bsd/netpgp/dist/configure:1.16
--- src/crypto/external/bsd/netpgp/dist/configure:1.15	Wed May 27 00:38:26 2009
+++ src/crypto/external/bsd/netpgp/dist/configure	Thu May 28 00:32:07 2009
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.ac Revision: 1.14 .
+# From configure.ac Revision: 1.15 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.63 for netpgp 20090526.
 #

Index: src/crypto/external/bsd/netpgp/dist/tests/Makefile.in
diff -u src/crypto/external/bsd/netpgp/dist/tests/Makefile.in:1.1 src/crypto/external/bsd/netpgp/dist/tests/Makefile.in:1.2
--- src/crypto/external/bsd/netpgp/dist/tests/Makefile.in:1.1	Tue May 26 04:27:30 2009
+++ src/crypto/external/bsd/netpgp/dist/tests/Makefile.in	Thu May 28 00:32:07 2009
@@ -165,6 +165,9 @@
 
 TESTSUITE_DEPS = \
 	init.at \
+	cat.at \
+	crypt.at \
+	detached.at \
 	verify.at \
 	package.m4 \
 	testsuite.at



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

2009-05-27 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Thu May 28 00:29:06 UTC 2009

Modified Files:
src/crypto/external/bsd/netpgp/dist/tests: crypt.at detached.at
verify.at

Log Message:
wrap "copy the test file" in AT_CHECK


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/crypto/external/bsd/netpgp/dist/tests/crypt.at \
src/crypto/external/bsd/netpgp/dist/tests/detached.at
cvs rdiff -u -r1.5 -r1.6 src/crypto/external/bsd/netpgp/dist/tests/verify.at

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/tests/crypt.at
diff -u src/crypto/external/bsd/netpgp/dist/tests/crypt.at:1.2 src/crypto/external/bsd/netpgp/dist/tests/crypt.at:1.3
--- src/crypto/external/bsd/netpgp/dist/tests/crypt.at:1.2	Wed May 27 22:13:06 2009
+++ src/crypto/external/bsd/netpgp/dist/tests/crypt.at	Thu May 28 00:29:06 2009
@@ -1,8 +1,8 @@
-# $NetBSD: crypt.at,v 1.2 2009/05/27 22:13:06 agc Exp $
+# $NetBSD: crypt.at,v 1.3 2009/05/28 00:29:06 lukem Exp $
 
 AT_SETUP([encryption and decryption])
 
-cp ${TOPSRCDIR}/configure file1
+AT_CHECK([cp ${TOPSRCDIR}/configure file1], [0], [ignore], [ignore])
 
 # Sign the file
 # XXX: this prompts for a passphrase when the userid doesn't have one
Index: src/crypto/external/bsd/netpgp/dist/tests/detached.at
diff -u src/crypto/external/bsd/netpgp/dist/tests/detached.at:1.2 src/crypto/external/bsd/netpgp/dist/tests/detached.at:1.3
--- src/crypto/external/bsd/netpgp/dist/tests/detached.at:1.2	Wed May 27 22:13:06 2009
+++ src/crypto/external/bsd/netpgp/dist/tests/detached.at	Thu May 28 00:29:06 2009
@@ -1,8 +1,8 @@
-# $NetBSD: detached.at,v 1.2 2009/05/27 22:13:06 agc Exp $
+# $NetBSD: detached.at,v 1.3 2009/05/28 00:29:06 lukem Exp $
 
 AT_SETUP([detached signature and verification])
 
-cp ${TOPSRCDIR}/configure file2
+AT_CHECK([cp ${TOPSRCDIR}/configure file2], [0], [ignore], [ignore])
 
 # Detached signature
 AT_CHECK([$NETPGP --homedir $testhomedir --sign --detached file2],

Index: src/crypto/external/bsd/netpgp/dist/tests/verify.at
diff -u src/crypto/external/bsd/netpgp/dist/tests/verify.at:1.5 src/crypto/external/bsd/netpgp/dist/tests/verify.at:1.6
--- src/crypto/external/bsd/netpgp/dist/tests/verify.at:1.5	Wed May 27 22:13:06 2009
+++ src/crypto/external/bsd/netpgp/dist/tests/verify.at	Thu May 28 00:29:06 2009
@@ -1,8 +1,8 @@
-# $NetBSD: verify.at,v 1.5 2009/05/27 22:13:06 agc Exp $
+# $NetBSD: verify.at,v 1.6 2009/05/28 00:29:06 lukem Exp $
 
 AT_SETUP([simple signature and verification])
 
-cp ${TOPSRCDIR}/configure file1
+AT_CHECK([cp ${TOPSRCDIR}/configure file1], [0], [ignore], [ignore])
 
 # Sign the file
 # XXX: this prompts for a passphrase when the userid doesn't have one



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

2009-05-27 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Thu May 28 00:28:38 UTC 2009

Modified Files:
src/crypto/external/bsd/netpgp/dist/tests: cat.at

Log Message:
libtool is in the builddir not the srcdir.
wrap "copy the test file" in AT_CHECK


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/crypto/external/bsd/netpgp/dist/tests/cat.at

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/tests/cat.at
diff -u src/crypto/external/bsd/netpgp/dist/tests/cat.at:1.1 src/crypto/external/bsd/netpgp/dist/tests/cat.at:1.2
--- src/crypto/external/bsd/netpgp/dist/tests/cat.at:1.1	Wed May 27 22:13:06 2009
+++ src/crypto/external/bsd/netpgp/dist/tests/cat.at	Thu May 28 00:28:38 2009
@@ -1,8 +1,8 @@
-# $NetBSD: cat.at,v 1.1 2009/05/27 22:13:06 agc Exp $
+# $NetBSD: cat.at,v 1.2 2009/05/28 00:28:38 lukem Exp $
 
 AT_SETUP([attached signature and verification])
 
-cp ${TOPSRCDIR}/libtool file3
+AT_CHECK([cp $abs_top_builddir/libtool file3], [0], [ignore], [ignore])
 
 # Make signature
 AT_CHECK([$NETPGP --homedir $testhomedir --sign file3],



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

2009-05-27 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Thu May 28 00:27:39 UTC 2009

Modified Files:
src/crypto/external/bsd/netpgp/dist/tests: testsuite.at

Log Message:
sort main tests (arguable asthetic benefit)


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/crypto/external/bsd/netpgp/dist/tests/testsuite.at

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/tests/testsuite.at
diff -u src/crypto/external/bsd/netpgp/dist/tests/testsuite.at:1.4 src/crypto/external/bsd/netpgp/dist/tests/testsuite.at:1.5
--- src/crypto/external/bsd/netpgp/dist/tests/testsuite.at:1.4	Wed May 27 22:13:06 2009
+++ src/crypto/external/bsd/netpgp/dist/tests/testsuite.at	Thu May 28 00:27:39 2009
@@ -1,9 +1,10 @@
-# $NetBSD: testsuite.at,v 1.4 2009/05/27 22:13:06 agc Exp $
+# $NetBSD: testsuite.at,v 1.5 2009/05/28 00:27:39 lukem Exp $
 
 AT_INIT([netpgp])
 
 m4_include([init.at])
-m4_include([verify.at])
-m4_include([detached.at])
-m4_include([crypt.at])
+
 m4_include([cat.at])
+m4_include([crypt.at])
+m4_include([detached.at])
+m4_include([verify.at])



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

2009-05-27 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Thu May 28 00:27:03 UTC 2009

Modified Files:
src/crypto/external/bsd/netpgp/dist/tests: Makefile.am

Log Message:
add new tests to TESTSUITE_DEPS


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/crypto/external/bsd/netpgp/dist/tests/Makefile.am

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/tests/Makefile.am
diff -u src/crypto/external/bsd/netpgp/dist/tests/Makefile.am:1.2 src/crypto/external/bsd/netpgp/dist/tests/Makefile.am:1.3
--- src/crypto/external/bsd/netpgp/dist/tests/Makefile.am:1.2	Tue May 26 05:42:25 2009
+++ src/crypto/external/bsd/netpgp/dist/tests/Makefile.am	Thu May 28 00:27:03 2009
@@ -1,4 +1,4 @@
-## $NetBSD: Makefile.am,v 1.2 2009/05/26 05:42:25 lukem Exp $
+## $NetBSD: Makefile.am,v 1.3 2009/05/28 00:27:03 lukem Exp $
 
 TESTSUITE	= testsuite
 AUTOTEST	= $(AUTOM4TE) --language=autotest
@@ -9,6 +9,9 @@
 
 TESTSUITE_DEPS	= \
 	init.at \
+	cat.at \
+	crypt.at \
+	detached.at \
 	verify.at \
 	package.m4 \
 	testsuite.at



CVS commit: src/sys/rump

2009-05-27 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu May 28 00:02:17 UTC 2009

Modified Files:
src/sys/rump/librump/rumpnet: rump_net.c rump_net_private.h
src/sys/rump/net/lib/liblocal: Makefile
src/sys/rump/net/lib/libnet: Makefile
src/sys/rump/net/lib/libsockin: Makefile
src/sys/rump/net/lib/libvirtif: Makefile
Added Files:
src/sys/rump/net/lib/liblocal: component.c
src/sys/rump/net/lib/libnet: component.c
src/sys/rump/net/lib/libnetinet: component.c
src/sys/rump/net/lib/libsockin: component.c
src/sys/rump/net/lib/libvirtif: component.c

Log Message:
Use a bunch of weak symbols to determine which network components
are present.  This works in userspace as opposed relying in link
sets, which fail miserably.  Later, when the networking stack
becomes modularized, we can move to a dynamic scheme like with file
systems.

Also, this change allows us to do proper autoconfig, namely attach
the loopback interface iff it is present.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/rump/librump/rumpnet/rump_net.c
cvs rdiff -u -r1.2 -r1.3 src/sys/rump/librump/rumpnet/rump_net_private.h
cvs rdiff -u -r1.1 -r1.2 src/sys/rump/net/lib/liblocal/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/rump/net/lib/liblocal/component.c
cvs rdiff -u -r1.4 -r1.5 src/sys/rump/net/lib/libnet/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/rump/net/lib/libnet/component.c
cvs rdiff -u -r0 -r1.1 src/sys/rump/net/lib/libnetinet/component.c
cvs rdiff -u -r1.2 -r1.3 src/sys/rump/net/lib/libsockin/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/rump/net/lib/libsockin/component.c
cvs rdiff -u -r1.2 -r1.3 src/sys/rump/net/lib/libvirtif/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/rump/net/lib/libvirtif/component.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/rump/librump/rumpnet/rump_net.c
diff -u src/sys/rump/librump/rumpnet/rump_net.c:1.7 src/sys/rump/librump/rumpnet/rump_net.c:1.8
--- src/sys/rump/librump/rumpnet/rump_net.c:1.7	Wed Mar 18 10:22:45 2009
+++ src/sys/rump/librump/rumpnet/rump_net.c	Thu May 28 00:02:16 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump_net.c,v 1.7 2009/03/18 10:22:45 cegger Exp $	*/
+/*	$NetBSD: rump_net.c,v 1.8 2009/05/28 00:02:16 pooka Exp $	*/
 
 /*
  * Copyright (c) 2008 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rump_net.c,v 1.7 2009/03/18 10:22:45 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump_net.c,v 1.8 2009/05/28 00:02:16 pooka Exp $");
 
 #include 
 
@@ -35,17 +35,38 @@
 #include 
 
 #include 
+#include 
 
 #include "rump_net_private.h"
 
+void nocomponent(void);
+void nocomponent() {}
+__weak_alias(rump_net_net_init,nocomponent);
+__weak_alias(rump_net_inet_init,nocomponent);
+__weak_alias(rump_net_local_init,nocomponent);
+__weak_alias(rump_net_sockin_init,nocomponent);
+__weak_alias(rump_net_virtif_init,nocomponent);
+
 void
 rump_net_init(void)
 {
 
 	mbinit();
-	domaininit();
-	rn_init();
+
+	domaininit(false);
+	/*
+	 * Add rest of the domains we failed to add in domaininit()
+	 * due to linkset lossage.
+	 */
+	rump_net_inet_init();
+	rump_net_local_init();
+	rump_net_sockin_init();
+	rump_net_virtif_init();
+	/* Note: should be last due to calling of rn_init() */
+	rump_net_net_init();
+
 	soinit();
 	soinit2();
+
 	rump_netisr_init();
 }

Index: src/sys/rump/librump/rumpnet/rump_net_private.h
diff -u src/sys/rump/librump/rumpnet/rump_net_private.h:1.2 src/sys/rump/librump/rumpnet/rump_net_private.h:1.3
--- src/sys/rump/librump/rumpnet/rump_net_private.h:1.2	Wed May 27 23:41:20 2009
+++ src/sys/rump/librump/rumpnet/rump_net_private.h	Thu May 28 00:02:16 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump_net_private.h,v 1.2 2009/05/27 23:41:20 pooka Exp $	*/
+/*	$NetBSD: rump_net_private.h,v 1.3 2009/05/28 00:02:16 pooka Exp $	*/
 
 /*
  * Copyright (c) 2008 Antti Kantee.  All Rights Reserved.
@@ -31,6 +31,19 @@
 void		rump_net_init(void);
 void		rump_netisr_init(void);
 
+#define DOMAINADD(dom)			\
+do {	\
+	if (!pffinddomain(dom.dom_family)) {\
+		domain_attach(&dom);	\
+}\
+} while (/*CONSTCOND*/0)
+
+void 		rump_net_net_init(void);
+void 		rump_net_inet_init(void);
+void 		rump_net_local_init(void);
+void 		rump_net_sockin_init(void);
+void 		rump_net_virtif_init(void);
+
 void		rump_dummyif_create(void);
 
 #endif /* _SYS_RUMP_NET_PRIVATE_H_ */

Index: src/sys/rump/net/lib/liblocal/Makefile
diff -u src/sys/rump/net/lib/liblocal/Makefile:1.1 src/sys/rump/net/lib/liblocal/Makefile:1.2
--- src/sys/rump/net/lib/liblocal/Makefile:1.1	Sun Feb  8 16:28:35 2009
+++ src/sys/rump/net/lib/liblocal/Makefile	Thu May 28 00:02:16 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1 2009/02/08 16:28:35 pooka Exp $
+#	$NetBSD: Makefile,v 1.2 2009/05/28 00:02:16 pooka Exp $
 #
 
 .PATH:	${.CURDIR}/../../../../kern
@@ -6,6 +6,7 @@
 LIB=	rumpnet_local
 
 SRCS=	uipc_

CVS commit: src/sys

2009-05-27 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed May 27 23:44:36 UTC 2009

Modified Files:
src/sys/kern: init_main.c uipc_domain.c
src/sys/sys: domain.h

Log Message:
Make domaininit() take an argument which determines if it should
add the special PF_ROUTE domain or not (if available).


To generate a diff of this commit:
cvs rdiff -u -r1.389 -r1.390 src/sys/kern/init_main.c
cvs rdiff -u -r1.81 -r1.82 src/sys/kern/uipc_domain.c
cvs rdiff -u -r1.27 -r1.28 src/sys/sys/domain.h

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/init_main.c
diff -u src/sys/kern/init_main.c:1.389 src/sys/kern/init_main.c:1.390
--- src/sys/kern/init_main.c:1.389	Sun Apr 19 14:04:51 2009
+++ src/sys/kern/init_main.c	Wed May 27 23:44:36 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: init_main.c,v 1.389 2009/04/19 14:04:51 ad Exp $	*/
+/*	$NetBSD: init_main.c,v 1.390 2009/05/27 23:44:36 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.389 2009/04/19 14:04:51 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.390 2009/05/27 23:44:36 pooka Exp $");
 
 #include "opt_ddb.h"
 #include "opt_ipsec.h"
@@ -518,7 +518,7 @@
 	 */
 	s = splnet();
 	ifinit();
-	domaininit();
+	domaininit(true);
 	if_attachdomain();
 	splx(s);
 

Index: src/sys/kern/uipc_domain.c
diff -u src/sys/kern/uipc_domain.c:1.81 src/sys/kern/uipc_domain.c:1.82
--- src/sys/kern/uipc_domain.c:1.81	Tue Apr 28 20:56:40 2009
+++ src/sys/kern/uipc_domain.c	Wed May 27 23:44:36 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_domain.c,v 1.81 2009/04/28 20:56:40 dyoung Exp $	*/
+/*	$NetBSD: uipc_domain.c,v 1.82 2009/05/27 23:44:36 pooka Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uipc_domain.c,v 1.81 2009/04/28 20:56:40 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_domain.c,v 1.82 2009/05/27 23:44:36 pooka Exp $");
 
 #include 
 #include 
@@ -77,7 +77,7 @@
 static void sysctl_net_setup(void);
 
 void
-domaininit(void)
+domaininit(bool addroute)
 {
 	__link_set_decl(domains, struct domain);
 	struct domain * const * dpp;
@@ -95,7 +95,7 @@
 		else
 			domain_attach(*dpp);
 	}
-	if (rt_domain)
+	if (rt_domain && addroute)
 		domain_attach(rt_domain);
 
 	callout_init(&pffasttimo_ch, CALLOUT_MPSAFE);

Index: src/sys/sys/domain.h
diff -u src/sys/sys/domain.h:1.27 src/sys/sys/domain.h:1.28
--- src/sys/sys/domain.h:1.27	Wed Sep 19 04:33:45 2007
+++ src/sys/sys/domain.h	Wed May 27 23:44:35 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: domain.h,v 1.27 2007/09/19 04:33:45 dyoung Exp $	*/
+/*	$NetBSD: domain.h,v 1.28 2009/05/27 23:44:35 pooka Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -94,7 +94,7 @@
 #define	DOMAIN_FOREACH(dom)	STAILQ_FOREACH(dom, &domains, dom_link)
 extern struct domainhead domains;
 void domain_attach(struct domain *);
-void domaininit(void);
+void domaininit(bool);
 #endif
 
 #endif /* !_SYS_DOMAIN_H_ */



CVS commit: src/sys/rump

2009-05-27 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed May 27 23:41:20 UTC 2009

Modified Files:
src/sys/rump/librump/rumpnet: rump_net_private.h
src/sys/rump/net/lib: Makefile.inc
src/sys/rump/net/lib/libvirtif: if_virt.c

Log Message:
Add a dummyif, which doesn't actually traffic any cargo, but since
it has no backend it can always be attached and is therefore
convenient for testing ifconfig.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/rump/librump/rumpnet/rump_net_private.h
cvs rdiff -u -r1.2 -r1.3 src/sys/rump/net/lib/Makefile.inc
cvs rdiff -u -r1.9 -r1.10 src/sys/rump/net/lib/libvirtif/if_virt.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/rump/librump/rumpnet/rump_net_private.h
diff -u src/sys/rump/librump/rumpnet/rump_net_private.h:1.1 src/sys/rump/librump/rumpnet/rump_net_private.h:1.2
--- src/sys/rump/librump/rumpnet/rump_net_private.h:1.1	Wed Oct 15 13:00:40 2008
+++ src/sys/rump/librump/rumpnet/rump_net_private.h	Wed May 27 23:41:20 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump_net_private.h,v 1.1 2008/10/15 13:00:40 pooka Exp $	*/
+/*	$NetBSD: rump_net_private.h,v 1.2 2009/05/27 23:41:20 pooka Exp $	*/
 
 /*
  * Copyright (c) 2008 Antti Kantee.  All Rights Reserved.
@@ -31,4 +31,6 @@
 void		rump_net_init(void);
 void		rump_netisr_init(void);
 
+void		rump_dummyif_create(void);
+
 #endif /* _SYS_RUMP_NET_PRIVATE_H_ */

Index: src/sys/rump/net/lib/Makefile.inc
diff -u src/sys/rump/net/lib/Makefile.inc:1.2 src/sys/rump/net/lib/Makefile.inc:1.3
--- src/sys/rump/net/lib/Makefile.inc:1.2	Thu Jan  1 19:43:58 2009
+++ src/sys/rump/net/lib/Makefile.inc	Wed May 27 23:41:20 2009
@@ -1,7 +1,7 @@
-#	$NetBSD: Makefile.inc,v 1.2 2009/01/01 19:43:58 pooka Exp $
+#	$NetBSD: Makefile.inc,v 1.3 2009/05/27 23:41:20 pooka Exp $
 #
 
 RUMPTOP=	${.CURDIR}/../../..
-CPPFLAGS+=	-I${RUMPTOP}/librump/rumpnet/opt
+CPPFLAGS+=	-I${RUMPTOP}/librump/rumpnet -I${RUMPTOP}/librump/rumpnet/opt
 
 .include "${RUMPTOP}/Makefile.rump"

Index: src/sys/rump/net/lib/libvirtif/if_virt.c
diff -u src/sys/rump/net/lib/libvirtif/if_virt.c:1.9 src/sys/rump/net/lib/libvirtif/if_virt.c:1.10
--- src/sys/rump/net/lib/libvirtif/if_virt.c:1.9	Tue May 26 19:03:05 2009
+++ src/sys/rump/net/lib/libvirtif/if_virt.c	Wed May 27 23:41:20 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_virt.c,v 1.9 2009/05/26 19:03:05 pooka Exp $	*/
+/*	$NetBSD: if_virt.c,v 1.10 2009/05/27 23:41:20 pooka Exp $	*/
 
 /*
  * Copyright (c) 2008 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 1.9 2009/05/26 19:03:05 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 1.10 2009/05/27 23:41:20 pooka Exp $");
 
 #include 
 #include 
@@ -48,6 +48,7 @@
 #include 
 
 #include "rump_private.h"
+#include "rump_net_private.h"
 
 /*
  * Virtual interface for userspace purposes.  Uses tap(4) to
@@ -253,3 +254,49 @@
 
 	mutex_exit(softnet_lock);
 }
+
+/*
+ * dummyif is a nada-interface.
+ * As it requires nothing external, it can be used for testing
+ * interface configuration.
+ */
+static int	dummyif_init(struct ifnet *);
+static void	dummyif_start(struct ifnet *);
+
+void
+rump_dummyif_create()
+{
+	struct ifnet *ifp;
+	struct ethercom *ec;
+	uint8_t enaddr[ETHER_ADDR_LEN] = { 0xb2, 0x0a, 0x00, 0x0b, 0x0e, 0x01 };
+
+	enaddr[2] = arc4random() & 0xff;
+	enaddr[5] = arc4random() & 0xff;
+
+	ec = kmem_zalloc(sizeof(*ec), KM_SLEEP);
+
+	ifp = &ec->ec_if;
+	strlcpy(ifp->if_xname, "dummy0", sizeof(ifp->if_xname));
+	ifp->if_softc = ifp;
+	ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
+	ifp->if_init = dummyif_init;
+	ifp->if_ioctl = virtif_ioctl;
+	ifp->if_start = dummyif_start;
+
+	if_attach(ifp);
+	ether_ifattach(ifp, enaddr);
+}
+
+static int
+dummyif_init(struct ifnet *ifp)
+{
+
+	ifp->if_flags |= IFF_RUNNING;
+	return 0;
+}
+
+static void
+dummyif_start(struct ifnet *ifp)
+{
+
+}



CVS commit: src/share/man/man9

2009-05-27 Thread John Nemeth
Module Name:src
Committed By:   jnemeth
Date:   Wed May 27 23:01:27 UTC 2009

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

Log Message:
correct vn_stat definition and description


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/share/man/man9/vnsubr.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/vnsubr.9
diff -u src/share/man/man9/vnsubr.9:1.34 src/share/man/man9/vnsubr.9:1.35
--- src/share/man/man9/vnsubr.9:1.34	Wed Apr 30 13:10:59 2008
+++ src/share/man/man9/vnsubr.9	Wed May 27 23:01:27 2009
@@ -1,4 +1,4 @@
-.\" $NetBSD: vnsubr.9,v 1.34 2008/04/30 13:10:59 martin Exp $
+.\" $NetBSD: vnsubr.9,v 1.35 2009/05/27 23:01:27 jnemeth Exp $
 .\"
 .\" Copyright (c) 2001, 2005, 2006 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd April 9, 2008
+.Dd May 27, 2009
 .Dt VNSUBR 9
 .Os
 .Sh NAME
@@ -79,7 +79,7 @@
 .Ft int
 .Fn vn_readdir "file_t *fp" "char *buf" "int segflg" "u_int count" "int *done" "struct lwp *l" "off_t **cookies" "int *ncookies"
 .Ft int
-.Fn vn_stat "struct vnode *vp" "struct stat *sb" "struct lwp *l"
+.Fn vn_stat "struct vnode *vp" "struct stat *sb"
 .Ft int
 .Fn vn_writechk "struct vnode *vp"
 .Sh DESCRIPTION
@@ -224,16 +224,13 @@
 .Fn vn_readdir .
 If the operation is successful zero is returned, otherwise an
 appropriate error code is returned.
-.It Fn vn_stat "vp" "sb" "l"
+.It Fn vn_stat "vp" "sb"
 Common code for a vnode stat operation.
 The vnode is specified by the argument
 .Fa vp ,
 and
 .Fa sb
 is the buffer to return the stat information.
-The argument
-.Fa l
-is the calling lwp.
 .Fn vn_stat
 basically calls the vnode operation
 .Xr VOP_GETATTR 9



CVS commit: src/sys/dev/ic

2009-05-27 Thread Robert Swindells
Module Name:src
Committed By:   rjs
Date:   Wed May 27 23:01:08 UTC 2009

Modified Files:
src/sys/dev/ic: comvar.h

Log Message:
Put back CVS header.


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/dev/ic/comvar.h

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

Modified files:

Index: src/sys/dev/ic/comvar.h
diff -u src/sys/dev/ic/comvar.h:1.65 src/sys/dev/ic/comvar.h:1.66
--- src/sys/dev/ic/comvar.h:1.65	Tue May 12 14:25:17 2009
+++ src/sys/dev/ic/comvar.h	Wed May 27 23:01:07 2009
@@ -1,4 +1,4 @@
-/*	comvar.h,v 1.55.8.3 2008/01/09 01:52:50 matt Exp	*/
+/*	$NetBSD: comvar.h,v 1.66 2009/05/27 23:01:07 rjs Exp $	*/
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.



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

2009-05-27 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed May 27 22:41:39 UTC 2009

Update of /cvsroot/src/external/bsd/pkg_install/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv12076

Log Message:
Import pkg_install-200927:
- pkg_info -r provides topological sorting
- sync license list with pkgsrc/mk/licenses.mk

Status:

Vendor Tag: PKGSRC
Release Tags:   pkg_install-20090527

U src/external/bsd/pkg_install/dist/add/add.h
U src/external/bsd/pkg_install/dist/add/main.c
U src/external/bsd/pkg_install/dist/add/perform.c
U src/external/bsd/pkg_install/dist/add/pkg_add.1
U src/external/bsd/pkg_install/dist/admin/README
U src/external/bsd/pkg_install/dist/admin/admin.h
U src/external/bsd/pkg_install/dist/admin/audit-packages.sh.in
U src/external/bsd/pkg_install/dist/admin/audit.c
U src/external/bsd/pkg_install/dist/admin/check.c
U src/external/bsd/pkg_install/dist/admin/download-vulnerability-list.sh.in
U src/external/bsd/pkg_install/dist/admin/main.c
U src/external/bsd/pkg_install/dist/admin/pkg_admin.1
U src/external/bsd/pkg_install/dist/bpm/bpm.1
U src/external/bsd/pkg_install/dist/bpm/bpm.sh.in
U src/external/bsd/pkg_install/dist/create/build.c
U src/external/bsd/pkg_install/dist/create/create.h
U src/external/bsd/pkg_install/dist/create/main.c
U src/external/bsd/pkg_install/dist/create/perform.c
U src/external/bsd/pkg_install/dist/create/pkg_create.1
U src/external/bsd/pkg_install/dist/create/pl.c
U src/external/bsd/pkg_install/dist/create/util.c
U src/external/bsd/pkg_install/dist/delete/pkg_delete.1
U src/external/bsd/pkg_install/dist/delete/pkg_delete.c
U src/external/bsd/pkg_install/dist/info/info.h
U src/external/bsd/pkg_install/dist/info/main.c
U src/external/bsd/pkg_install/dist/info/perform.c
U src/external/bsd/pkg_install/dist/info/pkg_info.1
U src/external/bsd/pkg_install/dist/info/show.c
U src/external/bsd/pkg_install/dist/lib/automatic.c
U src/external/bsd/pkg_install/dist/lib/config.h.in
U src/external/bsd/pkg_install/dist/lib/conflicts.c
U src/external/bsd/pkg_install/dist/lib/decompress.c
U src/external/bsd/pkg_install/dist/lib/defs.h
U src/external/bsd/pkg_install/dist/lib/dewey.c
U src/external/bsd/pkg_install/dist/lib/dewey.h
U src/external/bsd/pkg_install/dist/lib/fexec.c
U src/external/bsd/pkg_install/dist/lib/file.c
U src/external/bsd/pkg_install/dist/lib/global.c
U src/external/bsd/pkg_install/dist/lib/gpgsig.c
U src/external/bsd/pkg_install/dist/lib/iterate.c
U src/external/bsd/pkg_install/dist/lib/lib.h
U src/external/bsd/pkg_install/dist/lib/lpkg.c
U src/external/bsd/pkg_install/dist/lib/opattern.c
U src/external/bsd/pkg_install/dist/lib/parse-config.c
U src/external/bsd/pkg_install/dist/lib/pkcs7.c
U src/external/bsd/pkg_install/dist/lib/pkg_install.conf.5.in
U src/external/bsd/pkg_install/dist/lib/pkg_io.c
U src/external/bsd/pkg_install/dist/lib/pkg_signature.c
U src/external/bsd/pkg_install/dist/lib/pkg_summary.5
U src/external/bsd/pkg_install/dist/lib/pkgdb.c
U src/external/bsd/pkg_install/dist/lib/pkgsrc.7
U src/external/bsd/pkg_install/dist/lib/plist.c
U src/external/bsd/pkg_install/dist/lib/remove.c
U src/external/bsd/pkg_install/dist/lib/str.c
U src/external/bsd/pkg_install/dist/lib/var.c
U src/external/bsd/pkg_install/dist/lib/version.c
U src/external/bsd/pkg_install/dist/lib/version.h
U src/external/bsd/pkg_install/dist/lib/vulnerabilities-file.c
U src/external/bsd/pkg_install/dist/lib/xwrapper.c
U src/external/bsd/pkg_install/dist/lib/license.c
U src/external/bsd/pkg_install/dist/x509/pkgsrc.cnf
U src/external/bsd/pkg_install/dist/x509/pkgsrc.sh
U src/external/bsd/pkg_install/dist/x509/signing.txt

No conflicts created by this import



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

2009-05-27 Thread Alistair G. Crooks
Module Name:src
Committed By:   agc
Date:   Wed May 27 22:13:06 UTC 2009

Modified Files:
src/crypto/external/bsd/netpgp/dist/tests: crypt.at detached.at
testsuite.at verify.at
Added Files:
src/crypto/external/bsd/netpgp/dist/tests: cat.at

Log Message:
More tests for netpgp


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/crypto/external/bsd/netpgp/dist/tests/cat.at
cvs rdiff -u -r1.1 -r1.2 src/crypto/external/bsd/netpgp/dist/tests/crypt.at \
src/crypto/external/bsd/netpgp/dist/tests/detached.at
cvs rdiff -u -r1.3 -r1.4 \
src/crypto/external/bsd/netpgp/dist/tests/testsuite.at
cvs rdiff -u -r1.4 -r1.5 src/crypto/external/bsd/netpgp/dist/tests/verify.at

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/tests/crypt.at
diff -u src/crypto/external/bsd/netpgp/dist/tests/crypt.at:1.1 src/crypto/external/bsd/netpgp/dist/tests/crypt.at:1.2
--- src/crypto/external/bsd/netpgp/dist/tests/crypt.at:1.1	Wed May 27 14:42:07 2009
+++ src/crypto/external/bsd/netpgp/dist/tests/crypt.at	Wed May 27 22:13:06 2009
@@ -1,4 +1,4 @@
-# $NetBSD: crypt.at,v 1.1 2009/05/27 14:42:07 agc Exp $
+# $NetBSD: crypt.at,v 1.2 2009/05/27 22:13:06 agc Exp $
 
 AT_SETUP([encryption and decryption])
 
@@ -9,19 +9,20 @@
 AT_CHECK([$NETPGP --homedir $testhomedir --encrypt file1],
 [0], [ignore], [ignore])
 
-# Verify the signed file
+# Decrypt the encrypted file
 AT_CHECK([$NETPGP --homedir $testhomedir --decrypt file1.gpg],
 [0], [ignore], [ignore])
 
-# Fail to verify an unsigned file
-# XXX: determine how to expand $testuserid instead of hard-coding
-#AT_CHECK([$NETPGP --homedir $testhomedir --decrypt file1],
-#[1], [ignore],
+# Decrypt and send to a different file
+AT_CHECK([$NETPGP --homedir $testhomedir --decrypt --output=file1.copy file1.gpg],
+[0], [ignore], [ignore], [ignore], [diff file1.copy file1])
+
+# deliberately corrupt file1.gpg and attempt to decrypt
+#sed -e 's|1|2|' file1.gpg > file2.gpg
+#AT_CHECK([$NETPGP --homedir $testhomedir --decrypt file2.gpg],
+#[0], [ignore],
 #[netpgp: default key set to "C7AB5F325F918728"
-#"file1": No signatures found - is this an encrypted file?
+#/usr/src/crypto/external/bsd/netpgp-hack/lib/../dist/src/lib/reader.c:1614: Unknown, Bad hash in MDC packet
 #])
 
-# XXXTODO: deliberately corrupt file1.gpg and attempt to verify
-
-
 AT_CLEANUP
Index: src/crypto/external/bsd/netpgp/dist/tests/detached.at
diff -u src/crypto/external/bsd/netpgp/dist/tests/detached.at:1.1 src/crypto/external/bsd/netpgp/dist/tests/detached.at:1.2
--- src/crypto/external/bsd/netpgp/dist/tests/detached.at:1.1	Wed May 27 14:42:07 2009
+++ src/crypto/external/bsd/netpgp/dist/tests/detached.at	Wed May 27 22:13:06 2009
@@ -1,4 +1,4 @@
-# $NetBSD: detached.at,v 1.1 2009/05/27 14:42:07 agc Exp $
+# $NetBSD: detached.at,v 1.2 2009/05/27 22:13:06 agc Exp $
 
 AT_SETUP([detached signature and verification])
 
@@ -12,6 +12,4 @@
 AT_CHECK([$NETPGP --homedir $testhomedir --verify file2.sig],
 [0], [ignore], [ignore])
 
-# XXXTODO: deliberately corrupt file2.gpg and attempt to verify
-
 AT_CLEANUP

Index: src/crypto/external/bsd/netpgp/dist/tests/testsuite.at
diff -u src/crypto/external/bsd/netpgp/dist/tests/testsuite.at:1.3 src/crypto/external/bsd/netpgp/dist/tests/testsuite.at:1.4
--- src/crypto/external/bsd/netpgp/dist/tests/testsuite.at:1.3	Wed May 27 14:42:07 2009
+++ src/crypto/external/bsd/netpgp/dist/tests/testsuite.at	Wed May 27 22:13:06 2009
@@ -1,4 +1,4 @@
-# $NetBSD: testsuite.at,v 1.3 2009/05/27 14:42:07 agc Exp $
+# $NetBSD: testsuite.at,v 1.4 2009/05/27 22:13:06 agc Exp $
 
 AT_INIT([netpgp])
 
@@ -6,3 +6,4 @@
 m4_include([verify.at])
 m4_include([detached.at])
 m4_include([crypt.at])
+m4_include([cat.at])

Index: src/crypto/external/bsd/netpgp/dist/tests/verify.at
diff -u src/crypto/external/bsd/netpgp/dist/tests/verify.at:1.4 src/crypto/external/bsd/netpgp/dist/tests/verify.at:1.5
--- src/crypto/external/bsd/netpgp/dist/tests/verify.at:1.4	Wed May 27 14:42:07 2009
+++ src/crypto/external/bsd/netpgp/dist/tests/verify.at	Wed May 27 22:13:06 2009
@@ -1,6 +1,6 @@
-# $NetBSD: verify.at,v 1.4 2009/05/27 14:42:07 agc Exp $
+# $NetBSD: verify.at,v 1.5 2009/05/27 22:13:06 agc Exp $
 
-AT_SETUP([check signatures and verification])
+AT_SETUP([simple signature and verification])
 
 cp ${TOPSRCDIR}/configure file1
 
@@ -13,10 +13,6 @@
 AT_CHECK([$NETPGP --homedir $testhomedir --verify file1.gpg],
 [0], [ignore], [ignore])
 
-# Cat the verified file
-AT_CHECK([$NETPGP --homedir $testhomedir --cat --output=file2 file1.gpg],
-[0], [ignore], [ignore])
-
 # Fail to verify an unsigned file
 # XXX: determine how to expand $testuserid instead of hard-coding
 AT_CHECK([$NETPGP --homedir $testhomedir --verify file1],
@@ -25,4 +21,12 @@
 "file1": No signatures found - is this a signed file?
 ])
 
+# XXXTODO: deliberately corrupt fi

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

2009-05-27 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed May 27 21:46:08 UTC 2009

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

Log Message:
Tickets 779 and 781.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.14 -r1.1.2.15 src/doc/CHANGES-5.0.1

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.0.1
diff -u src/doc/CHANGES-5.0.1:1.1.2.14 src/doc/CHANGES-5.0.1:1.1.2.15
--- src/doc/CHANGES-5.0.1:1.1.2.14	Tue May 26 19:19:08 2009
+++ src/doc/CHANGES-5.0.1	Wed May 27 21:46:08 2009
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.0.1,v 1.1.2.14 2009/05/26 19:19:08 snj Exp $
+# $NetBSD: CHANGES-5.0.1,v 1.1.2.15 2009/05/27 21:46:08 snj Exp $
 
 A complete list of changes from the NetBSD 5.0 release to the NetBSD 5.0.1
 release:
@@ -146,3 +146,18 @@
 	Fixes PR 41302.
 	[martin, ticket #774]
 
+sys/kern/sys_mqueue.c1.18
+
+	- Slightly rework the way permissions are checked. Neither
+	mq_receive() nor mq_send() should fail due to permissions.
+	- Check for empty message queue name (POSIX does not allow this
+	for regular files, and it's weird), check for DTYPE_MQUEUE, fix
+	permission check in mq_unlink(), clean up.
+	[rmind, ticket #779]
+
+sys/kern/kern_physio.c1.91
+
+	Remove a race where physio_done() may use memory already
+	freed.  Fixes PR kern/39536.
+	[hannken, ticket #781]
+



CVS commit: [netbsd-5-0] src/sys/kern

2009-05-27 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed May 27 21:45:21 UTC 2009

Modified Files:
src/sys/kern [netbsd-5-0]: kern_physio.c

Log Message:
Pull up following revision(s) (requested by hannken in ticket #781):
sys/kern/kern_physio.c: revision 1.91
PR kern/39536: bufq related problem when writing DVDR and DVDRWs.
Remove a race where physio_done() may use memory already freed.
Observed by Hans Rosenfeld .


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.88.6.1 src/sys/kern/kern_physio.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/kern_physio.c
diff -u src/sys/kern/kern_physio.c:1.88 src/sys/kern/kern_physio.c:1.88.6.1
--- src/sys/kern/kern_physio.c:1.88	Wed Sep 24 08:19:19 2008
+++ src/sys/kern/kern_physio.c	Wed May 27 21:45:21 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_physio.c,v 1.88 2008/09/24 08:19:19 hannken Exp $	*/
+/*	$NetBSD: kern_physio.c,v 1.88.6.1 2009/05/27 21:45:21 snj Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -71,7 +71,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_physio.c,v 1.88 2008/09/24 08:19:19 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_physio.c,v 1.88.6.1 2009/05/27 21:45:21 snj Exp $");
 
 #include 
 #include 
@@ -117,6 +117,7 @@
 	size_t todo = bp->b_bufsize;
 	size_t done = bp->b_bcount - bp->b_resid;
 	struct physio_stat *ps = bp->b_private;
+	bool is_iobuf;
 
 	KASSERT(&bp->b_work == wk);
 	KASSERT(bp->b_bcount <= todo);
@@ -128,6 +129,7 @@
 	uvm_vsunlock(bp->b_proc->p_vmspace, bp->b_data, todo);
 
 	mutex_enter(&ps->ps_lock);
+	is_iobuf = (bp != ps->ps_orig_bp);
 	if (__predict_false(done != todo)) {
 		off_t endoffset = dbtob(bp->b_blkno) + done;
 
@@ -163,7 +165,7 @@
 	cv_signal(&ps->ps_cv);
 	mutex_exit(&ps->ps_lock);
 
-	if (bp != ps->ps_orig_bp)
+	if (is_iobuf)
 		putiobuf(bp);
 }
 



CVS commit: [netbsd-5] src/doc

2009-05-27 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed May 27 21:44:12 UTC 2009

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

Log Message:
Tickets 778, 779, and 781.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.21 -r1.1.2.22 src/doc/CHANGES-5.1

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
diff -u src/doc/CHANGES-5.1:1.1.2.21 src/doc/CHANGES-5.1:1.1.2.22
--- src/doc/CHANGES-5.1:1.1.2.21	Tue May 26 19:20:50 2009
+++ src/doc/CHANGES-5.1	Wed May 27 21:44:12 2009
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.1,v 1.1.2.21 2009/05/26 19:20:50 snj Exp $
+# $NetBSD: CHANGES-5.1,v 1.1.2.22 2009/05/27 21:44:12 snj Exp $
 
 A complete list of changes from the NetBSD 5.0 release to the NetBSD 5.1
 release:
@@ -627,3 +627,25 @@
 	Fixes PR 41302.
 	[martin, ticket #774]
 
+distrib/utils/sysinst/arch/mac68k/md.c		1.54
+
+	Fix build by explicitly narrowing dlsize to an unsigned 32-bit
+	quantity as supported by disklabel.  Fixes fallout from ticket
+	755.
+	[sborrill, ticket #778]
+
+sys/kern/sys_mqueue.c1.18
+
+	- Slightly rework the way permissions are checked. Neither
+	mq_receive() nor mq_send() should fail due to permissions.
+	- Check for empty message queue name (POSIX does not allow this
+	for regular files, and it's weird), check for DTYPE_MQUEUE, fix
+	permission check in mq_unlink(), clean up.
+	[rmind, ticket #779]
+
+sys/kern/kern_physio.c1.91
+
+	Remove a race where physio_done() may use memory already
+	freed.  Fixes PR kern/39536.
+	[hannken, ticket #781]
+



CVS commit: [netbsd-5] src/sys/kern

2009-05-27 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed May 27 21:42:08 UTC 2009

Modified Files:
src/sys/kern [netbsd-5]: kern_physio.c

Log Message:
Pull up following revision(s) (requested by hannken in ticket #781):
sys/kern/kern_physio.c: revision 1.91
PR kern/39536: bufq related problem when writing DVDR and DVDRWs.
Remove a race where physio_done() may use memory already freed.
Observed by Hans Rosenfeld .


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.88.4.1 src/sys/kern/kern_physio.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/kern_physio.c
diff -u src/sys/kern/kern_physio.c:1.88 src/sys/kern/kern_physio.c:1.88.4.1
--- src/sys/kern/kern_physio.c:1.88	Wed Sep 24 08:19:19 2008
+++ src/sys/kern/kern_physio.c	Wed May 27 21:42:08 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_physio.c,v 1.88 2008/09/24 08:19:19 hannken Exp $	*/
+/*	$NetBSD: kern_physio.c,v 1.88.4.1 2009/05/27 21:42:08 snj Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -71,7 +71,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_physio.c,v 1.88 2008/09/24 08:19:19 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_physio.c,v 1.88.4.1 2009/05/27 21:42:08 snj Exp $");
 
 #include 
 #include 
@@ -117,6 +117,7 @@
 	size_t todo = bp->b_bufsize;
 	size_t done = bp->b_bcount - bp->b_resid;
 	struct physio_stat *ps = bp->b_private;
+	bool is_iobuf;
 
 	KASSERT(&bp->b_work == wk);
 	KASSERT(bp->b_bcount <= todo);
@@ -128,6 +129,7 @@
 	uvm_vsunlock(bp->b_proc->p_vmspace, bp->b_data, todo);
 
 	mutex_enter(&ps->ps_lock);
+	is_iobuf = (bp != ps->ps_orig_bp);
 	if (__predict_false(done != todo)) {
 		off_t endoffset = dbtob(bp->b_blkno) + done;
 
@@ -163,7 +165,7 @@
 	cv_signal(&ps->ps_cv);
 	mutex_exit(&ps->ps_lock);
 
-	if (bp != ps->ps_orig_bp)
+	if (is_iobuf)
 		putiobuf(bp);
 }
 



CVS commit: [netbsd-5-0] src/sys/kern

2009-05-27 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed May 27 21:33:50 UTC 2009

Modified Files:
src/sys/kern [netbsd-5-0]: sys_mqueue.c

Log Message:
Pull up following revision(s) (requested by rmind in ticket #779):
sys/kern/sys_mqueue.c: revision 1.18
- Slightly rework the way permissions are checked. Neither mq_receive() not
  mq_send() should fail due to permissions.  Noted by Stathis Kamperis!
- Check for empty message queue name (POSIX does not allow this for regular
  files, and it's weird), check for DTYPE_MQUEUE, fix permission check in
  mq_unlink(), clean up.


To generate a diff of this commit:
cvs rdiff -u -r1.12.4.1.2.1 -r1.12.4.1.2.2 src/sys/kern/sys_mqueue.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/sys_mqueue.c
diff -u src/sys/kern/sys_mqueue.c:1.12.4.1.2.1 src/sys/kern/sys_mqueue.c:1.12.4.1.2.2
--- src/sys/kern/sys_mqueue.c:1.12.4.1.2.1	Mon May 18 19:50:13 2009
+++ src/sys/kern/sys_mqueue.c	Wed May 27 21:33:50 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_mqueue.c,v 1.12.4.1.2.1 2009/05/18 19:50:13 bouyer Exp $	*/
+/*	$NetBSD: sys_mqueue.c,v 1.12.4.1.2.2 2009/05/27 21:33:50 snj Exp $	*/
 
 /*
  * Copyright (c) 2007, 2008 Mindaugas Rasiukevicius 
@@ -42,7 +42,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sys_mqueue.c,v 1.12.4.1.2.1 2009/05/18 19:50:13 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_mqueue.c,v 1.12.4.1.2.2 2009/05/27 21:33:50 snj Exp $");
 
 #include 
 #include 
@@ -86,8 +86,6 @@
 static int	mq_poll_fop(file_t *, int);
 static int	mq_close_fop(file_t *);
 
-#define	FNOVAL	-1
-
 static const struct fileops mqops = {
 	.fo_read = fbadop_read,
 	.fo_write = fbadop_write,
@@ -166,57 +164,28 @@
 }
 
 /*
- * Check access against message queue.
- */
-static inline int
-mqueue_access(struct lwp *l, struct mqueue *mq, int access)
-{
-	mode_t acc_mode = 0;
-
-	KASSERT(mutex_owned(&mq->mq_mtx));
-	KASSERT(access != FNOVAL);
-
-	/* Note the difference between VREAD/VWRITE and FREAD/FWRITE */
-	if (access & FREAD)
-		acc_mode |= VREAD;
-	if (access & FWRITE)
-		acc_mode |= VWRITE;
-
-	return vaccess(VNON, mq->mq_mode, mq->mq_euid, mq->mq_egid,
-	acc_mode, l->l_cred);
-}
-
-/*
- * Get the mqueue from the descriptor.
- *  => locks the message queue, if found
- *  => increments the reference on file entry
+ * mqueue_get: get the mqueue from the descriptor.
+ *  => locks the message queue, if found.
+ *  => holds a reference on the file descriptor.
  */
 static int
-mqueue_get(struct lwp *l, mqd_t mqd, int access, file_t **fpr)
+mqueue_get(mqd_t mqd, file_t **fpr)
 {
-	file_t *fp;
 	struct mqueue *mq;
+	file_t *fp;
 
-	/* Get the file and descriptor */
 	fp = fd_getfile((int)mqd);
-	if (fp == NULL)
+	if (__predict_false(fp == NULL)) {
 		return EBADF;
-
-	/* Increment the reference of file entry, and lock the mqueue */
-	mq = fp->f_data;
-	*fpr = fp;
-	mutex_enter(&mq->mq_mtx);
-	if (access == FNOVAL) {
-		KASSERT(mutex_owned(&mq->mq_mtx));
-		return 0;
 	}
-
-	/* Check the access mode and permission */
-	if ((fp->f_flag & access) != access || mqueue_access(l, mq, access)) {
-		mutex_exit(&mq->mq_mtx);
+	if (__predict_false(fp->f_type != DTYPE_MQUEUE)) {
 		fd_putfile((int)mqd);
-		return EPERM;
+		return EBADF;
 	}
+	mq = fp->f_data;
+	mutex_enter(&mq->mq_mtx);
+
+	*fpr = fp;
 	return 0;
 }
 
@@ -347,6 +316,12 @@
 			return EMFILE;
 		}
 
+		/* Empty name is invalid */
+		if (name[0] == '\0') {
+			kmem_free(name, MQ_NAMELEN);
+			return EINVAL;
+		}
+	
 		/* Check for mqueue attributes */
 		if (SCARG(uap, attr)) {
 			error = copyin(SCARG(uap, attr), &attr,
@@ -383,7 +358,9 @@
 
 		strlcpy(mq_new->mq_name, name, MQ_NAMELEN);
 		memcpy(&mq_new->mq_attrib, &attr, sizeof(struct mq_attr));
-		mq_new->mq_attrib.mq_flags = oflag;
+
+		CTASSERT((O_MASK & (MQ_UNLINK | MQ_RECEIVE)) == 0);
+		mq_new->mq_attrib.mq_flags = (O_MASK & oflag);
 
 		/* Store mode and effective UID with GID */
 		mq_new->mq_mode = ((SCARG(uap, mode) &
@@ -408,6 +385,8 @@
 	mutex_enter(&mqlist_mtx);
 	mq = mqueue_lookup(name);
 	if (mq) {
+		mode_t acc_mode;
+
 		KASSERT(mutex_owned(&mq->mq_mtx));
 
 		/* Check if mqueue is not marked as unlinking */
@@ -420,8 +399,20 @@
 			error = EEXIST;
 			goto exit;
 		}
-		/* Check the permission */
-		if (mqueue_access(l, mq, fp->f_flag)) {
+
+		/*
+		 * Check the permissions.  Note the difference between
+		 * VREAD/VWRITE and FREAD/FWRITE.
+		 */
+		acc_mode = 0;
+		if (fp->f_flag & FREAD) {
+			acc_mode |= VREAD;
+		}
+		if (fp->f_flag & FWRITE) {
+			acc_mode |= VWRITE;
+		}
+		if (vaccess(VNON, mq->mq_mode, mq->mq_euid, mq->mq_egid,
+		acc_mode, l->l_cred)) {
 			error = EACCES;
 			goto exit;
 		}
@@ -490,7 +481,7 @@
 	int error;
 
 	/* Get the message queue */
-	error = mqueue_get(l, mqdes, FREAD, &fp);
+	error = mqueue_get(mqdes, &fp);
 	if (error)
 		return error;
 	mq = fp->f_data;
@@ -645,7 +636,7 @@
 	msg->msg_prio = msg_prio;
 
 	/* 

CVS commit: src/sys/netinet

2009-05-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 27 21:32:31 UTC 2009

Modified Files:
src/sys/netinet: ip_carp.c

Log Message:
PR/38260: Brian Seklecki: Improve carp logging.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/netinet/ip_carp.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/netinet/ip_carp.c
diff -u src/sys/netinet/ip_carp.c:1.36 src/sys/netinet/ip_carp.c:1.37
--- src/sys/netinet/ip_carp.c:1.36	Tue May 12 18:01:20 2009
+++ src/sys/netinet/ip_carp.c	Wed May 27 17:32:31 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_carp.c,v 1.36 2009/05/12 22:01:20 elad Exp $	*/
+/*	$NetBSD: ip_carp.c,v 1.37 2009/05/27 21:32:31 christos Exp $	*/
 /*	$OpenBSD: ip_carp.c,v 1.113 2005/11/04 08:11:54 mcbride Exp $	*/
 
 /*
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip_carp.c,v 1.36 2009/05/12 22:01:20 elad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_carp.c,v 1.37 2009/05/27 21:32:31 christos Exp $");
 
 /*
  * TODO:
@@ -697,6 +697,7 @@
 		if (timercmp(&sc_tv, &ch_tv, >) ||
 		timercmp(&sc_tv, &ch_tv, ==)) {
 			callout_stop(&sc->sc_ad_tmo);
+			CARP_LOG(sc, "MASTER -> BACKUP (more frequent advertisement received)");
 			carp_set_state(sc, BACKUP);
 			carp_setrun(sc, 0);
 			carp_setroute(sc, RTM_DELETE);
@@ -708,6 +709,7 @@
 		 * and this one claims to be slower, treat him as down.
 		 */
 		if (carp_opts[CARPCTL_PREEMPT] && timercmp(&sc_tv, &ch_tv, <)) {
+			CARP_LOG(sc, "BACKUP -> MASTER (preempting a slower master)");
 			carp_master_down(sc);
 			break;
 		}
@@ -719,6 +721,7 @@
 		 */
 		sc_tv.tv_sec = sc->sc_advbase * 3;
 		if (timercmp(&sc_tv, &ch_tv, <)) {
+			CARP_LOG(sc, "BACKUP -> MASTER (master timed out)")
 			carp_master_down(sc);
 			break;
 		}
@@ -1388,6 +1391,7 @@
 	case MASTER:
 		break;
 	case BACKUP:
+		CARP_LOG(sc, "INIT -> MASTER (preempting)");
 		carp_set_state(sc, MASTER);
 		carp_send_ad(sc);
 		carp_send_arp(sc);
@@ -2052,9 +2056,12 @@
 void
 carp_set_state(struct carp_softc *sc, int state)
 {
+	static const char *carp_states[] = { CARP_STATES };
 	if (sc->sc_state == state)
 		return;
 
+	CARP_LOG(sc, ("state transition from: %s -> to: %s", carp_states[sc->sc_state], carp_states[state]));
+
 	sc->sc_state = state;
 	switch (state) {
 	case BACKUP:



CVS commit: [netbsd-5] src/sys/kern

2009-05-27 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed May 27 21:32:05 UTC 2009

Modified Files:
src/sys/kern [netbsd-5]: sys_mqueue.c

Log Message:
Pull up following revision(s) (requested by rmind in ticket #779):
sys/kern/sys_mqueue.c: revision 1.18
- Slightly rework the way permissions are checked. Neither mq_receive() not
  mq_send() should fail due to permissions.  Noted by Stathis Kamperis!
- Check for empty message queue name (POSIX does not allow this for regular
  files, and it's weird), check for DTYPE_MQUEUE, fix permission check in
  mq_unlink(), clean up.


To generate a diff of this commit:
cvs rdiff -u -r1.12.4.2 -r1.12.4.3 src/sys/kern/sys_mqueue.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/sys_mqueue.c
diff -u src/sys/kern/sys_mqueue.c:1.12.4.2 src/sys/kern/sys_mqueue.c:1.12.4.3
--- src/sys/kern/sys_mqueue.c:1.12.4.2	Mon May 18 19:47:32 2009
+++ src/sys/kern/sys_mqueue.c	Wed May 27 21:32:05 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_mqueue.c,v 1.12.4.2 2009/05/18 19:47:32 bouyer Exp $	*/
+/*	$NetBSD: sys_mqueue.c,v 1.12.4.3 2009/05/27 21:32:05 snj Exp $	*/
 
 /*
  * Copyright (c) 2007, 2008 Mindaugas Rasiukevicius 
@@ -42,7 +42,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sys_mqueue.c,v 1.12.4.2 2009/05/18 19:47:32 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_mqueue.c,v 1.12.4.3 2009/05/27 21:32:05 snj Exp $");
 
 #include 
 #include 
@@ -86,8 +86,6 @@
 static int	mq_poll_fop(file_t *, int);
 static int	mq_close_fop(file_t *);
 
-#define	FNOVAL	-1
-
 static const struct fileops mqops = {
 	.fo_read = fbadop_read,
 	.fo_write = fbadop_write,
@@ -166,57 +164,28 @@
 }
 
 /*
- * Check access against message queue.
- */
-static inline int
-mqueue_access(struct lwp *l, struct mqueue *mq, int access)
-{
-	mode_t acc_mode = 0;
-
-	KASSERT(mutex_owned(&mq->mq_mtx));
-	KASSERT(access != FNOVAL);
-
-	/* Note the difference between VREAD/VWRITE and FREAD/FWRITE */
-	if (access & FREAD)
-		acc_mode |= VREAD;
-	if (access & FWRITE)
-		acc_mode |= VWRITE;
-
-	return vaccess(VNON, mq->mq_mode, mq->mq_euid, mq->mq_egid,
-	acc_mode, l->l_cred);
-}
-
-/*
- * Get the mqueue from the descriptor.
- *  => locks the message queue, if found
- *  => increments the reference on file entry
+ * mqueue_get: get the mqueue from the descriptor.
+ *  => locks the message queue, if found.
+ *  => holds a reference on the file descriptor.
  */
 static int
-mqueue_get(struct lwp *l, mqd_t mqd, int access, file_t **fpr)
+mqueue_get(mqd_t mqd, file_t **fpr)
 {
-	file_t *fp;
 	struct mqueue *mq;
+	file_t *fp;
 
-	/* Get the file and descriptor */
 	fp = fd_getfile((int)mqd);
-	if (fp == NULL)
+	if (__predict_false(fp == NULL)) {
 		return EBADF;
-
-	/* Increment the reference of file entry, and lock the mqueue */
-	mq = fp->f_data;
-	*fpr = fp;
-	mutex_enter(&mq->mq_mtx);
-	if (access == FNOVAL) {
-		KASSERT(mutex_owned(&mq->mq_mtx));
-		return 0;
 	}
-
-	/* Check the access mode and permission */
-	if ((fp->f_flag & access) != access || mqueue_access(l, mq, access)) {
-		mutex_exit(&mq->mq_mtx);
+	if (__predict_false(fp->f_type != DTYPE_MQUEUE)) {
 		fd_putfile((int)mqd);
-		return EPERM;
+		return EBADF;
 	}
+	mq = fp->f_data;
+	mutex_enter(&mq->mq_mtx);
+
+	*fpr = fp;
 	return 0;
 }
 
@@ -347,6 +316,12 @@
 			return EMFILE;
 		}
 
+		/* Empty name is invalid */
+		if (name[0] == '\0') {
+			kmem_free(name, MQ_NAMELEN);
+			return EINVAL;
+		}
+	
 		/* Check for mqueue attributes */
 		if (SCARG(uap, attr)) {
 			error = copyin(SCARG(uap, attr), &attr,
@@ -383,7 +358,9 @@
 
 		strlcpy(mq_new->mq_name, name, MQ_NAMELEN);
 		memcpy(&mq_new->mq_attrib, &attr, sizeof(struct mq_attr));
-		mq_new->mq_attrib.mq_flags = oflag;
+
+		CTASSERT((O_MASK & (MQ_UNLINK | MQ_RECEIVE)) == 0);
+		mq_new->mq_attrib.mq_flags = (O_MASK & oflag);
 
 		/* Store mode and effective UID with GID */
 		mq_new->mq_mode = ((SCARG(uap, mode) &
@@ -408,6 +385,8 @@
 	mutex_enter(&mqlist_mtx);
 	mq = mqueue_lookup(name);
 	if (mq) {
+		mode_t acc_mode;
+
 		KASSERT(mutex_owned(&mq->mq_mtx));
 
 		/* Check if mqueue is not marked as unlinking */
@@ -420,8 +399,20 @@
 			error = EEXIST;
 			goto exit;
 		}
-		/* Check the permission */
-		if (mqueue_access(l, mq, fp->f_flag)) {
+
+		/*
+		 * Check the permissions.  Note the difference between
+		 * VREAD/VWRITE and FREAD/FWRITE.
+		 */
+		acc_mode = 0;
+		if (fp->f_flag & FREAD) {
+			acc_mode |= VREAD;
+		}
+		if (fp->f_flag & FWRITE) {
+			acc_mode |= VWRITE;
+		}
+		if (vaccess(VNON, mq->mq_mode, mq->mq_euid, mq->mq_egid,
+		acc_mode, l->l_cred)) {
 			error = EACCES;
 			goto exit;
 		}
@@ -490,7 +481,7 @@
 	int error;
 
 	/* Get the message queue */
-	error = mqueue_get(l, mqdes, FREAD, &fp);
+	error = mqueue_get(mqdes, &fp);
 	if (error)
 		return error;
 	mq = fp->f_data;
@@ -645,7 +636,7 @@
 	msg->msg_prio = msg_prio;
 
 	/* Get the mqueue */
-	error = mqueue_get

CVS commit: [netbsd-5] src/distrib/utils/sysinst/arch/mac68k

2009-05-27 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed May 27 21:21:47 UTC 2009

Modified Files:
src/distrib/utils/sysinst/arch/mac68k [netbsd-5]: md.c

Log Message:
Pull up following revision(s) (requested by sborrill in ticket #778):
distrib/utils/sysinst/arch/mac68k/md.c: revision 1.54
Fix build by explicitly narrowing dlsize to an unsigned 32-bit quantity as
supported by disklabel.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.53.2.1 src/distrib/utils/sysinst/arch/mac68k/md.c

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

Modified files:

Index: src/distrib/utils/sysinst/arch/mac68k/md.c
diff -u src/distrib/utils/sysinst/arch/mac68k/md.c:1.53 src/distrib/utils/sysinst/arch/mac68k/md.c:1.53.2.1
--- src/distrib/utils/sysinst/arch/mac68k/md.c:1.53	Tue Oct  7 09:58:15 2008
+++ src/distrib/utils/sysinst/arch/mac68k/md.c	Wed May 27 21:21:47 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.53 2008/10/07 09:58:15 abs Exp $ */
+/*	$NetBSD: md.c,v 1.53.2.1 2009/05/27 21:21:47 snj Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -44,6 +44,7 @@
 #include 
 #include 
 #include 
+#include 
 #include "defs.h"
 #include "md.h"
 #include "msg_defs.h"
@@ -1083,7 +1084,7 @@
 	(void)fprintf (f, "%s|NetBSD installation generated:\\\n", bsddiskname);
 	(void)fprintf (f, "\t:dt=%s:ty=winchester:\\\n", disktype);
 	(void)fprintf (f, "\t:nc#%d:nt#%d:ns#%d:\\\n", dlcyl, dlhead, dlsec);
-	(void)fprintf (f, "\t:sc#%d:su#%d:\\\n", dlhead*dlsec, dlsize);
+	(void)fprintf (f, "\t:sc#%d:su#%" PRIu32 ":\\\n", dlhead*dlsec, (uint32_t)dlsize);
 	(void)fprintf (f, "\t:se#%d:%s\\\n", blk_size, doessf);
 	for (i=0; i<8; i++) {
 		if (bsdlabel[i].pi_fstype == FS_HFS)



CVS commit: src/share/man/man4/man4.prep

2009-05-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed May 27 19:28:42 UTC 2009

Modified Files:
src/share/man/man4/man4.prep: nvram.4

Log Message:
Merge two descriptions for same error code.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/share/man/man4/man4.prep/nvram.4

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/man4/man4.prep/nvram.4
diff -u src/share/man/man4/man4.prep/nvram.4:1.4 src/share/man/man4/man4.prep/nvram.4:1.5
--- src/share/man/man4/man4.prep/nvram.4:1.4	Wed May 27 19:24:00 2009
+++ src/share/man/man4/man4.prep/nvram.4	Wed May 27 19:28:42 2009
@@ -1,4 +1,4 @@
-.\" $NetBSD: nvram.4,v 1.4 2009/05/27 19:24:00 snj Exp $
+.\" $NetBSD: nvram.4,v 1.5 2009/05/27 19:28:42 wiz Exp $
 .\"
 .\" Copyright (c) 2007 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -101,9 +101,8 @@
 The following may result in rejection of an operation:
 .Bl -tag -width Er
 .It Bq Er EINVAL
-The given variable name does not exist.
-.It Bq Er EINVAL
-The buffer set up to retrieve values from the nvram was not large enough
+The given variable name does not exist; or
+the buffer set up to retrieve values from the nvram was not large enough
 to hold the result.
 .El
 .Sh SEE ALSO



CVS commit: src/share/man/man4

2009-05-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed May 27 19:27:59 UTC 2009

Modified Files:
src/share/man/man4/man4.macppc: obio.4
src/share/man/man4/man4.prep: intro.4

Log Message:
New sentence, new line.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/share/man/man4/man4.macppc/obio.4
cvs rdiff -u -r1.4 -r1.5 src/share/man/man4/man4.prep/intro.4

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/man4/man4.macppc/obio.4
diff -u src/share/man/man4/man4.macppc/obio.4:1.5 src/share/man/man4/man4.macppc/obio.4:1.6
--- src/share/man/man4/man4.macppc/obio.4:1.5	Wed May 27 19:24:00 2009
+++ src/share/man/man4/man4.macppc/obio.4	Wed May 27 19:27:59 2009
@@ -1,4 +1,4 @@
-.\"	$NetBSD: obio.4,v 1.5 2009/05/27 19:24:00 snj Exp $
+.\"	$NetBSD: obio.4,v 1.6 2009/05/27 19:27:59 wiz Exp $
 .\"
 .\" Copyright (c) 2003 Alex Zepeda 
 .\" All rights reserved.
@@ -86,8 +86,8 @@
 .It awacs
 Apple's
 .Sq "audio waveform amplifier and converter for sound"
-audio device found on most macppc models.  May not work on
-several G4 and iBook models.
+audio device found on most macppc models.
+May not work on several G4 and iBook models.
 .El
 .Ss Miscellaneous devices
 .Bl -tag -width burgundy -offset indent

Index: src/share/man/man4/man4.prep/intro.4
diff -u src/share/man/man4/man4.prep/intro.4:1.4 src/share/man/man4/man4.prep/intro.4:1.5
--- src/share/man/man4/man4.prep/intro.4:1.4	Wed May 27 19:24:00 2009
+++ src/share/man/man4/man4.prep/intro.4	Wed May 27 19:27:59 2009
@@ -1,4 +1,4 @@
-.\" $NetBSD: intro.4,v 1.4 2009/05/27 19:24:00 snj Exp $
+.\" $NetBSD: intro.4,v 1.5 2009/05/27 19:27:59 wiz Exp $
 .\"
 .\" Copyright (c) 2007 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -105,7 +105,8 @@
 Not all supported devices are listed.
 .Pp
 The pnpbus is a pseudo-bus which is a configuration interface for certain
-devices on PReP machines.  These devices are defined in the PReP
+devices on PReP machines.
+These devices are defined in the PReP
 residual data with configuration information, similar to
 .Xr isapnp 4 .
 The underlying bus is generally ISA.



CVS commit: src/share/man/man4

2009-05-27 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed May 27 19:24:00 UTC 2009

Modified Files:
src/share/man/man4: ahcisata.4 altmem.4 bktr.4 btsco.4 btuart.4
dbcool.4 icmp6.4 iee.4 isdn.4 kse.4 lmc.4 pppoe.4 pud.4 rtw.4
seeprom.4 spi.4 wd.4 xge.4
src/share/man/man4/man4.hp700: gsckbc.4 intro.4
src/share/man/man4/man4.i386: geodecntr.4
src/share/man/man4/man4.macppc: obio.4
src/share/man/man4/man4.prep: intro.4 nvram.4

Log Message:
Ficks some spelling mistakes and tyops.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/share/man/man4/ahcisata.4 \
src/share/man/man4/dbcool.4 src/share/man/man4/rtw.4 \
src/share/man/man4/spi.4
cvs rdiff -u -r1.2 -r1.3 src/share/man/man4/altmem.4 \
src/share/man/man4/isdn.4 src/share/man/man4/xge.4
cvs rdiff -u -r1.16 -r1.17 src/share/man/man4/bktr.4
cvs rdiff -u -r1.9 -r1.10 src/share/man/man4/btsco.4
cvs rdiff -u -r1.7 -r1.8 src/share/man/man4/btuart.4 src/share/man/man4/kse.4
cvs rdiff -u -r1.14 -r1.15 src/share/man/man4/icmp6.4 src/share/man/man4/wd.4
cvs rdiff -u -r1.4 -r1.5 src/share/man/man4/iee.4
cvs rdiff -u -r1.15 -r1.16 src/share/man/man4/lmc.4
cvs rdiff -u -r1.33 -r1.34 src/share/man/man4/pppoe.4
cvs rdiff -u -r1.1 -r1.2 src/share/man/man4/pud.4 \
src/share/man/man4/seeprom.4
cvs rdiff -u -r1.1 -r1.2 src/share/man/man4/man4.hp700/gsckbc.4
cvs rdiff -u -r1.2 -r1.3 src/share/man/man4/man4.hp700/intro.4
cvs rdiff -u -r1.2 -r1.3 src/share/man/man4/man4.i386/geodecntr.4
cvs rdiff -u -r1.4 -r1.5 src/share/man/man4/man4.macppc/obio.4
cvs rdiff -u -r1.3 -r1.4 src/share/man/man4/man4.prep/intro.4 \
src/share/man/man4/man4.prep/nvram.4

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/man4/ahcisata.4
diff -u src/share/man/man4/ahcisata.4:1.3 src/share/man/man4/ahcisata.4:1.4
--- src/share/man/man4/ahcisata.4:1.3	Mon Mar  2 10:08:51 2009
+++ src/share/man/man4/ahcisata.4	Wed May 27 19:23:59 2009
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ahcisata.4,v 1.3 2009/03/02 10:08:51 mjf Exp $
+.\"	$NetBSD: ahcisata.4,v 1.4 2009/05/27 19:23:59 snj Exp $
 .\"
 .\" Copyright (c) 2006 Manuel Bouyer.
 .\"
@@ -38,15 +38,15 @@
 .Sh DESCRIPTION
 The
 .Nm
-driver supports the SATA controllers compliants to the Serial ATA Advanced
+driver supports SATA controllers compliant with the Serial ATA Advanced
 Host Controller Interface Revision 1.0 or 1.1 specification,
-and provides the interface with the hardware for the
+and provides the interface to the hardware for the
 .Xr ata 4
 driver.
 .Pp
 The
 .Nm
-driver will only attach if the contoller has been put in AHCI mode by the
+driver will only attach if the controller has been put in AHCI mode by the
 BIOS; if the controller is in pciide-compatible mode, it will be handled
 by the appropriate driver
 .Xr ( piixide 4
Index: src/share/man/man4/dbcool.4
diff -u src/share/man/man4/dbcool.4:1.3 src/share/man/man4/dbcool.4:1.4
--- src/share/man/man4/dbcool.4:1.3	Mon Oct  6 01:35:35 2008
+++ src/share/man/man4/dbcool.4	Wed May 27 19:23:59 2009
@@ -1,4 +1,4 @@
-.\"	$NetBSD: dbcool.4,v 1.3 2008/10/06 01:35:35 pgoyette Exp $
+.\"	$NetBSD: dbcool.4,v 1.4 2009/05/27 19:23:59 snj Exp $
 .\"
 .\" Copyright (c) 2008 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -180,7 +180,7 @@
 .Dq manual ,
 the
 .Em cur-duty
-variable becomes user-writeable and can be set to any value between 0 and
+variable becomes user-writable and can be set to any value between 0 and
 100 inclusive to control the fan's duty cycle manually.
 In all other
 .Em behavior
Index: src/share/man/man4/rtw.4
diff -u src/share/man/man4/rtw.4:1.3 src/share/man/man4/rtw.4:1.4
--- src/share/man/man4/rtw.4:1.3	Fri Sep  9 14:11:39 2005
+++ src/share/man/man4/rtw.4	Wed May 27 19:24:00 2009
@@ -1,4 +1,4 @@
-.\"	$NetBSD: rtw.4,v 1.3 2005/09/09 14:11:39 drochner Exp $
+.\"	$NetBSD: rtw.4,v 1.4 2009/05/27 19:24:00 snj Exp $
 .\"	$OpenBSD: rtw.4,v 1.18 2005/06/09 09:03:38 jmc Exp $
 .\"
 .\" Copyright (c) 2004 Jonathan Gray 
@@ -30,7 +30,7 @@
 driver supports PCI/CardBus 802.11b wireless adapters based on the
 Realtek RTL8180L.
 .Pp
-A variety of radio tranceivers can be found in these devices, including
+A variety of radio transceivers can be found in these devices, including
 the Philips SA2400A, Maxim MAX2820, and GCT GRF5101, though not all of them
 are currently supported.
 .Pp
Index: src/share/man/man4/spi.4
diff -u src/share/man/man4/spi.4:1.3 src/share/man/man4/spi.4:1.4
--- src/share/man/man4/spi.4:1.3	Fri Oct 13 21:17:57 2006
+++ src/share/man/man4/spi.4	Wed May 27 19:24:00 2009
@@ -1,4 +1,4 @@
-.\"	$NetBSD: spi.4,v 1.3 2006/10/13 21:17:57 wiz Exp $
+.\"	$NetBSD: spi.4,v 1.4 2009/05/27 19:24:00 snj Exp $
 .\"
 .\" Copyright (c) 2006 Urbana-Champaign Independent Media Center.
 .\" Copyright (c) 2006 Garrett D'Amore.
@@ -57,7 +57,7 @@
 .Nx
 includes a machine dependent
 .Tn SPI
-(Serial Peripheri

CVS commit: src/share/man/man3

2009-05-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed May 27 19:23:28 UTC 2009

Modified Files:
src/share/man/man3: gcq.3

Log Message:
Drop trailing whitespace. Sort SEE ALSO. Make HTML-ready. Fix Dt argument case.


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

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/man3/gcq.3
diff -u src/share/man/man3/gcq.3:1.2 src/share/man/man3/gcq.3:1.3
--- src/share/man/man3/gcq.3:1.2	Wed May 27 17:47:46 2009
+++ src/share/man/man3/gcq.3	Wed May 27 19:23:28 2009
@@ -1,14 +1,14 @@
-.\" $NetBSD: gcq.3,v 1.2 2009/05/27 17:47:46 snj Exp $
+.\" $NetBSD: gcq.3,v 1.3 2009/05/27 19:23:28 wiz Exp $
 .\"
 .\" Not (c) 2007 Matthew Orgass
-.\" This file is public domain, meaning anyone can make any use of part or all 
-.\" of this file including copying into other works without credit.  Any use, 
-.\" modified or not, is solely the responsibility of the user.  If this file 
-.\" is part of a collection then use in the collection is governed by the 
+.\" This file is public domain, meaning anyone can make any use of part or all
+.\" of this file including copying into other works without credit.  Any use,
+.\" modified or not, is solely the responsibility of the user.  If this file
+.\" is part of a collection then use in the collection is governed by the
 .\" terms of the collection.
 .\"
 .Dd May 1, 2007
-.Dt gcq 3
+.Dt GCQ 3
 .Os
 .Sh NAME
 .Nm GCQ_INIT ,
@@ -232,7 +232,7 @@
 merge operations and unconditional removal.
 All basic operations can be performed with or without use of a separate head,
 allowing easy replacement of any pointers where efficient removal is desired.
-The meaning of the data type will not change; direct use and defined 
+The meaning of the data type will not change; direct use and defined
 operations can be mixed when convenient.
 The basic type is:
 .Bd -literal -offset indent
@@ -242,7 +242,7 @@
 };
 .Ed
 .Pp
-The structure must first be initialized such that the 
+The structure must first be initialized such that the
 .Va q_next
 and
 .Va q_prev
@@ -251,7 +251,7 @@
 This can be done with
 .Fn gcq_init
 and
-.Fn gcq_init_head 
+.Fn gcq_init_head
 or with constant initializers
 .Fn GCQ_INIT
 and
@@ -269,19 +269,19 @@
 can be retrieved by pointer arithmetic in the
 .Fn GCQ_ITEM
 macro.
-List traversal normally requires knowledge of the list head to safely 
+List traversal normally requires knowledge of the list head to safely
 retrieve list items.
 .Pp
-Capitalized operation names are macros and should be assumed to cause multiple 
+Capitalized operation names are macros and should be assumed to cause multiple
 evaluation of arguments.
 .Li TYPED
-variants of macros set a typed pointer variable instead of or in addition to 
+variants of macros set a typed pointer variable instead of or in addition to
 .Vt struct gcq *
 arguments.
-Additional type specific inlines and macros around some GCQ operations can be 
+Additional type specific inlines and macros around some GCQ operations can be
 useful.
 .Pp
-A few assertions are provided when 
+A few assertions are provided when
 .Dv DIAGNOSTIC
 is defined in the kernel or
 .Dv _DIAGNOSTIC
@@ -311,18 +311,18 @@
 into
 .Vt struct gcq_head * .
 .Fn gcq_q
-returns its 
+returns its
 .Vt struct gcq *
 argument and is used for type checking in
 .Fn GCQ_ITEM .
 There are no functions for retrieving the raw
 .Va q_prev
-and 
-.Va q_next 
+and
+.Va q_next
 pointers as these are usually clearer when used directly (if at all).
 .Pp
 .Fn gcq_remove
-returns the element removed and is always a valid operation after 
+returns the element removed and is always a valid operation after
 initialization.
 .Fn gcq_onlist
 returns
@@ -334,14 +334,14 @@
 is the negation of this operation performed on a head.
 .Fn gcq_linked
 tests if
-.Li "prev->q_next == next && next->q_prev == prev" .
+.Li "prev-\*[Gt]q_next == next \*[Am]\*[Am] next-\*[Gt]q_prev == prev" .
 .Pp
 .Fn gcq_tie
 ties
 .Va src
 after
 .Va dst
-such that that if the old lists are DST, DST2 and SRC, SRC2, the new list is 
+such that that if the old lists are DST, DST2 and SRC, SRC2, the new list is
 DST, SRC, SRC2, DST2.
 If
 .Va dst
@@ -359,12 +359,12 @@
 .Fn gcq_tie
 is equivalent to
 .Fn gcq_tie_after
-except that the latter must only be used with arguments on separate lists or 
+except that the latter must only be used with arguments on separate lists or
 not on lists and asserts that
-.Li "src != dst && dst->q_prev != src" .
+.Li "src != dst \*[Am]\*[Am] dst-\*[Gt]q_prev != src" .
 .Fn gcq_tie_before
-performs the same operation on 
-.Li dst->q_prev .
+performs the same operation on
+.Li dst-\*[Gt]q_prev .
 .Pp
 .Fn gcq_merge
 moves any elements on list
@@ -379,14 +379,14 @@
 .Fn gcq_merge_tail .
 If
 .Dv GCQ_UNCONDITIONAL_MERGE
-is defined prior to header inclusion then the merge operations will always 
+is defined 

CVS commit: src

2009-05-27 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Wed May 27 18:02:57 UTC 2009

Modified Files:
src: UPDATING

Log Message:
Add note about Postgres WRT the time_t change.


To generate a diff of this commit:
cvs rdiff -u -r1.195 -r1.196 src/UPDATING

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

Modified files:

Index: src/UPDATING
diff -u src/UPDATING:1.195 src/UPDATING:1.196
--- src/UPDATING:1.195	Fri May  1 23:08:25 2009
+++ src/UPDATING	Wed May 27 18:02:57 2009
@@ -1,4 +1,4 @@
-$NetBSD: UPDATING,v 1.195 2009/05/01 23:08:25 perry Exp $
+$NetBSD: UPDATING,v 1.196 2009/05/27 18:02:57 dholland Exp $
 
 This file (UPDATING) is intended to be a brief reference to recent
 changes that might cause problems in the build process, and a guide for
@@ -69,6 +69,10 @@
 	   removed.  The automatic rotation of the accounting file by
 	   /etc/daily limits the bad consequences of failure to remove
 	   the file.
+	8. Application software that writes time_t to binary files on
+	   disk will break or need attention. Most notably: if you are
+	   using PostgreSQL < 8.4, you need to dump your databases,
+	   rebuild PostgreSQL with the new time_t, then restore.
 
 20081219:
 	config(1) has been updated, and one of the files it creates -



CVS commit: src/share/man/man3

2009-05-27 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed May 27 17:47:46 UTC 2009

Modified Files:
src/share/man/man3: gcq.3

Log Message:
Fix a few spelling errors.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/man/man3/gcq.3

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/man3/gcq.3
diff -u src/share/man/man3/gcq.3:1.1 src/share/man/man3/gcq.3:1.2
--- src/share/man/man3/gcq.3:1.1	Wed Aug 15 03:53:08 2007
+++ src/share/man/man3/gcq.3	Wed May 27 17:47:46 2009
@@ -1,4 +1,4 @@
-.\" $NetBSD: gcq.3,v 1.1 2007/08/15 03:53:08 kiyohara Exp $
+.\" $NetBSD: gcq.3,v 1.2 2009/05/27 17:47:46 snj Exp $
 .\"
 .\" Not (c) 2007 Matthew Orgass
 .\" This file is public domain, meaning anyone can make any use of part or all 
@@ -230,10 +230,10 @@
 .Sh DESCRIPTION
 The generic circular queue is a doubly linked list designed for efficient
 merge operations and unconditional removal.
-All basic operations can be perfomed with or without use of a separate head,
+All basic operations can be performed with or without use of a separate head,
 allowing easy replacement of any pointers where efficient removal is desired.
 The meaning of the data type will not change; direct use and defined 
-operations can be mixed when convienient.
+operations can be mixed when convenient.
 The basic type is:
 .Bd -literal -offset indent
 struct gcq {
@@ -298,7 +298,7 @@
 is a wrapper around the used assertion function.
 None of the operations accept
 .Dv NULL
-arguements, however this is not tested by assertion.
+arguments, however this is not tested by assertion.
 .Pp
 The head is separately named for type checking but contains only a
 .Vt struct gcq ,
@@ -500,11 +500,11 @@
 This is useful when calling a function that is not supposed to remove the 
 element passed.
 .Li DEQUEUED
-varients are like
+variants are like
 .Li NVAR
 but remove each element before the code block is executed.
 .Li TYPED
-variants are equvalent to the untyped versions except that they take three 
+variants are equivalent to the untyped versions except that they take three 
 extra arguments: a typed pointer, the type name, and the member name of the
 .Vt struct gcq
 used in this list.



CVS commit: src/sys

2009-05-27 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed May 27 17:46:50 UTC 2009

Modified Files:
src/sys/net: radix.c radix.h
src/sys/netinet: ip_encap.c

Log Message:
Make it possible to register delayed radix tree head inits which
will be processed when the radix "subsystem" is initialized -- all
users must be attached before any inits to know the max keylength.
Use of link sets is no longer required, and only attached domains
need to be considered.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/net/radix.c
cvs rdiff -u -r1.21 -r1.22 src/sys/net/radix.h
cvs rdiff -u -r1.37 -r1.38 src/sys/netinet/ip_encap.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/net/radix.c
diff -u src/sys/net/radix.c:1.42 src/sys/net/radix.c:1.43
--- src/sys/net/radix.c:1.42	Sun Mar 15 20:30:05 2009
+++ src/sys/net/radix.c	Wed May 27 17:46:50 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: radix.c,v 1.42 2009/03/15 20:30:05 cegger Exp $	*/
+/*	$NetBSD: radix.c,v 1.43 2009/05/27 17:46:50 pooka Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1993
@@ -36,10 +36,12 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: radix.c,v 1.42 2009/03/15 20:30:05 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radix.c,v 1.43 2009/05/27 17:46:50 pooka Exp $");
 
 #ifndef _NET_RADIX_H_
 #include 
+#include 
+#include 
 #ifdef	_KERNEL
 #include "opt_inet.h"
 
@@ -1002,6 +1004,31 @@
 	/* NOTREACHED */
 }
 
+struct delayinit {
+	void **head;
+	int off;
+	SLIST_ENTRY(delayinit) entries;
+};
+static SLIST_HEAD(, delayinit) delayinits = SLIST_HEAD_INITIALIZER(delayheads);
+static int radix_initialized;
+
+/*
+ * Initialize a radix tree once radix is initialized.  Only for bootstrap.
+ * Assume that no concurrency protection is necessary at this stage.
+ */
+void
+rn_delayedinit(void **head, int off)
+{
+	struct delayinit *di;
+
+	KASSERT(radix_initialized == 0);
+
+	di = kmem_alloc(sizeof(*di), KM_SLEEP);
+	di->head = head;
+	di->off = off;
+	SLIST_INSERT_HEAD(&delayinits, di, entries);
+}
+
 int
 rn_inithead(void **head, int off)
 {
@@ -1045,18 +1072,17 @@
 rn_init(void)
 {
 	char *cp, *cplim;
+	struct delayinit *di;
 #ifdef _KERNEL
-	static int initialized;
-	__link_set_decl(domains, struct domain);
-	struct domain *const *dpp;
-
-	if (initialized)
-		return;
-	initialized = 1;
+	struct domain *dp;
 
-	__link_set_foreach(dpp, domains) {
-		if ((*dpp)->dom_maxrtkey > max_keylen)
-			max_keylen = (*dpp)->dom_maxrtkey;
+	if (radix_initialized)
+		panic("radix already initialized");
+	radix_initialized = 1;
+
+	DOMAIN_FOREACH(dp) {
+		if (dp->dom_maxrtkey > max_keylen)
+			max_keylen = dp->dom_maxrtkey;
 	}
 #endif
 	if (max_keylen == 0) {
@@ -1064,6 +1090,7 @@
 		"rn_init: radix functions require max_keylen be set\n");
 		return;
 	}
+
 	R_Malloc(rn_zeros, char *, 3 * max_keylen);
 	if (rn_zeros == NULL)
 		panic("rn_init");
@@ -1074,4 +1101,11 @@
 		*cp++ = -1;
 	if (rn_inithead((void *)&mask_rnhead, 0) == 0)
 		panic("rn_init 2");
+
+	while ((di = SLIST_FIRST(&delayinits)) != NULL) {
+		if (!rn_inithead(di->head, di->off))
+			panic("delayed rn_inithead failed");
+		SLIST_REMOVE_HEAD(&delayinits, entries);
+		kmem_free(di, sizeof(*di));
+	}
 }

Index: src/sys/net/radix.h
diff -u src/sys/net/radix.h:1.21 src/sys/net/radix.h:1.22
--- src/sys/net/radix.h:1.21	Thu Feb  5 21:45:36 2009
+++ src/sys/net/radix.h	Wed May 27 17:46:50 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: radix.h,v 1.21 2009/02/05 21:45:36 dyoung Exp $	*/
+/*	$NetBSD: radix.h,v 1.22 2009/05/27 17:46:50 pooka Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1993
@@ -133,6 +133,7 @@
 
 void	rn_init(void);
 int	rn_inithead(void **, int);
+void	rn_delayedinit(void **, int);
 int	rn_inithead0(struct radix_node_head *, int);
 int	rn_refines(const void *, const void *);
 int	rn_walktree(struct radix_node_head *,

Index: src/sys/netinet/ip_encap.c
diff -u src/sys/netinet/ip_encap.c:1.37 src/sys/netinet/ip_encap.c:1.38
--- src/sys/netinet/ip_encap.c:1.37	Sat Apr 18 14:58:05 2009
+++ src/sys/netinet/ip_encap.c	Wed May 27 17:46:49 2009
@@ -74,7 +74,7 @@
 #define USE_RADIX
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip_encap.c,v 1.37 2009/04/18 14:58:05 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_encap.c,v 1.38 2009/05/27 17:46:49 pooka Exp $");
 
 #include "opt_mrouting.h"
 #include "opt_inet.h"
@@ -162,13 +162,13 @@
 
 #ifdef USE_RADIX
 	/*
-	 * initialize radix lookup table.
-	 * max_keylen initialization happen in the rn_init().
+	 * initialize radix lookup table when the radix subsystem is inited.
 	 */
-	rn_init();
-	rn_inithead((void *)&encap_head[0], sizeof(struct sockaddr_pack) << 3);
+	rn_delayedinit((void *)&encap_head[0],
+	sizeof(struct sockaddr_pack) << 3);
 #ifdef INET6
-	rn_inithead((void *)&encap_head[1], sizeof(struct sockaddr_pack) << 3);
+	rn_delayedinit((void *)&encap_head[1],
+	sizeof(struct sockaddr_pack) << 3);
 #endif
 #endif
 }



CVS commit: src/games/phantasia

2009-05-27 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Wed May 27 17:44:38 UTC 2009

Modified Files:
src/games/phantasia: include.h setup.c

Log Message:
Rearrange where the alternate definition of __dead goes.
It can't be before "include.h" as that includes a bunch of system headers,
but it can't be after either as it also includes a bunch of local headers.
Therefore, it needs to be *in* include.h.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/games/phantasia/include.h
cvs rdiff -u -r1.19 -r1.20 src/games/phantasia/setup.c

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

Modified files:

Index: src/games/phantasia/include.h
diff -u src/games/phantasia/include.h:1.5 src/games/phantasia/include.h:1.6
--- src/games/phantasia/include.h:1.5	Wed Apr  7 17:46:47 2004
+++ src/games/phantasia/include.h	Wed May 27 17:44:38 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: include.h,v 1.5 2004/04/07 17:46:47 ross Exp $	*/
+/*	$NetBSD: include.h,v 1.6 2009/05/27 17:44:38 dholland Exp $	*/
 
 /*
  * include.h - includes all important files for Phantasia
@@ -15,6 +15,10 @@
 #include 
 #include 
 
+#ifndef __dead /* Not NetBSD */
+#define __dead
+#endif
+
 #include "macros.h"
 #include "phantdefs.h"
 #include "phantstruct.h"

Index: src/games/phantasia/setup.c
diff -u src/games/phantasia/setup.c:1.19 src/games/phantasia/setup.c:1.20
--- src/games/phantasia/setup.c:1.19	Mon May 25 23:08:45 2009
+++ src/games/phantasia/setup.c	Wed May 27 17:44:38 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: setup.c,v 1.19 2009/05/25 23:08:45 dholland Exp $	*/
+/*	$NetBSD: setup.c,v 1.20 2009/05/27 17:44:38 dholland Exp $	*/
 
 /*
  * setup.c - set up all files for Phantasia
@@ -13,10 +13,6 @@
 #include 
 #include "include.h"
 
-#ifndef __dead /* Not NetBSD */
-#define __dead
-#endif
-
 int main(int, char *[]);
 void Error(const char *, const char *) __dead;
 double drandom(void);



CVS commit: src/sys/netinet

2009-05-27 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed May 27 17:41:03 UTC 2009

Modified Files:
src/sys/netinet: tcp_sack.c tcp_subr.c tcp_var.h

Log Message:
POOL_INIT -> pool_init


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/netinet/tcp_sack.c
cvs rdiff -u -r1.236 -r1.237 src/sys/netinet/tcp_subr.c
cvs rdiff -u -r1.159 -r1.160 src/sys/netinet/tcp_var.h

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

Modified files:

Index: src/sys/netinet/tcp_sack.c
diff -u src/sys/netinet/tcp_sack.c:1.24 src/sys/netinet/tcp_sack.c:1.25
--- src/sys/netinet/tcp_sack.c:1.24	Mon Apr 28 20:24:09 2008
+++ src/sys/netinet/tcp_sack.c	Wed May 27 17:41:03 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: tcp_sack.c,v 1.24 2008/04/28 20:24:09 martin Exp $ */
+/* $NetBSD: tcp_sack.c,v 1.25 2009/05/27 17:41:03 pooka Exp $ */
 
 /*
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -102,7 +102,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tcp_sack.c,v 1.24 2008/04/28 20:24:09 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_sack.c,v 1.25 2009/05/27 17:41:03 pooka Exp $");
 
 #include "opt_inet.h"
 #include "opt_ipsec.h"
@@ -163,8 +163,15 @@
 #include 
 
 /* SACK block pool. */
-static POOL_INIT(sackhole_pool, sizeof(struct sackhole), 0, 0, 0, "sackholepl",
-NULL, IPL_SOFTNET);
+static struct pool sackhole_pool;
+
+void
+tcp_sack_init()
+{
+
+	pool_init(&sackhole_pool, sizeof(struct sackhole), 0, 0, 0,
+	"sackholepl", NULL, IPL_SOFTNET);
+}
 
 static struct sackhole *
 sack_allochole(struct tcpcb *tp)

Index: src/sys/netinet/tcp_subr.c
diff -u src/sys/netinet/tcp_subr.c:1.236 src/sys/netinet/tcp_subr.c:1.237
--- src/sys/netinet/tcp_subr.c:1.236	Wed Mar 18 16:00:22 2009
+++ src/sys/netinet/tcp_subr.c	Wed May 27 17:41:03 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: tcp_subr.c,v 1.236 2009/03/18 16:00:22 cegger Exp $	*/
+/*	$NetBSD: tcp_subr.c,v 1.237 2009/05/27 17:41:03 pooka Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tcp_subr.c,v 1.236 2009/03/18 16:00:22 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_subr.c,v 1.237 2009/05/27 17:41:03 pooka Exp $");
 
 #include "opt_inet.h"
 #include "opt_ipsec.h"
@@ -410,6 +410,9 @@
 	/* Initialize reassembly queue */
 	tcpipqent_init();
 
+	/* SACK */
+	tcp_sack_init();
+
 	MOWNER_ATTACH(&tcp_tx_mowner);
 	MOWNER_ATTACH(&tcp_rx_mowner);
 	MOWNER_ATTACH(&tcp_reass_mowner);

Index: src/sys/netinet/tcp_var.h
diff -u src/sys/netinet/tcp_var.h:1.159 src/sys/netinet/tcp_var.h:1.160
--- src/sys/netinet/tcp_var.h:1.159	Thu Jan 29 20:38:22 2009
+++ src/sys/netinet/tcp_var.h	Wed May 27 17:41:03 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: tcp_var.h,v 1.159 2009/01/29 20:38:22 pooka Exp $	*/
+/*	$NetBSD: tcp_var.h,v 1.160 2009/05/27 17:41:03 pooka Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -885,6 +885,7 @@
 tcp_seq  tcp_new_iss1(void *, void *, u_int16_t, u_int16_t, size_t,
 	tcp_seq);
 
+void	 tcp_sack_init(void);
 void	 tcp_new_dsack(struct tcpcb *, tcp_seq, u_int32_t);
 void	 tcp_sack_option(struct tcpcb *, const struct tcphdr *,
 	const u_char *, int);



CVS commit: src/usr.bin/calendar/calendars

2009-05-27 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed May 27 17:17:04 UTC 2009

Modified Files:
src/usr.bin/calendar/calendars: calendar.birthday calendar.holiday

Log Message:
Fix some longstanding typos and remove an entry that is both redundant
and wrong at the same time.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/usr.bin/calendar/calendars/calendar.birthday
cvs rdiff -u -r1.18 -r1.19 src/usr.bin/calendar/calendars/calendar.holiday

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/calendar/calendars/calendar.birthday
diff -u src/usr.bin/calendar/calendars/calendar.birthday:1.17 src/usr.bin/calendar/calendars/calendar.birthday:1.18
--- src/usr.bin/calendar/calendars/calendar.birthday:1.17	Mon Aug 18 15:11:42 2008
+++ src/usr.bin/calendar/calendars/calendar.birthday	Wed May 27 17:17:03 2009
@@ -48,7 +48,7 @@
 02/15	Galileo Galilei born in Pisa, Italy, 1564
 02/15	Susan B. Anthony born, 1820
 02/16	Pierre Bouguer born, 1698, founder of photometry
-02/17	Federick Eugene Ives born, 1856, pioneer of halftone
+02/17	Frederick Eugene Ives born, 1856, pioneer of halftone
 02/17	Marion Anderson born, 1902
 02/17	T. J. Watson, Sr. born, 1874
 02/18	Ernst Mach born, 1838, philosopher & optics pioneer
@@ -242,7 +242,7 @@
 11/26	Norbert Wiener born in Columbia, Missouri, 1894
 11/29	John Mayall born in Cheshire, England, 1933
 11/30	Cleopatra died, 30 BC
-11/30	Mark Twain (Samuel Clemmens) born in Florida, Missouri, 1835
+11/30	Mark Twain (Samuel Clemens) born in Florida, Missouri, 1835
 12/01	Woody Allen (Allen Stuart Konigsberg) born in Brooklyn, NY, 1935
 12/04	Tommy Bolin dies of a heroin overdose in Miami, 1976
 12/05	Walt (Walter Elias) Disney born in Chicago, 1901

Index: src/usr.bin/calendar/calendars/calendar.holiday
diff -u src/usr.bin/calendar/calendars/calendar.holiday:1.18 src/usr.bin/calendar/calendars/calendar.holiday:1.19
--- src/usr.bin/calendar/calendars/calendar.holiday:1.18	Wed Sep 10 01:39:00 2008
+++ src/usr.bin/calendar/calendars/calendar.holiday	Wed May 27 17:17:04 2009
@@ -82,7 +82,7 @@
 03/19	St. Joseph's Day in Colombia, Costa Rica, Holy See, Liechtenstein,
 	San Marino, Spain, Venezuela
 03/19	Tree Planting Day in Lestho
-03/20	Independence Day in Tunsia
+03/20	Independence Day in Tunisia
 03/20	Youth Day in Oklahoma
 03/21	Afghan New Year in Afghanistan
 03/21	Juarez' Birthday in Mexico
@@ -221,7 +221,7 @@
 07/01	Dominion Day in Canada
 07/01	Freedom Day in Suriname
 07/01	Independence Day in Burundi
-07/01	National Day in Rwamda
+07/01	National Day in Rwanda
 07/01	Republic Day in Ghana
 07/02	National Day in Kiribati
 07/04	Caribbean Day in Guyana
@@ -334,7 +334,6 @@
 09/24	Republic Day in Trinidad, Tobago
 09/25	Army Day in Mozambique
 09/25	Referendum Day in Rwanda
-09/26	National Day in Maldives, Yemem Democratic Republic
 09/26	Revolution Anniversary Day in Yemen Arab
 09/28	Confucius' Day in Taiwan
 09/30	Botswana Day in Botswana
@@ -345,7 +344,7 @@
 10/01	National Liberation Day (2 days) in China
 10/01	Public Holiday in Botswana
 10/03	National Foundation Day in South Korea
-10/03	U.N. Day in Varbados
+10/03	U.N. Day in Barbados
 10/03	German Reunification Day in Germany
 10/04	Independence Day in Lesotho
 10/06	National Sports Day in Lesotho
@@ -486,7 +485,7 @@
 06/16	Bloomsday - Anniversary of Dublin events, 1904, in "Ulysses"
 06/18	Queen's Birthday in Fiji
 06/19	Artigas Birthday in Uruguay
-06/22	Corrective Movement in Yermen Democratic Republic
+06/22	Corrective Movement in Yemen Democratic Republic
 06/22	Midsummer Eve in Finland, Sweden
 06/24	Battle of Carabobob in Venezuela
 07/01	Union of the Somalia Republic in Somalia



CVS commit: src/sys/dev/sbus

2009-05-27 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed May 27 15:13:22 UTC 2009

Modified Files:
src/sys/dev/sbus: p9100.c

Log Message:
use pmf, while there do some cleanup, fix typos etc.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/dev/sbus/p9100.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/dev/sbus/p9100.c
diff -u src/sys/dev/sbus/p9100.c:1.44 src/sys/dev/sbus/p9100.c:1.45
--- src/sys/dev/sbus/p9100.c:1.44	Wed May 27 00:35:34 2009
+++ src/sys/dev/sbus/p9100.c	Wed May 27 15:13:22 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: p9100.c,v 1.44 2009/05/27 00:35:34 macallan Exp $ */
+/*	$NetBSD: p9100.c,v 1.45 2009/05/27 15:13:22 macallan Exp $ */
 
 /*-
  * Copyright (c) 1998, 2005, 2006 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: p9100.c,v 1.44 2009/05/27 00:35:34 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: p9100.c,v 1.45 2009/05/27 15:13:22 macallan Exp $");
 
 #include 
 #include 
@@ -71,11 +71,12 @@
 
 #include "opt_wsemul.h"
 #include "rasops_glue.h"
+#include "opt_pnozz.h"
 
 #include "tctrl.h"
 #if NTCTRL > 0
 #include 
-#include /*XXX*/
+#include 	/*XXX*/
 #endif
 
 #ifdef PNOZZ_DEBUG
@@ -106,17 +107,12 @@
 	bus_size_t	sc_ctl_psize;	/*   for device mmap() */
 	bus_space_handle_t sc_ctl_memh;	/*   bus space handle */
 
-#if 0
-	bus_addr_t	sc_cmd_paddr;	/* phys address description */
-	bus_size_t	sc_cmd_psize;	/*   for device mmap() */
-	bus_space_handle_t sc_cmd_memh;	/*   bus space handle */
-#endif
 	bus_addr_t	sc_fb_paddr;	/* phys address description */
 	bus_size_t	sc_fb_psize;	/*   for device mmap() */
 	bus_space_handle_t sc_fb_memh;	/*   bus space handle */
 
 	volatile uint32_t sc_junk;
-	uint32_t sc_mono_width;	/* for setup_mono */
+	uint32_t 	sc_mono_width;	/* for setup_mono */
 
 	uint32_t	sc_width;
 	uint32_t	sc_height;	/* panel width / height */
@@ -128,11 +124,12 @@
 
 	struct pnozz_cursor sc_cursor;
 
-	int sc_mode;
-	int sc_video, sc_powerstate;
-	uint32_t sc_bg;
+	int 		sc_mode;
+	int 		sc_video, sc_powerstate;
+	uint32_t 	sc_bg;
 	volatile uint32_t sc_last_offset;
 	struct vcons_data vd;
+	uint8_t		sc_dac_power;
 };
 
 
@@ -154,7 +151,8 @@
 };
 
 struct wsscreen_list p9100_screenlist = {
-	sizeof(_p9100_scrlist) / sizeof(struct wsscreen_descr *), _p9100_scrlist
+	sizeof(_p9100_scrlist) / sizeof(struct wsscreen_descr *),
+	_p9100_scrlist
 };
 
 /* autoconfiguration driver */
@@ -162,7 +160,6 @@
 static void	p9100_sbus_attach(device_t, device_t, void *);
 
 static void	p9100unblank(device_t);
-static void	p9100_shutdown(void *);
 
 CFATTACH_DECL_NEW(pnozz, sizeof(struct p9100_softc),
 p9100_sbus_match, p9100_sbus_attach, NULL, NULL);
@@ -220,8 +217,6 @@
 static void	p9100_cursor(void *, int, int, int);
 static int	p9100_allocattr(void *, int, int, int, long *);
 
-/*static void	p9100_scroll(void *, void *, int);*/
-
 static int	p9100_putcmap(struct p9100_softc *, struct wsdisplay_cmap *);
 static int 	p9100_getcmap(struct p9100_softc *, struct wsdisplay_cmap *);
 static int	p9100_ioctl(void *, void *, u_long, void *, int, struct lwp *);
@@ -230,7 +225,7 @@
 /*static int	p9100_load_font(void *, void *, struct wsdisplay_font *);*/
 
 static void	p9100_init_screen(void *, struct vcons_screen *, int,
-	long *);
+		long *);
 #endif
 
 static void	p9100_init_cursor(struct p9100_softc *);
@@ -244,7 +239,8 @@
 #endif
 
 /* power management stuff */
-static void p9100_power_hook(int, void *);
+static bool p9100_suspend(device_t PMF_FN_PROTO);
+static bool p9100_resume(device_t PMF_FN_PROTO);
 
 #if NTCTRL > 0
 static void p9100_set_extvga(void *, int);
@@ -308,8 +304,7 @@
 	/*
 	 * When the ROM has mapped in a p9100 display, the address
 	 * maps only the video RAM, so in any case we have to map the
-	 * registers ourselves.  We only need the video RAM if we are
-	 * going to print characters via rconsole.
+	 * registers ourselves.
 	 */
 
 	if (sa->sa_npromvaddrs != 0)
@@ -340,12 +335,20 @@
 		return;
 	}
 
+	/*
+	 * we need to map the framebuffer even though we never write to it,
+	 * thanks to some weirdness in the SPARCbook's SBus glue for the
+	 * P9100 - all register accesses need to be 'latched in' whenever we
+	 * go to another 0x80 aligned 'page' by reading the framebuffer at the
+	 * same offset
+	 */
 	if (fb->fb_pixels == NULL) {
 		if (sbus_bus_map(sc->sc_bustag,
 		sa->sa_reg[2].oa_space,
 		sa->sa_reg[2].oa_base,
 		sc->sc_fb_psize,
-		BUS_SPACE_MAP_LINEAR, &sc->sc_fb_memh) != 0) {
+		BUS_SPACE_MAP_LINEAR | BUS_SPACE_MAP_LARGE,
+		&sc->sc_fb_memh) != 0) {
 			printf("%s: cannot map framebuffer\n",
 			self->dv_xname);
 			return;
@@ -382,77 +385,9 @@
 	}
 #endif
 
-	/*
-	 * When the ROM has mapped in a p9100 display, the address
-	 * maps only the video RAM, so in any case we have to map the
-	 * registers ourselves.  We only need the video RAM if we are
-	

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

2009-05-27 Thread Alistair G. Crooks
Module Name:src
Committed By:   agc
Date:   Wed May 27 14:42:07 UTC 2009

Modified Files:
src/crypto/external/bsd/netpgp/dist/tests: testsuite.at verify.at
Added Files:
src/crypto/external/bsd/netpgp/dist/tests: crypt.at detached.at

Log Message:
Add tests for detached signature creation and verification, and for
encryption and decryption via netpgp.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/crypto/external/bsd/netpgp/dist/tests/crypt.at \
src/crypto/external/bsd/netpgp/dist/tests/detached.at
cvs rdiff -u -r1.2 -r1.3 \
src/crypto/external/bsd/netpgp/dist/tests/testsuite.at
cvs rdiff -u -r1.3 -r1.4 src/crypto/external/bsd/netpgp/dist/tests/verify.at

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/tests/testsuite.at
diff -u src/crypto/external/bsd/netpgp/dist/tests/testsuite.at:1.2 src/crypto/external/bsd/netpgp/dist/tests/testsuite.at:1.3
--- src/crypto/external/bsd/netpgp/dist/tests/testsuite.at:1.2	Wed May 27 06:47:57 2009
+++ src/crypto/external/bsd/netpgp/dist/tests/testsuite.at	Wed May 27 14:42:07 2009
@@ -1,6 +1,8 @@
-# $NetBSD: testsuite.at,v 1.2 2009/05/27 06:47:57 lukem Exp $
+# $NetBSD: testsuite.at,v 1.3 2009/05/27 14:42:07 agc Exp $
 
 AT_INIT([netpgp])
 
 m4_include([init.at])
 m4_include([verify.at])
+m4_include([detached.at])
+m4_include([crypt.at])

Index: src/crypto/external/bsd/netpgp/dist/tests/verify.at
diff -u src/crypto/external/bsd/netpgp/dist/tests/verify.at:1.3 src/crypto/external/bsd/netpgp/dist/tests/verify.at:1.4
--- src/crypto/external/bsd/netpgp/dist/tests/verify.at:1.3	Wed May 27 07:00:32 2009
+++ src/crypto/external/bsd/netpgp/dist/tests/verify.at	Wed May 27 14:42:07 2009
@@ -1,6 +1,6 @@
-# $NetBSD: verify.at,v 1.3 2009/05/27 07:00:32 lukem Exp $
+# $NetBSD: verify.at,v 1.4 2009/05/27 14:42:07 agc Exp $
 
-AT_SETUP([check-verify])
+AT_SETUP([check signatures and verification])
 
 cp ${TOPSRCDIR}/configure file1
 
@@ -13,6 +13,10 @@
 AT_CHECK([$NETPGP --homedir $testhomedir --verify file1.gpg],
 [0], [ignore], [ignore])
 
+# Cat the verified file
+AT_CHECK([$NETPGP --homedir $testhomedir --cat --output=file2 file1.gpg],
+[0], [ignore], [ignore])
+
 # Fail to verify an unsigned file
 # XXX: determine how to expand $testuserid instead of hard-coding
 AT_CHECK([$NETPGP --homedir $testhomedir --verify file1],
@@ -21,7 +25,4 @@
 "file1": No signatures found - is this a signed file?
 ])
 
-# XXXTODO: deliberately corrupt file1.gpg and attempt to verify
-
-
 AT_CLEANUP

Added files:

Index: src/crypto/external/bsd/netpgp/dist/tests/crypt.at
diff -u /dev/null src/crypto/external/bsd/netpgp/dist/tests/crypt.at:1.1
--- /dev/null	Wed May 27 14:42:07 2009
+++ src/crypto/external/bsd/netpgp/dist/tests/crypt.at	Wed May 27 14:42:07 2009
@@ -0,0 +1,27 @@
+# $NetBSD: crypt.at,v 1.1 2009/05/27 14:42:07 agc Exp $
+
+AT_SETUP([encryption and decryption])
+
+cp ${TOPSRCDIR}/configure file1
+
+# Sign the file
+# XXX: this prompts for a passphrase when the userid doesn't have one
+AT_CHECK([$NETPGP --homedir $testhomedir --encrypt file1],
+[0], [ignore], [ignore])
+
+# Verify the signed file
+AT_CHECK([$NETPGP --homedir $testhomedir --decrypt file1.gpg],
+[0], [ignore], [ignore])
+
+# Fail to verify an unsigned file
+# XXX: determine how to expand $testuserid instead of hard-coding
+#AT_CHECK([$NETPGP --homedir $testhomedir --decrypt file1],
+#[1], [ignore],
+#[netpgp: default key set to "C7AB5F325F918728"
+#"file1": No signatures found - is this an encrypted file?
+#])
+
+# XXXTODO: deliberately corrupt file1.gpg and attempt to verify
+
+
+AT_CLEANUP
Index: src/crypto/external/bsd/netpgp/dist/tests/detached.at
diff -u /dev/null src/crypto/external/bsd/netpgp/dist/tests/detached.at:1.1
--- /dev/null	Wed May 27 14:42:07 2009
+++ src/crypto/external/bsd/netpgp/dist/tests/detached.at	Wed May 27 14:42:07 2009
@@ -0,0 +1,17 @@
+# $NetBSD: detached.at,v 1.1 2009/05/27 14:42:07 agc Exp $
+
+AT_SETUP([detached signature and verification])
+
+cp ${TOPSRCDIR}/configure file2
+
+# Detached signature
+AT_CHECK([$NETPGP --homedir $testhomedir --sign --detached file2],
+[0], [ignore], [ignore])
+
+# Verify detached sig file
+AT_CHECK([$NETPGP --homedir $testhomedir --verify file2.sig],
+[0], [ignore], [ignore])
+
+# XXXTODO: deliberately corrupt file2.gpg and attempt to verify
+
+AT_CLEANUP



CVS commit: src/sys/compat/linux/arch/amd64

2009-05-27 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Wed May 27 12:20:37 UTC 2009

Modified Files:
src/sys/compat/linux/arch/amd64: linux_siginfo.h

Log Message:
Use correct linux_clock_t type for _stime, not native clock_t.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/compat/linux/arch/amd64/linux_siginfo.h

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

Modified files:

Index: src/sys/compat/linux/arch/amd64/linux_siginfo.h
diff -u src/sys/compat/linux/arch/amd64/linux_siginfo.h:1.4 src/sys/compat/linux/arch/amd64/linux_siginfo.h:1.5
--- src/sys/compat/linux/arch/amd64/linux_siginfo.h:1.4	Sun Nov 23 23:48:48 2008
+++ src/sys/compat/linux/arch/amd64/linux_siginfo.h	Wed May 27 12:20:37 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_siginfo.h,v 1.4 2008/11/23 23:48:48 njoly Exp $ */
+/*	$NetBSD: linux_siginfo.h,v 1.5 2009/05/27 12:20:37 njoly Exp $ */
 
 /*-
  * Copyright (c) 2005 Emmanuel Dreyfus, all rights reserved.
@@ -69,7 +69,7 @@
 			linux_uid_t _uid;
 			int _status;
 			linux_clock_t _utime;
-			clock_t _stime;
+			linux_clock_t _stime;
 		} _sigchld;
 
 		struct {



CVS commit: src/sys/sys

2009-05-27 Thread YAMAMOTO Takashi
Module Name:src
Committed By:   yamt
Date:   Wed May 27 12:15:11 UTC 2009

Modified Files:
src/sys/sys: proc.h

Log Message:
add comments on KSTACK_LOWEST_ADDR/KSTACK_SIZE.


To generate a diff of this commit:
cvs rdiff -u -r1.289 -r1.290 src/sys/sys/proc.h

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

Modified files:

Index: src/sys/sys/proc.h
diff -u src/sys/sys/proc.h:1.289 src/sys/sys/proc.h:1.290
--- src/sys/sys/proc.h:1.289	Thu May 14 23:12:14 2009
+++ src/sys/sys/proc.h	Wed May 27 12:15:11 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: proc.h,v 1.289 2009/05/14 23:12:14 yamt Exp $	*/
+/*	$NetBSD: proc.h,v 1.290 2009/05/27 12:15:11 yamt Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -556,11 +556,20 @@
  * kernel stack paramaters
  * XXX require sizeof(struct user)
  */
-/* the lowest address of kernel stack */
+/*
+ * KSTACK_LOWEST_ADDR: return the lowest address of the lwp's kernel stack,
+ * excluding redzone etc.
+ *
+ * if  provides the MD definition, it will be used.
+ */
 #ifndef KSTACK_LOWEST_ADDR
 #define	KSTACK_LOWEST_ADDR(l)	((void *)ALIGN((l)->l_addr + 1))
 #endif
-/* size of kernel stack */
+/*
+ * KSTACK_SIZE: the size kernel stack for a lwp, excluding redzone etc.
+ *
+ * if  provides the MD definition, it will be used.
+ */
 #ifndef KSTACK_SIZE
 #define	KSTACK_SIZE	(USPACE - ALIGN(sizeof(struct user)))
 #endif



CVS commit: src/sys/sys

2009-05-27 Thread YAMAMOTO Takashi
Module Name:src
Committed By:   yamt
Date:   Wed May 27 12:08:36 UTC 2009

Modified Files:
src/sys/sys: lwp.h

Log Message:
add a comment about USER_TO_UAREA/UAREA_TO_USER.


To generate a diff of this commit:
cvs rdiff -u -r1.118 -r1.119 src/sys/sys/lwp.h

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

Modified files:

Index: src/sys/sys/lwp.h
diff -u src/sys/sys/lwp.h:1.118 src/sys/sys/lwp.h:1.119
--- src/sys/sys/lwp.h:1.118	Sat May 23 17:08:05 2009
+++ src/sys/sys/lwp.h	Wed May 27 12:08:35 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: lwp.h,v 1.118 2009/05/23 17:08:05 ad Exp $	*/
+/*	$NetBSD: lwp.h,v 1.119 2009/05/27 12:08:35 yamt Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -181,6 +181,14 @@
 	uint64_t*l_syscall_counter; /* !: counter for current process */
 };
 
+/*
+ * USER_TO_UAREA/UAREA_TO_USER: macros to convert between
+ * the lowest address of the uarea (UAREA) and lwp::l_addr (USER).
+ *
+ * the default is just a cast.  MD code can modify it by defining
+ * either these macros or UAREA_USER_OFFSET in .
+ */
+
 #if !defined(USER_TO_UAREA)
 #if !defined(UAREA_USER_OFFSET)
 #define	UAREA_USER_OFFSET	0



CVS commit: src/distrib/notes/common

2009-05-27 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Wed May 27 09:40:01 UTC 2009

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

Log Message:
Fix warning, s/.lt/.It/ for list item.


To generate a diff of this commit:
cvs rdiff -u -r1.447 -r1.448 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.447 src/distrib/notes/common/main:1.448
--- src/distrib/notes/common/main:1.447	Mon Apr 27 00:07:06 2009
+++ src/distrib/notes/common/main	Wed May 27 09:40:01 2009
@@ -1,4 +1,4 @@
-.\"	$NetBSD: main,v 1.447 2009/04/27 00:07:06 snj Exp $
+.\"	$NetBSD: main,v 1.448 2009/05/27 09:40:01 njoly Exp $
 .\"
 .\" Copyright (c) 1999-2008 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -1416,7 +1416,7 @@
 .It Ta Paul Vixie Ta Mt vi...@netbsd.org
 .It Ta Mike M. Volokhov Ta Mt mis...@netbsd.org
 .It Ta Krister Walfridsson Ta Mt krist...@netbsd.org
-.lt Ta Mark Weinem Ta Mt wei...@netbsd.org
+.It Ta Mark Weinem Ta Mt wei...@netbsd.org
 .It Ta Lex Wennmacher Ta Mt wennm...@netbsd.org
 .It Ta Leo Weppelman Ta Mt l...@netbsd.org
 .It Ta Assar Westerlund Ta Mt as...@netbsd.org



CVS commit: src/sys/arch/hp700

2009-05-27 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed May 27 09:30:14 UTC 2009

Modified Files:
src/sys/arch/hp700/hp700: mainbus.c
src/sys/arch/hp700/include: iomod.h

Log Message:
s/FLEX_MASK/HPPA_&/ for consistency.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/hp700/hp700/mainbus.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/hp700/include/iomod.h

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

Modified files:

Index: src/sys/arch/hp700/hp700/mainbus.c
diff -u src/sys/arch/hp700/hp700/mainbus.c:1.51 src/sys/arch/hp700/hp700/mainbus.c:1.52
--- src/sys/arch/hp700/hp700/mainbus.c:1.51	Sun May 24 15:27:08 2009
+++ src/sys/arch/hp700/hp700/mainbus.c	Wed May 27 09:30:14 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: mainbus.c,v 1.51 2009/05/24 15:27:08 skrll Exp $	*/
+/*	$NetBSD: mainbus.c,v 1.52 2009/05/27 09:30:14 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.51 2009/05/24 15:27:08 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.52 2009/05/27 09:30:14 skrll Exp $");
 
 #include "locators.h"
 #include "power.h"
@@ -1521,11 +1521,11 @@
 	/*
 	 * Local-Broadcast the HPA to all modules on the bus
 	 */
-	((struct iomod *)(pdc_hpa.hpa & FLEX_MASK))[FPA_IOMOD].io_flex =
-		(void *)((pdc_hpa.hpa & FLEX_MASK) | DMA_ENABLE);
+	((struct iomod *)(pdc_hpa.hpa & HPPA_FLEX_MASK))[FPA_IOMOD].io_flex =
+		(void *)((pdc_hpa.hpa & HPPA_FLEX_MASK) | DMA_ENABLE);
 
 	sc->sc_hpa = pdc_hpa.hpa;
-	aprint_normal(" [flex %lx]\n", pdc_hpa.hpa & FLEX_MASK);
+	aprint_normal(" [flex %lx]\n", pdc_hpa.hpa & HPPA_FLEX_MASK);
 
 	/* PDC first */
 	memset(&nca, 0, sizeof(nca));

Index: src/sys/arch/hp700/include/iomod.h
diff -u src/sys/arch/hp700/include/iomod.h:1.5 src/sys/arch/hp700/include/iomod.h:1.6
--- src/sys/arch/hp700/include/iomod.h:1.5	Thu Apr 30 07:01:27 2009
+++ src/sys/arch/hp700/include/iomod.h	Wed May 27 09:30:14 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: iomod.h,v 1.5 2009/04/30 07:01:27 skrll Exp $	*/
+/*	$NetBSD: iomod.h,v 1.6 2009/05/27 09:30:14 skrll Exp $	*/
 
 /*	$OpenBSD: iomod.h,v 1.18 2007/10/20 16:41:45 miod Exp $	*/
 
@@ -123,8 +123,8 @@
 #define	FPA_IOMOD	((FPA_HIGH-FPA_LOW)/sizeof(struct iomod))
 #define	MAXMODBUS	((int)(FPA_IOMOD))	/* maximum modules/bus */
 
-#define	FLEX_MASK	0xFFFC	/* (see below) */
-#define	HPPA_FLEX(a)	(((a) & FLEX_MASK) >> 18)
+#define	HPPA_FLEX_MASK	0xFFFC	/* (see below) */
+#define	HPPA_FLEX(a)	(((a) & HPPA_FLEX_MASK) >> 18)
 
 /* size of HPA space for any device */
 #define	IOMOD_HPASIZE	0x1000



CVS commit: othersrc/bin/fsu_ecp

2009-05-27 Thread Arnaud Ysmal
Module Name:othersrc
Committed By:   stacktic
Date:   Wed May 27 07:29:48 UTC 2009

Modified Files:
othersrc/bin/fsu_ecp: fsu_ecp.c

Log Message:
Updated usage()


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 othersrc/bin/fsu_ecp/fsu_ecp.c

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

Modified files:

Index: othersrc/bin/fsu_ecp/fsu_ecp.c
diff -u othersrc/bin/fsu_ecp/fsu_ecp.c:1.7 othersrc/bin/fsu_ecp/fsu_ecp.c:1.8
--- othersrc/bin/fsu_ecp/fsu_ecp.c:1.7	Tue Apr 14 20:12:51 2009
+++ othersrc/bin/fsu_ecp/fsu_ecp.c	Wed May 27 07:29:47 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: fsu_ecp.c,v 1.7 2009/04/14 20:12:51 stacktic Exp $ */
+/* $NetBSD: fsu_ecp.c,v 1.8 2009/05/27 07:29:47 stacktic Exp $ */
 
 /*
  * Copyright (c) 2008 Arnaud Ysmal.  All Rights Reserved.
@@ -790,8 +790,8 @@
 usage(void)
 {
 
-	fprintf(stderr,	"usage: %s %s [-gPpRv] src target\n"
-		"usage: %s %s [-gPpRv] src... directory\n",
+	fprintf(stderr,	"usage: %s %s [-gLpRv] src target\n"
+		"usage: %s %s [-gLpRv] src... directory\n",
 		getprogname(), fsu_mount_usage(),
 		getprogname(), fsu_mount_usage());
 



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

2009-05-27 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Wed May 27 07:00:32 UTC 2009

Modified Files:
src/crypto/external/bsd/netpgp/dist/tests: verify.at

Log Message:
Ensure we can't verify an unsigned file
Rename a test filename
Add some comments


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/crypto/external/bsd/netpgp/dist/tests/verify.at

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/tests/verify.at
diff -u src/crypto/external/bsd/netpgp/dist/tests/verify.at:1.2 src/crypto/external/bsd/netpgp/dist/tests/verify.at:1.3
--- src/crypto/external/bsd/netpgp/dist/tests/verify.at:1.2	Wed May 27 06:47:57 2009
+++ src/crypto/external/bsd/netpgp/dist/tests/verify.at	Wed May 27 07:00:32 2009
@@ -1,13 +1,27 @@
-# $NetBSD: verify.at,v 1.2 2009/05/27 06:47:57 lukem Exp $
+# $NetBSD: verify.at,v 1.3 2009/05/27 07:00:32 lukem Exp $
 
 AT_SETUP([check-verify])
 
-cp ${TOPSRCDIR}/configure a
+cp ${TOPSRCDIR}/configure file1
 
-AT_CHECK([$NETPGP --homedir $testhomedir --sign a],
+# Sign the file
+# XXX: this prompts for a passphrase when the userid doesn't have one
+AT_CHECK([$NETPGP --homedir $testhomedir --sign file1],
 [0], [ignore], [ignore])
 
-AT_CHECK([$NETPGP --homedir $testhomedir --verify a.gpg],
+# Verify the signed file
+AT_CHECK([$NETPGP --homedir $testhomedir --verify file1.gpg],
 [0], [ignore], [ignore])
 
+# Fail to verify an unsigned file
+# XXX: determine how to expand $testuserid instead of hard-coding
+AT_CHECK([$NETPGP --homedir $testhomedir --verify file1],
+[1], [ignore],
+[netpgp: default key set to "C7AB5F325F918728"
+"file1": No signatures found - is this a signed file?
+])
+
+# XXXTODO: deliberately corrupt file1.gpg and attempt to verify
+
+
 AT_CLEANUP