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

2010-11-07 Thread Alistair G. Crooks
Module Name:src
Committed By:   agc
Date:   Sun Nov  7 06:56:53 UTC 2010

Modified Files:
src/crypto/external/bsd/netpgp/dist/src/lib: crypto.c crypto.h
openssl_crypto.c packet-parse.c

Log Message:
Add Elgamal decryption to netpgp.  Inspired by (BSD-licensed) the
Elgamal decryption code from Postgresql by Marko Kreen.

% cp config.h f
% netpgp -e f
netpgp: default key set to d4a643c5
% netpgp -d  f.gpg  f.netpgp
netpgp: default key set to d4a643c5
signature  1024/DSA 8222c3ecd4a643c5 2010-05-19 [EXPIRES 2013-05-18]
Key fingerprint: 3e4a 5df4 033b 2333 219b 1afd 8222 c3ec d4a6 43c5
uid  Alistair Crooks (DSA TEST KEY - DO NOT USE) a...@netbsd.org
encryption 2048/Elgamal (Encrypt-Only) a97a7db6d727bc1e 2010-05-19 [EXPIRES 
2013-05-18]
netpgp passphrase:
% ls -al f*
-rw-r--r--  1 agc  agc  5730 Nov  6 23:53 f
-rw---  1 agc  agc  1727 Nov  6 23:53 f.gpg
-rw-r--r--  1 agc  agc  5730 Nov  6 23:54 f.netpgp
% diff f f.netpgp
%

This makes DSA keys into first class citizens, since encryption and
decryption using DSA/Elgamal is now supported.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 \
src/crypto/external/bsd/netpgp/dist/src/lib/crypto.c
cvs rdiff -u -r1.25 -r1.26 \
src/crypto/external/bsd/netpgp/dist/src/lib/crypto.h
cvs rdiff -u -r1.31 -r1.32 \
src/crypto/external/bsd/netpgp/dist/src/lib/openssl_crypto.c
cvs rdiff -u -r1.43 -r1.44 \
src/crypto/external/bsd/netpgp/dist/src/lib/packet-parse.c

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

Modified files:

Index: src/crypto/external/bsd/netpgp/dist/src/lib/crypto.c
diff -u src/crypto/external/bsd/netpgp/dist/src/lib/crypto.c:1.30 src/crypto/external/bsd/netpgp/dist/src/lib/crypto.c:1.31
--- src/crypto/external/bsd/netpgp/dist/src/lib/crypto.c:1.30	Sun Nov  7 02:29:28 2010
+++ src/crypto/external/bsd/netpgp/dist/src/lib/crypto.c	Sun Nov  7 06:56:52 2010
@@ -54,7 +54,7 @@
 
 #if defined(__NetBSD__)
 __COPYRIGHT(@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.);
-__RCSID($NetBSD: crypto.c,v 1.30 2010/11/07 02:29:28 agc Exp $);
+__RCSID($NetBSD: crypto.c,v 1.31 2010/11/07 06:56:52 agc Exp $);
 #endif
 
 #include sys/types.h
@@ -86,12 +86,14 @@
 int 
 __ops_decrypt_decode_mpi(uint8_t *buf,
 unsigned buflen,
+const BIGNUM *g_to_k,
 const BIGNUM *encmpi,
 const __ops_seckey_t *seckey)
 {
 	unsignedmpisize;
 	uint8_t		encmpibuf[NETPGP_BUFSIZ];
 	uint8_t		mpibuf[NETPGP_BUFSIZ];
+	uint8_t		gkbuf[NETPGP_BUFSIZ];
 	int i;
 	int n;
 
@@ -101,10 +103,9 @@
 		(void) fprintf(stderr, mpisize too big %u\n, mpisize);
 		return -1;
 	}
-	BN_bn2bin(encmpi, encmpibuf);
-
 	switch (seckey-pubkey.alg) {
 	case OPS_PKA_RSA:
+		BN_bn2bin(encmpi, encmpibuf);
 		if (__ops_get_debug_level(__FILE__)) {
 			hexdump(stderr, encrypted, encmpibuf, 16);
 		}
@@ -143,12 +144,13 @@
 		return n - i;
 	case OPS_PKA_DSA:
 	case OPS_PKA_ELGAMAL:
-		(void) fprintf(stderr, XXX - preliminary support for DSA/Elgamal\n);
+		(void) BN_bn2bin(g_to_k, gkbuf);
+		(void) BN_bn2bin(encmpi, encmpibuf);
 		if (__ops_get_debug_level(__FILE__)) {
 			hexdump(stderr, encrypted, encmpibuf, 16);
 		}
-		n = __ops_elgamal_private_decrypt(mpibuf, encmpibuf,
-	(unsigned)(BN_num_bits(encmpi) + 7) / 8,
+		n = __ops_elgamal_private_decrypt(mpibuf, gkbuf, encmpibuf,
+	(unsigned)BN_num_bytes(encmpi),
 	seckey-key.elgamal, seckey-pubkey.key.elgamal);
 		if (n == -1) {
 			(void) fprintf(stderr, ops_elgamal_private_decrypt failure\n);
@@ -161,13 +163,15 @@
 			return -1;
 		}
 		/* Decode EME-PKCS1_V1_5 (RFC 2437). */
-		if (mpibuf[0] != 0 || mpibuf[1] != 2) {
+		if (mpibuf[0] != 2) {
+			fprintf(stderr, mpibuf mismatch\n);
 			return -1;
 		}
 		/* Skip the random bytes. */
-		for (i = 2; i  n  mpibuf[i]; ++i) {
+		for (i = 1; i  n  mpibuf[i]; ++i) {
 		}
 		if (i == n || i  10) {
+			fprintf(stderr, 175 n %d\n, n);
 			return -1;
 		}
 		/* Skip the zero */

Index: src/crypto/external/bsd/netpgp/dist/src/lib/crypto.h
diff -u src/crypto/external/bsd/netpgp/dist/src/lib/crypto.h:1.25 src/crypto/external/bsd/netpgp/dist/src/lib/crypto.h:1.26
--- src/crypto/external/bsd/netpgp/dist/src/lib/crypto.h:1.25	Sun Nov  7 02:29:28 2010
+++ src/crypto/external/bsd/netpgp/dist/src/lib/crypto.h	Sun Nov  7 06:56:52 2010
@@ -131,7 +131,7 @@
 
 int __ops_elgamal_public_encrypt(uint8_t *, uint8_t *, const uint8_t *, size_t,
 			const __ops_elgamal_pubkey_t *);
-int __ops_elgamal_private_decrypt(uint8_t *, const uint8_t *, size_t,
+int __ops_elgamal_private_decrypt(uint8_t *, const uint8_t *, const uint8_t *, size_t,
 			const __ops_elgamal_seckey_t *, const __ops_elgamal_pubkey_t *);
 
 __ops_symm_alg_t __ops_str_to_cipher(const char *);
@@ -159,7 +159,8 @@
 void __ops_reader_pop_hash(__ops_stream_t *);
 
 int __ops_decrypt_decode_mpi(uint8_t *, unsigned, const BIGNUM *,
-			const __ops_seckey_t *);
+			const BIGNUM *, 

CVS commit: src/share/man/man4

2010-11-07 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Nov  7 11:50:58 UTC 2010

Modified Files:
src/share/man/man4: schide.4

Log Message:
Remove superfluous Pp.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/man/man4/schide.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/schide.4
diff -u src/share/man/man4/schide.4:1.1 src/share/man/man4/schide.4:1.2
--- src/share/man/man4/schide.4:1.1	Sun Nov  7 01:12:22 2010
+++ src/share/man/man4/schide.4	Sun Nov  7 11:50:58 2010
@@ -1,4 +1,4 @@
-.\	$NetBSD: schide.4,v 1.1 2010/11/07 01:12:22 jakllsch Exp $
+.\	$NetBSD: schide.4,v 1.2 2010/11/07 11:50:58 wiz Exp $
 .\
 .\ Copyright (c) 2003 Manuel Bouyer.
 .\
@@ -37,7 +37,6 @@
 with the hardware for the
 .Xr ata 4
 driver.
-.Pp
 .Sh SEE ALSO
 .Xr ata 4 ,
 .Xr atapi 4 ,



CVS commit: src/share/man/man8/man8.i386

2010-11-07 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Nov  7 12:01:08 UTC 2010

Modified Files:
src/share/man/man8/man8.i386: boot.8

Log Message:
Minor cleanup.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/share/man/man8/man8.i386/boot.8

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/man8/man8.i386/boot.8
diff -u src/share/man/man8/man8.i386/boot.8:1.53 src/share/man/man8/man8.i386/boot.8:1.54
--- src/share/man/man8/man8.i386/boot.8:1.53	Sat Nov  6 23:28:42 2010
+++ src/share/man/man8/man8.i386/boot.8	Sun Nov  7 12:01:07 2010
@@ -1,4 +1,4 @@
-.\	$NetBSD: boot.8,v 1.53 2010/11/06 23:28:42 jym Exp $
+.\	$NetBSD: boot.8,v 1.54 2010/11/07 12:01:07 wiz Exp $
 .\
 .\ Copyright (c) 1991, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -393,7 +393,8 @@
 .Tn Xen
 DOM0 kernel before booting the
 .Tn Xen
-hypervisor. See
+hypervisor.
+See
 .Xr boot.cfg 5
 for examples.
 .Pp
@@ -402,24 +403,24 @@
 options specified above, the DOM0 kernel accepts
 .Po Ar arguments
 being separated with spaces
-.Pc Ns :
+.Pc :
 .Bl -tag -width xxx
 .It Ic bootdev Ns = Ns Ar dev Po or Ic root Ns = Ns Ar dev Pc
 Override the default boot device.
 .Ar dev
 can be a unit name
 .Po Dq wd0
-.Pc Ns ,
+.Pc ,
 or an interface name
 .Po Dq bge0 ,
 .Dq wm0 ,
 .Ns ...
-.Pc Ns ,
+.Pc ,
 for cases where the root file system has to be loaded
 from network (see the
 .Sx BUGS
 section in
-.Xr pxeboot 8 Ns ).
+.Xr pxeboot 8 ) .
 .It Ic console Ns = Ns Ar dev
 Console used by DOM0 kernel during boot.
 .Ar dev 
@@ -450,7 +451,7 @@
 address of the host
 .It Va iface
 interface
-.Po eg. Dq xennet0
+.Po e.g. Dq xennet0
 or
 .Dq eth0
 .Pc
@@ -465,8 +466,8 @@
 Pass a list of PCI IDs for use with the PCI backend driver.
 .Ar pcidevs
 is formed of multiple IDs (in bus:device:function notation),
-each ID being surrounded with brackets. PCI domain IDs
-are currently ignored.
+each ID being surrounded with brackets.
+PCI domain IDs are currently ignored.
 You can obtains PCI IDs through
 .Xr pcictl 8 .
 .El



CVS commit: src/share/man/man4

2010-11-07 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Nov  7 11:51:15 UTC 2010

Modified Files:
src/share/man/man4: pciide.4

Log Message:
Bump date for schide(4).


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/share/man/man4/pciide.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/pciide.4
diff -u src/share/man/man4/pciide.4:1.64 src/share/man/man4/pciide.4:1.65
--- src/share/man/man4/pciide.4:1.64	Sun Nov  7 01:12:22 2010
+++ src/share/man/man4/pciide.4	Sun Nov  7 11:51:14 2010
@@ -1,4 +1,4 @@
-.\	$NetBSD: pciide.4,v 1.64 2010/11/07 01:12:22 jakllsch Exp $
+.\	$NetBSD: pciide.4,v 1.65 2010/11/07 11:51:14 wiz Exp $
 .\
 .\ Copyright (c) 1998,2003 Manuel Bouyer.
 .\
@@ -22,7 +22,7 @@
 .\ INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd May 29, 2008
+.Dd November 7, 2010
 .Dt PCIIDE 4
 .Os
 .Sh NAME



CVS commit: src/external/gpl3/binutils/usr.sbin/mdsetimage

2010-11-07 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Nov  7 11:50:23 UTC 2010

Modified Files:
src/external/gpl3/binutils/usr.sbin/mdsetimage: mdsetimage.8

Log Message:
Sort options.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/gpl3/binutils/usr.sbin/mdsetimage/mdsetimage.8

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

Modified files:

Index: src/external/gpl3/binutils/usr.sbin/mdsetimage/mdsetimage.8
diff -u src/external/gpl3/binutils/usr.sbin/mdsetimage/mdsetimage.8:1.2 src/external/gpl3/binutils/usr.sbin/mdsetimage/mdsetimage.8:1.3
--- src/external/gpl3/binutils/usr.sbin/mdsetimage/mdsetimage.8:1.2	Sat Nov  6 16:03:23 2010
+++ src/external/gpl3/binutils/usr.sbin/mdsetimage/mdsetimage.8	Sun Nov  7 11:50:23 2010
@@ -1,4 +1,4 @@
-.\	$NetBSD: mdsetimage.8,v 1.2 2010/11/06 16:03:23 uebayasi Exp $
+.\	$NetBSD: mdsetimage.8,v 1.3 2010/11/07 11:50:23 wiz Exp $
 .\
 .\ Copyright (c) 1996 Christopher G. Demetriou
 .\ All rights reserved.
@@ -36,9 +36,9 @@
 .Sh SYNOPSIS
 .Nm
 .Op Fl svx
+.Op Fl b Ar bfdname
 .Op Fl I Ar image_symbol
 .Op Fl S Ar size_symbol
-.Op Fl b Ar bfdname
 .Ar kernel
 .Ar image
 .Sh DESCRIPTION
@@ -53,6 +53,10 @@
 will typically be used by the kernel
 as the root file system.
 .Pp
+To recognize kernel executable format, the
+.Fl b
+flag specifies BFD name of kernel.
+.Pp
 The
 .Fl I
 and
@@ -60,10 +64,6 @@
 flags specify the symbol names of image and size of memory disk
 drivers respectively.
 .Pp
-To recognize kernel executable format, the
-.Fl b
-flag specifies BFD name of kernel.
-.Pp
 If the
 .Fl s
 flags is given,



CVS commit: src/usr.sbin/mdsetimage

2010-11-07 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Nov  7 11:49:21 UTC 2010

Modified Files:
src/usr.sbin/mdsetimage: mdsetimage.8

Log Message:
Sort options in SYNOPSIS.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/mdsetimage/mdsetimage.8

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

Modified files:

Index: src/usr.sbin/mdsetimage/mdsetimage.8
diff -u src/usr.sbin/mdsetimage/mdsetimage.8:1.10 src/usr.sbin/mdsetimage/mdsetimage.8:1.11
--- src/usr.sbin/mdsetimage/mdsetimage.8:1.10	Sat Nov  6 16:03:23 2010
+++ src/usr.sbin/mdsetimage/mdsetimage.8	Sun Nov  7 11:49:21 2010
@@ -1,4 +1,4 @@
-.\ $NetBSD: mdsetimage.8,v 1.10 2010/11/06 16:03:23 uebayasi Exp $
+.\ $NetBSD: mdsetimage.8,v 1.11 2010/11/07 11:49:21 wiz Exp $
 .\
 .\ Copyright (c) 1996 Christopher G. Demetriou
 .\ All rights reserved.
@@ -35,10 +35,10 @@
 .Nd set kernel RAM disk image
 .Sh SYNOPSIS
 .Nm
+.Op Fl v
 .Op Fl I Ar image_symbol
 .Op Fl S Ar size_symbol
 .Op Fl T Ar address
-.Op Fl v
 .Ar kernel
 .Ar image
 .Sh DESCRIPTION



CVS commit: src/share/man/man4

2010-11-07 Thread Grégoire Sutre
Module Name:src
Committed By:   gsutre
Date:   Sun Nov  7 14:56:51 UTC 2010

Modified Files:
src/share/man/man4: acpi.4

Log Message:
Note fujitsu(4).


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/share/man/man4/acpi.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/acpi.4
diff -u src/share/man/man4/acpi.4:1.61 src/share/man/man4/acpi.4:1.62
--- src/share/man/man4/acpi.4:1.61	Wed Oct 27 14:39:26 2010
+++ src/share/man/man4/acpi.4	Sun Nov  7 14:56:51 2010
@@ -1,4 +1,4 @@
-.\ $NetBSD: acpi.4,v 1.61 2010/10/27 14:39:26 gsutre Exp $
+.\ $NetBSD: acpi.4,v 1.62 2010/11/07 14:56:51 gsutre Exp $
 .\
 .\ Copyright (c) 2002, 2004, 2010 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -24,7 +24,7 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd October 24, 2010
+.Dd November 7, 2010
 .Dt ACPI 4
 .Os
 .Sh NAME
@@ -241,6 +241,8 @@
 NS8250-, NS16450-, and NS16550-based serial ports.
 .It Xr fdc 4
 Floppy disk controllers.
+.It Xr fujitsu 4
+Fujitsu brightness, pointer, and hotkeys.
 .It Xr hpet 4
 High Precision Event Timer
 .Pq Tn HPET .



CVS commit: xsrc/external/mit/xf86-input-keyboard/dist/src

2010-11-07 Thread Izumi Tsutsui
Module Name:xsrc
Committed By:   tsutsui
Date:   Sun Nov  7 15:44:04 UTC 2010

Modified Files:
xsrc/external/mit/xf86-input-keyboard/dist/src: bsd_kbd.c

Log Message:
Recognize WSKBD_TYPE_MAPLE for dreamcast.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 \
xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_kbd.c

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

Modified files:

Index: xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_kbd.c
diff -u xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_kbd.c:1.9 xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_kbd.c:1.10
--- xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_kbd.c:1.9	Fri Oct 29 10:51:41 2010
+++ xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_kbd.c	Sun Nov  7 15:44:04 2010
@@ -431,6 +431,11 @@
printWsType(ADB, pInfo-name);
break;
 #endif
+#ifdef WSKBD_TYPE_MAPLE
+   case WSKBD_TYPE_MAPLE:
+   printWsType(Maple, pInfo-name);
+   break;
+#endif
 #ifdef WSKBD_TYPE_SUN
case WSKBD_TYPE_SUN:
printWsType(Sun, pInfo-name);



CVS commit: xsrc/external/mit/xf86-input-keyboard/dist/src

2010-11-07 Thread Izumi Tsutsui
Module Name:xsrc
Committed By:   tsutsui
Date:   Sun Nov  7 15:48:18 UTC 2010

Modified Files:
xsrc/external/mit/xf86-input-keyboard/dist/src: bsd_KbdMap.c

Log Message:
Use existing wscons USB keymap for WSKBD_TYPE_MAPLE on dreamcast.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_KbdMap.c

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

Modified files:

Index: xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_KbdMap.c
diff -u xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_KbdMap.c:1.2 xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_KbdMap.c:1.3
--- xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_KbdMap.c:1.2	Wed Oct 22 03:16:28 2008
+++ xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_KbdMap.c	Sun Nov  7 15:48:17 2010
@@ -1297,6 +1297,9 @@
 pKbd-scancodeMap = wsXt;
 break;
 	   case WSKBD_TYPE_USB:
+#ifdef WSKBD_TYPE_MAPLE
+	   case WSKBD_TYPE_MAPLE:
+#endif
 pKbd-scancodeMap = wsUsb;
 break;
 #ifdef WSKBD_TYPE_ADB	



CVS commit: [uebayasi-xip] src

2010-11-07 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sun Nov  7 16:34:11 UTC 2010

Modified Files:
src/external/gpl3/binutils/usr.sbin/mdsetimage [uebayasi-xip]:
mdsetimage.8
src/usr.sbin/mdsetimage [uebayasi-xip]: mdsetimage.8

Log Message:
Sort options.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 \
src/external/gpl3/binutils/usr.sbin/mdsetimage/mdsetimage.8
cvs rdiff -u -r1.9.48.1 -r1.9.48.2 src/usr.sbin/mdsetimage/mdsetimage.8

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

Modified files:

Index: src/external/gpl3/binutils/usr.sbin/mdsetimage/mdsetimage.8
diff -u src/external/gpl3/binutils/usr.sbin/mdsetimage/mdsetimage.8:1.1.2.1 src/external/gpl3/binutils/usr.sbin/mdsetimage/mdsetimage.8:1.1.2.2
--- src/external/gpl3/binutils/usr.sbin/mdsetimage/mdsetimage.8:1.1.2.1	Thu Nov  4 07:29:59 2010
+++ src/external/gpl3/binutils/usr.sbin/mdsetimage/mdsetimage.8	Sun Nov  7 16:34:10 2010
@@ -1,4 +1,4 @@
-.\	$NetBSD: mdsetimage.8,v 1.1.2.1 2010/11/04 07:29:59 uebayasi Exp $
+.\	$NetBSD: mdsetimage.8,v 1.1.2.2 2010/11/07 16:34:10 uebayasi Exp $
 .\
 .\ Copyright (c) 1996 Christopher G. Demetriou
 .\ All rights reserved.
@@ -36,9 +36,9 @@
 .Sh SYNOPSIS
 .Nm
 .Op Fl svx
+.Op Fl b Ar bfdname
 .Op Fl I Ar image_symbol
 .Op Fl S Ar size_symbol
-.Op Fl b Ar bfdname
 .Ar kernel
 .Ar image
 .Sh DESCRIPTION
@@ -53,6 +53,10 @@
 will typically be used by the kernel
 as the root file system.
 .Pp
+To recognize kernel executable format, the
+.Fl b
+flag specifies BFD name of kernel.
+.Pp
 The
 .Fl I
 and
@@ -60,10 +64,6 @@
 flags specify the symbol names of image and size of memory disk
 drivers respectively.
 .Pp
-To recognize kernel executable format, the
-.Fl b
-flag specifies BFD name of kernel.
-.Pp
 If the
 .Fl s
 flags is given,

Index: src/usr.sbin/mdsetimage/mdsetimage.8
diff -u src/usr.sbin/mdsetimage/mdsetimage.8:1.9.48.1 src/usr.sbin/mdsetimage/mdsetimage.8:1.9.48.2
--- src/usr.sbin/mdsetimage/mdsetimage.8:1.9.48.1	Thu Nov  4 07:30:00 2010
+++ src/usr.sbin/mdsetimage/mdsetimage.8	Sun Nov  7 16:34:11 2010
@@ -1,4 +1,4 @@
-.\ $NetBSD: mdsetimage.8,v 1.9.48.1 2010/11/04 07:30:00 uebayasi Exp $
+.\ $NetBSD: mdsetimage.8,v 1.9.48.2 2010/11/07 16:34:11 uebayasi Exp $
 .\
 .\ Copyright (c) 1996 Christopher G. Demetriou
 .\ All rights reserved.
@@ -35,10 +35,10 @@
 .Nd set kernel RAM disk image
 .Sh SYNOPSIS
 .Nm
+.Op Fl v
 .Op Fl I Ar image_symbol
 .Op Fl S Ar size_symbol
 .Op Fl T Ar address
-.Op Fl v
 .Ar kernel
 .Ar image
 .Sh DESCRIPTION



CVS commit: src/sys/dev/acpi

2010-11-07 Thread Grégoire Sutre
Module Name:src
Committed By:   gsutre
Date:   Sun Nov  7 16:36:26 UTC 2010

Modified Files:
src/sys/dev/acpi: acpi_display.c

Log Message:
Replace ACPI_UINT64 by ACPICA's ACPI_INTEGER.  Remove superfluous casts.
No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/acpi/acpi_display.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/acpi/acpi_display.c
diff -u src/sys/dev/acpi/acpi_display.c:1.6 src/sys/dev/acpi/acpi_display.c:1.7
--- src/sys/dev/acpi/acpi_display.c:1.6	Thu Nov  4 20:08:12 2010
+++ src/sys/dev/acpi/acpi_display.c	Sun Nov  7 16:36:26 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi_display.c,v 1.6 2010/11/04 20:08:12 jruoho Exp $	*/
+/*	$NetBSD: acpi_display.c,v 1.7 2010/11/07 16:36:26 gsutre Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: acpi_display.c,v 1.6 2010/11/04 20:08:12 jruoho Exp $);
+__KERNEL_RCSID(0, $NetBSD: acpi_display.c,v 1.7 2010/11/07 16:36:26 gsutre Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -85,9 +85,6 @@
 #define _COMPONENT		ACPI_DISPLAY_COMPONENT
 ACPI_MODULE_NAME		(acpi_display)
 
-/* Type for integer values that are passed to/from ACPICA. */
-#define ACPI_UINT64	uint64_t
-
 /* Notifications specific to display adapter devices (ACPI 4.0a, Sec. B.5). */
 #define ACPI_NOTIFY_CycleOutputDevice			0x80
 #define ACPI_NOTIFY_OutputDeviceStatusChange		0x81
@@ -1232,7 +1229,7 @@
 	int error;
 
 	node = *rnode;
-	asc = (struct acpidisp_vga_softc *)node.sysctl_data;
+	asc = node.sysctl_data;
 
 	mutex_enter(asc-sc_mtx);
 	val = (uint32_t)asc-sc_policy.raw;
@@ -1264,7 +1261,7 @@
 	int error;
 
 	node = *rnode;
-	asc = (struct acpidisp_vga_softc *)node.sysctl_data;
+	asc = node.sysctl_data;
 
 	mutex_enter(asc-sc_mtx);
 	val = (asc-sc_policy.fmt.output == ACPI_DISP_POLICY_OUTPUT_AUTO);
@@ -1296,7 +1293,7 @@
 	int error;
 
 	node = *rnode;
-	osc = (struct acpidisp_out_softc *)node.sysctl_data;
+	osc = node.sysctl_data;
 
 	mutex_enter(osc-sc_mtx);
 	error = acpidisp_get_status(osc, val);
@@ -1322,7 +1319,7 @@
 	int error;
 
 	node = *rnode;
-	osc = (struct acpidisp_out_softc *)node.sysctl_data;
+	osc = node.sysctl_data;
 
 	mutex_enter(osc-sc_mtx);
 	error = acpidisp_get_state(osc, val);
@@ -1354,7 +1351,7 @@
 	uint8_t lo, up, level;
 
 	node = *rnode;
-	osc = (struct acpidisp_out_softc *)node.sysctl_data;
+	osc = node.sysctl_data;
 	bc = osc-sc_brctl;
 
 	KASSERT(bc != NULL);
@@ -1509,7 +1506,7 @@
 	struct acpidisp_outdev *od;
 	struct acpi_devnode *ad;
 	ACPI_HANDLE hdl;
-	ACPI_UINT64 val;
+	ACPI_INTEGER val;
 	ACPI_STATUS rv;
 	uint16_t devid;
 	uint32_t i;
@@ -1705,7 +1702,7 @@
 acpidisp_set_policy(const struct acpidisp_vga_softc *asc, uint8_t value)
 {
 	ACPI_HANDLE hdl = asc-sc_node-ad_handle;
-	ACPI_UINT64 val;
+	ACPI_INTEGER val;
 	ACPI_STATUS rv;
 
 	ACPI_DEBUG_PRINT((ACPI_DB_INFO, %s: set %s: 0x%PRIx8\n,
@@ -1714,7 +1711,7 @@
 	if (!(asc-sc_caps  ACPI_DISP_VGA_CAP__DOS))
 		return ENODEV;
 
-	val = (ACPI_UINT64)value;
+	val = (ACPI_INTEGER)value;
 	rv = acpi_eval_set_integer(hdl, _DOS, val);
 	if (ACPI_FAILURE(rv)) {
 		aprint_error_dev(asc-sc_dev, failed to evaluate %s.%s: %s\n,
@@ -1729,7 +1726,7 @@
 acpidisp_get_status(const struct acpidisp_out_softc *osc, uint32_t *valuep)
 {
 	ACPI_HANDLE hdl = osc-sc_node-ad_handle;
-	ACPI_UINT64 val;
+	ACPI_INTEGER val;
 	ACPI_STATUS rv;
 
 	if (!(osc-sc_caps  ACPI_DISP_OUT_CAP__DCS))
@@ -1757,7 +1754,7 @@
 acpidisp_get_state(const struct acpidisp_out_softc *osc, uint32_t *valuep)
 {
 	ACPI_HANDLE hdl = osc-sc_node-ad_handle;
-	ACPI_UINT64 val;
+	ACPI_INTEGER val;
 	ACPI_STATUS rv;
 
 	if (!(osc-sc_caps  ACPI_DISP_OUT_CAP__DGS))
@@ -1785,7 +1782,7 @@
 acpidisp_set_state(const struct acpidisp_out_softc *osc, uint32_t value)
 {
 	ACPI_HANDLE hdl = osc-sc_node-ad_handle;
-	ACPI_UINT64 val;
+	ACPI_INTEGER val;
 	ACPI_STATUS rv;
 
 	ACPI_DEBUG_PRINT((ACPI_DB_INFO, %s: set %s: 0x%PRIx32\n,
@@ -1794,7 +1791,7 @@
 	if (!(osc-sc_caps  ACPI_DISP_OUT_CAP__DSS))
 		return ENODEV;
 
-	val = (ACPI_UINT64)value;
+	val = (ACPI_INTEGER)value;
 	rv = acpi_eval_set_integer(hdl, _DSS, val);
 	if (ACPI_FAILURE(rv)) {
 		aprint_error_dev(osc-sc_dev, failed to evaluate %s.%s: %s\n,
@@ -1809,7 +1806,7 @@
 acpidisp_get_brightness(const struct acpidisp_out_softc *osc, uint8_t *valuep)
 {
 	ACPI_HANDLE hdl = osc-sc_node-ad_handle;
-	ACPI_UINT64 val;
+	ACPI_INTEGER val;
 	ACPI_STATUS rv;
 
 	if (!(osc-sc_caps  ACPI_DISP_OUT_CAP__BQC))
@@ -1837,7 +1834,7 @@
 acpidisp_set_brightness(const struct acpidisp_out_softc *osc, uint8_t value)
 {
 	ACPI_HANDLE hdl = osc-sc_node-ad_handle;
-	ACPI_UINT64 val;
+	ACPI_INTEGER val;
 	ACPI_STATUS rv;
 
 	ACPI_DEBUG_PRINT((ACPI_DB_INFO, %s: set %s: %PRIu8\n,
@@ -1846,7 +1843,7 @@
 	if (!(osc-sc_caps  ACPI_DISP_OUT_CAP__BCM))
 		return ENODEV;
 
-	val = 

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

2010-11-07 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Sun Nov  7 17:43:34 UTC 2010

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

Log Message:
Import atf 0.12:

Experimental version released on November 7th, 2010.

* Added the ATF_REQUIRE_THROW_RE to atf-c++, which is the same as
  ATF_REQUIRE_THROW but allows checking for the validity of the exception's
  error message by means of a regular expression.

* Added the ATF_REQUIRE_MATCH to atf-c++, which allows checking for a
  regular expression match in a string.

* Changed the default timeout for test cases from 5 minutes to 30 seconds.
  30 seconds is long enough for virtually all tests to complete, and 5
  minutes is a way too long pause in a test suite where a single test case
  stalls.

* Deprecated the use.fs property.  While this seemed like a good idea in
  the first place to impose more control on what test cases can do, it
  turns out to be bad.  First, use.fs=false prevents bogus test cases
  from dumping core so after-the-fact debugging is harder.  Second,
  supporting use.fs adds a lot of unnecessary complexity.  atf-run will
  now ignore any value provided to use.fs and will allow test cases to
  freely access the file system if they wish to.

* Added the atf_tc_get_config_var_as_{bool,long}{,_wd} functions to the atf-c
  library.  The 'text' module became private in 0.11 but was being used
  externally to simplify the parsing of configuration variables.

* Made atf-run recognize the 'unprivileged-user' configuration variable
  and automatically drop root privileges when a test case sets
  require.user=unprivileged.  Note that this is, by no means, done for
  security purposes; this is just for user convenience; tests should, in
  general, not be blindly run as root in the first place.

Status:

Vendor Tag: TNF
Release Tags:   atf-0-12

U src/external/bsd/atf/dist/README
U src/external/bsd/atf/dist/atf-c.h
U src/external/bsd/atf/dist/atf-c++.hpp
U src/external/bsd/atf/dist/AUTHORS
U src/external/bsd/atf/dist/COPYING
U src/external/bsd/atf/dist/NEWS
U src/external/bsd/atf/dist/Atffile
U src/external/bsd/atf/dist/atf-c/error_fwd.h
U src/external/bsd/atf/dist/atf-c/build.h
U src/external/bsd/atf/dist/atf-c/check.h
U src/external/bsd/atf/dist/atf-c/config.h
U src/external/bsd/atf/dist/atf-c/error.h
U src/external/bsd/atf/dist/atf-c/atf-c-api.3
U src/external/bsd/atf/dist/atf-c/macros.h
U src/external/bsd/atf/dist/atf-c/tc.h
U src/external/bsd/atf/dist/atf-c/tp.h
U src/external/bsd/atf/dist/atf-c/utils.h
U src/external/bsd/atf/dist/atf-c/pkg_config_test.sh
U src/external/bsd/atf/dist/atf-c/defs.h.in
U src/external/bsd/atf/dist/atf-c/build.c
U src/external/bsd/atf/dist/atf-c/check.c
U src/external/bsd/atf/dist/atf-c/config.c
U src/external/bsd/atf/dist/atf-c/error.c
C src/external/bsd/atf/dist/atf-c/tc.c
U src/external/bsd/atf/dist/atf-c/tp.c
U src/external/bsd/atf/dist/atf-c/utils.c
U src/external/bsd/atf/dist/atf-c/h_build.h
U src/external/bsd/atf/dist/atf-c/atf_c_test.c
U src/external/bsd/atf/dist/atf-c/build_test.c
U src/external/bsd/atf/dist/atf-c/check_test.c
U src/external/bsd/atf/dist/atf-c/config_test.c
U src/external/bsd/atf/dist/atf-c/tc_test.c
U src/external/bsd/atf/dist/atf-c/error_test.c
U src/external/bsd/atf/dist/atf-c/macros_test.c
U src/external/bsd/atf/dist/atf-c/tp_test.c
U src/external/bsd/atf/dist/atf-c/utils_test.c
U src/external/bsd/atf/dist/atf-c/atf-c.pc.in
U src/external/bsd/atf/dist/atf-c/Atffile
U src/external/bsd/atf/dist/atf-c/macros_h_test.c
U src/external/bsd/atf/dist/atf-c/detail/process_helpers.c
U src/external/bsd/atf/dist/atf-c/detail/test_helpers.c
U src/external/bsd/atf/dist/atf-c/detail/test_helpers.h
U src/external/bsd/atf/dist/atf-c/detail/dynstr.c
U src/external/bsd/atf/dist/atf-c/detail/dynstr.h
U src/external/bsd/atf/dist/atf-c/detail/env.c
U src/external/bsd/atf/dist/atf-c/detail/env.h
U src/external/bsd/atf/dist/atf-c/detail/fs.c
U src/external/bsd/atf/dist/atf-c/detail/fs.h
U src/external/bsd/atf/dist/atf-c/detail/list.c
U src/external/bsd/atf/dist/atf-c/detail/list.h
U src/external/bsd/atf/dist/atf-c/detail/map.c
U src/external/bsd/atf/dist/atf-c/detail/map.h
U src/external/bsd/atf/dist/atf-c/detail/process.c
U src/external/bsd/atf/dist/atf-c/detail/process.h
U src/external/bsd/atf/dist/atf-c/detail/sanity.c
U src/external/bsd/atf/dist/atf-c/detail/sanity.h
U src/external/bsd/atf/dist/atf-c/detail/text.c
U src/external/bsd/atf/dist/atf-c/detail/text.h
U src/external/bsd/atf/dist/atf-c/detail/tp_main.c
U src/external/bsd/atf/dist/atf-c/detail/user.c
U src/external/bsd/atf/dist/atf-c/detail/user.h
U src/external/bsd/atf/dist/atf-c/detail/dynstr_test.c
U src/external/bsd/atf/dist/atf-c/detail/env_test.c
U src/external/bsd/atf/dist/atf-c/detail/fs_test.c
U src/external/bsd/atf/dist/atf-c/detail/list_test.c
U src/external/bsd/atf/dist/atf-c/detail/map_test.c
U src/external/bsd/atf/dist/atf-c/detail/test_helpers_test.c
U 

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

2010-11-07 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Sun Nov  7 17:45:22 UTC 2010

Modified Files:
src/external/bsd/atf/dist/atf-c: tc.c
src/external/bsd/atf/dist/atf-c++: tests.cpp tests.hpp
src/external/bsd/atf/dist/atf-run: atf-run.cpp io_test.cpp
test-program.cpp

Log Message:
Help merge of atf-0.12.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/atf/dist/atf-c/tc.c
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/atf/dist/atf-c++/tests.cpp
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/atf/dist/atf-c++/tests.hpp
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/atf/dist/atf-run/atf-run.cpp
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/atf/dist/atf-run/io_test.cpp
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/atf/dist/atf-run/test-program.cpp

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

Modified files:

Index: src/external/bsd/atf/dist/atf-c/tc.c
diff -u src/external/bsd/atf/dist/atf-c/tc.c:1.7 src/external/bsd/atf/dist/atf-c/tc.c:1.8
--- src/external/bsd/atf/dist/atf-c/tc.c:1.7	Wed Oct 20 09:17:22 2010
+++ src/external/bsd/atf/dist/atf-c/tc.c	Sun Nov  7 17:45:21 2010
@@ -642,6 +642,70 @@
 return val;
 }
 
+bool
+atf_tc_get_config_var_as_bool(const atf_tc_t *tc, const char *name)
+{
+bool val;
+const char *strval;
+atf_error_t err;
+
+strval = atf_tc_get_config_var(tc, name);
+err = atf_text_to_bool(strval, val);
+if (atf_is_error(err)) {
+atf_error_free(err);
+atf_tc_fail(Configuration variable %s does not have a valid 
+boolean value; found %s, name, strval);
+}
+
+return val;
+}
+
+bool
+atf_tc_get_config_var_as_bool_wd(const atf_tc_t *tc, const char *name,
+ const bool defval)
+{
+bool val;
+
+if (!atf_tc_has_config_var(tc, name))
+val = defval;
+else
+val = atf_tc_get_config_var_as_bool(tc, name);
+
+return val;
+}
+
+long
+atf_tc_get_config_var_as_long(const atf_tc_t *tc, const char *name)
+{
+long val;
+const char *strval;
+atf_error_t err;
+
+strval = atf_tc_get_config_var(tc, name);
+err = atf_text_to_long(strval, val);
+if (atf_is_error(err)) {
+atf_error_free(err);
+atf_tc_fail(Configuration variable %s does not have a valid 
+long value; found %s, name, strval);
+}
+
+return val;
+}
+
+long
+atf_tc_get_config_var_as_long_wd(const atf_tc_t *tc, const char *name,
+ const long defval)
+{
+long val;
+
+if (!atf_tc_has_config_var(tc, name))
+val = defval;
+else
+val = atf_tc_get_config_var_as_long(tc, name);
+
+return val;
+}
+
 const char *
 atf_tc_get_md_var(const atf_tc_t *tc, const char *name)
 {

Index: src/external/bsd/atf/dist/atf-c++/tests.cpp
diff -u src/external/bsd/atf/dist/atf-c++/tests.cpp:1.5 src/external/bsd/atf/dist/atf-c++/tests.cpp:1.6
--- src/external/bsd/atf/dist/atf-c++/tests.cpp:1.5	Wed Oct 20 09:17:23 2010
+++ src/external/bsd/atf/dist/atf-c++/tests.cpp	Sun Nov  7 17:45:22 2010
@@ -111,6 +111,16 @@
 }
 
 // 
+// Free helper functions.
+// 
+
+bool
+detail::match(const std::string regexp, const std::string str)
+{
+return atf::text::match(str, regexp);
+}
+
+// 
 // The tc class.
 // 
 

Index: src/external/bsd/atf/dist/atf-c++/tests.hpp
diff -u src/external/bsd/atf/dist/atf-c++/tests.hpp:1.4 src/external/bsd/atf/dist/atf-c++/tests.hpp:1.5
--- src/external/bsd/atf/dist/atf-c++/tests.hpp:1.4	Wed Oct 20 09:17:23 2010
+++ src/external/bsd/atf/dist/atf-c++/tests.hpp	Sun Nov  7 17:45:22 2010
@@ -34,6 +34,10 @@
 #include memory
 #include string
 
+extern C {
+#include atf-c/defs.h
+}
+
 #include atf-c++/utils.hpp
 
 namespace atf {
@@ -54,6 +58,8 @@
 void tc_meta_data(const std::string, const std::string);
 };
 
+bool match(const std::string, const std::string);
+
 } // namespace
 
 // 
@@ -99,10 +105,10 @@
 void run_cleanup(void) const;
 
 // To be called from the child process only.
-static void pass(void);
-static void fail(const std::string);
+static void pass(void) ATF_DEFS_ATTRIBUTE_NORETURN;
+static void fail(const std::string) ATF_DEFS_ATTRIBUTE_NORETURN;
 static void fail_nonfatal(const std::string);
-static void skip(const std::string);
+static void skip(const std::string) ATF_DEFS_ATTRIBUTE_NORETURN;
 static void check_errno(const char*, const int, const int, const char*,
 const bool);
 static void require_errno(const char*, const int, const int, const char*,


CVS commit: src/external/bsd/atf

2010-11-07 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Sun Nov  7 17:46:46 UTC 2010

Modified Files:
src/external/bsd/atf/etc/atf: Makefile NetBSD.conf
src/external/bsd/atf/lib/libatf-c: Makefile bconfig.h
src/external/bsd/atf/lib/libatf-c++: Makefile
src/external/bsd/atf/tests/atf/atf-run: Makefile
Added Files:
src/external/bsd/atf/etc/atf: common.conf

Log Message:
Adjust reachover build files after import of atf-0.12.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/atf/etc/atf/Makefile \
src/external/bsd/atf/etc/atf/NetBSD.conf
cvs rdiff -u -r0 -r1.1 src/external/bsd/atf/etc/atf/common.conf
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/atf/lib/libatf-c/Makefile
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/atf/lib/libatf-c/bconfig.h
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/atf/lib/libatf-c++/Makefile
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/atf/tests/atf/atf-run/Makefile

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

Modified files:

Index: src/external/bsd/atf/etc/atf/Makefile
diff -u src/external/bsd/atf/etc/atf/Makefile:1.2 src/external/bsd/atf/etc/atf/Makefile:1.3
--- src/external/bsd/atf/etc/atf/Makefile:1.2	Fri Jun  4 08:33:40 2010
+++ src/external/bsd/atf/etc/atf/Makefile	Sun Nov  7 17:46:45 2010
@@ -1,11 +1,11 @@
-# $NetBSD: Makefile,v 1.2 2010/06/04 08:33:40 jmmv Exp $
+# $NetBSD: Makefile,v 1.3 2010/11/07 17:46:45 jmmv Exp $
 
 .include bsd.own.mk
 
 SRCDIR=		${NETBSDSRCDIR}/external/bsd/atf/dist
 .PATH:		${SRCDIR}/atf-run/sample
 
-CONFIGFILES=	NetBSD.conf atf-run.hooks
+CONFIGFILES=	NetBSD.conf atf-run.hooks common.conf
 FILESDIR=	/etc/atf
 FILESMODE=	644
 
Index: src/external/bsd/atf/etc/atf/NetBSD.conf
diff -u src/external/bsd/atf/etc/atf/NetBSD.conf:1.2 src/external/bsd/atf/etc/atf/NetBSD.conf:1.3
--- src/external/bsd/atf/etc/atf/NetBSD.conf:1.2	Sat Jun 26 11:27:50 2010
+++ src/external/bsd/atf/etc/atf/NetBSD.conf	Sun Nov  7 17:46:45 2010
@@ -7,8 +7,5 @@
 # details on the NetBSD test suite.
 #
 
-# When running the test suite as root, some tests require to switch to
-# an unprivileged user to perform extra checks.  Set this variable to
-# the user you want to use in those cases.  If not set, those tests will
-# be skipped.
-#unprivileged-user = nobody
+#variable1 = value1
+#variable2 = value2

Index: src/external/bsd/atf/lib/libatf-c/Makefile
diff -u src/external/bsd/atf/lib/libatf-c/Makefile:1.7 src/external/bsd/atf/lib/libatf-c/Makefile:1.8
--- src/external/bsd/atf/lib/libatf-c/Makefile:1.7	Wed Oct 20 09:20:09 2010
+++ src/external/bsd/atf/lib/libatf-c/Makefile	Sun Nov  7 17:46:46 2010
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.7 2010/10/20 09:20:09 jmmv Exp $
+# $NetBSD: Makefile,v 1.8 2010/11/07 17:46:46 jmmv Exp $
 
 NOLINT=		# defined
 
@@ -84,7 +84,7 @@
 
 realall: atf-c.pc
 atf-c.pc: Makefile atf-c.pc.in
-	${TOOL_SED} -e 's,__ATF_VERSION__,0.11,g' \
+	${TOOL_SED} -e 's,__ATF_VERSION__,0.12,g' \
 	-e 's,__CC__,gcc,g' \
 	-e 's,__INCLUDEDIR__,/usr/include,g' \
 	-e 's,__LIBDIR__,/usr/lib,g' \

Index: src/external/bsd/atf/lib/libatf-c/bconfig.h
diff -u src/external/bsd/atf/lib/libatf-c/bconfig.h:1.6 src/external/bsd/atf/lib/libatf-c/bconfig.h:1.7
--- src/external/bsd/atf/lib/libatf-c/bconfig.h:1.6	Wed Oct 20 09:20:09 2010
+++ src/external/bsd/atf/lib/libatf-c/bconfig.h	Sun Nov  7 17:46:46 2010
@@ -1,15 +1,6 @@
 /* bconfig.h.  Generated from bconfig.h.in by configure.  */
 /* bconfig.h.in.  Generated from configure.ac by autoheader.  */
 
-/* Define to the path of chattr(1) if you have it */
-/* #undef CHATTR */
-
-/* Define to 1 if you have chattr(1) */
-/* #undef HAVE_CHATTR */
-
-/* Define to 1 if you have the `chflags' function. */
-#define HAVE_CHFLAGS 1
-
 /* Define to 1 if basename takes a constant pointer */
 /* #undef HAVE_CONST_BASENAME */
 
@@ -105,7 +96,7 @@
 #define PACKAGE_NAME Automated Testing Framework
 
 /* Define to the full name and version of this package. */
-#define PACKAGE_STRING Automated Testing Framework 0.11
+#define PACKAGE_STRING Automated Testing Framework 0.12
 
 /* Define to the one symbol short name of this package. */
 #define PACKAGE_TARNAME atf
@@ -114,10 +105,10 @@
 #define PACKAGE_URL http://www.NetBSD.org/~jmmv/atf/;
 
 /* Define to the version of this package. */
-#define PACKAGE_VERSION 0.11
+#define PACKAGE_VERSION 0.12
 
 /* Define to 1 if you have the ANSI C header files. */
 #define STDC_HEADERS 1
 
 /* Version number of package */
-#define VERSION 0.11
+#define VERSION 0.12

Index: src/external/bsd/atf/lib/libatf-c++/Makefile
diff -u src/external/bsd/atf/lib/libatf-c++/Makefile:1.5 src/external/bsd/atf/lib/libatf-c++/Makefile:1.6
--- src/external/bsd/atf/lib/libatf-c++/Makefile:1.5	Wed Oct 20 09:20:10 2010
+++ src/external/bsd/atf/lib/libatf-c++/Makefile	Sun Nov  7 17:46:46 2010
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.5 2010/10/20 09:20:10 jmmv Exp $
+# $NetBSD: Makefile,v 1.6 2010/11/07 

CVS commit: src/etc

2010-11-07 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Sun Nov  7 17:47:48 UTC 2010

Modified Files:
src/etc: group master.passwd

Log Message:
Add the _atf user and group to be able to run unprivileged tests automatically
without having to manually tweak the 'unprivileged-user' setting.  Suggested
by po...@.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/etc/group
cvs rdiff -u -r1.41 -r1.42 src/etc/master.passwd

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

Modified files:

Index: src/etc/group
diff -u src/etc/group:1.24 src/etc/group:1.25
--- src/etc/group:1.24	Tue Sep 29 23:56:27 2009
+++ src/etc/group	Sun Nov  7 17:47:47 2010
@@ -21,6 +21,7 @@
 _sdpd:*:23:
 _httpd:*:24:
 _mdnsd:*:25:
+_atf:*:26:
 guest:*:31:root
 nobody:*:39:
 utmp:*:45:

Index: src/etc/master.passwd
diff -u src/etc/master.passwd:1.41 src/etc/master.passwd:1.42
--- src/etc/master.passwd:1.41	Sun Oct  4 01:40:53 2009
+++ src/etc/master.passwd	Sun Nov  7 17:47:47 2010
@@ -15,5 +15,6 @@
 _sdpd:*:23:23::0:0: pseudo-user:/nonexistent:/sbin/nologin
 _httpd:*:24:24::0:0: pseudo-user:/var/www:/sbin/nologin
 _mdnsd:*:25:25::0:0: pseudo-user:/nonexistent:/sbin/nologin
+_atf:*:26:26::0:0: pseudo-user:/nonexistent:/sbin/nologin
 uucp:*:66:1::0:0:UNIX-to-UNIX Copy:/nonexistent:/sbin/nologin
 nobody:*:32767:39::0:0:Unprivileged user:/nonexistent:/sbin/nologin



CVS commit: src/distrib/sets/lists/etc

2010-11-07 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Sun Nov  7 17:48:41 UTC 2010

Modified Files:
src/distrib/sets/lists/etc: mi

Log Message:
Adjust file lists after atf-0.12 import


To generate a diff of this commit:
cvs rdiff -u -r1.216 -r1.217 src/distrib/sets/lists/etc/mi

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

Modified files:

Index: src/distrib/sets/lists/etc/mi
diff -u src/distrib/sets/lists/etc/mi:1.216 src/distrib/sets/lists/etc/mi:1.217
--- src/distrib/sets/lists/etc/mi:1.216	Fri Feb  5 09:44:23 2010
+++ src/distrib/sets/lists/etc/mi	Sun Nov  7 17:48:41 2010
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.216 2010/02/05 09:44:23 roy Exp $
+# $NetBSD: mi,v 1.217 2010/11/07 17:48:41 jmmv Exp $
 #
 # Note: end-user configuration files that are moved to another location
 #	should not be marked obsolete; they should just be removed from
@@ -15,6 +15,7 @@
 ./dev/MAKEDEV.subretc-obsolete		obsolete
 ./etc/atf/NetBSD.confetc-atf-etc		atf
 ./etc/atf/atf-run.hooksetc-atf-etc		atf
+./etc/atf/common.confetc-atf-etc		atf
 ./etc/audit-packages.conf			etc-obsolete		obsolete
 ./etc/bootptab	etc-bootserver-etc
 ./etc/changelistetc-sys-etc



CVS commit: src/share/man/man7

2010-11-07 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Sun Nov  7 17:49:33 UTC 2010

Modified Files:
src/share/man/man7: tests.7

Log Message:
Document configuration changes in tests(7); unprivileged-user is now set
out of the box and is set in 'common.conf', not 'NetBSD.conf'.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/share/man/man7/tests.7

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/man7/tests.7
diff -u src/share/man/man7/tests.7:1.3 src/share/man/man7/tests.7:1.4
--- src/share/man/man7/tests.7:1.3	Sat Jun 26 14:50:14 2010
+++ src/share/man/man7/tests.7	Sun Nov  7 17:49:33 2010
@@ -1,4 +1,4 @@
-.\	$NetBSD: tests.7,v 1.3 2010/06/26 14:50:14 wiz Exp $
+.\	$NetBSD: tests.7,v 1.4 2010/11/07 17:49:33 jmmv Exp $
 .\
 .\ Copyright (c) 2010 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -25,7 +25,7 @@
 .\ OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd June 26, 2010
+.Dd November 7, 2010
 .Dt TESTS 7
 .Os
 .Sh NAME
@@ -158,15 +158,11 @@
 .Nx
 test suite, you need to edit
 .Pa /etc/atf/NetBSD.conf .
+The suite-specific configuration file implicitly depends on
+.Pa /etc/atf/common.conf ,
+which contains properties shared among all test suites.
 These files conform to the configuration file format described in
 .Xr atf-formats 5 .
-.Pp
-The following properties are recognized:
-.Bl -tag -offset indent -width unprivilegedXuserXX
-.It Va unprivileged_user
-Specifies the name of a local, unprivileged user, that will be used by those
-tests that need to perform checks as non-root.
-.El
 .Ss What to do if something fails?
 If there is
 .Em any failure
@@ -188,6 +184,8 @@
 Configuration file for the
 .Nx
 test suite.
+.It Pa /etc/atf/common.conf
+Configuration file for all test suites.
 .It Pa /usr/tests/
 Location of the test suites.
 .El



CVS commit: src/doc

2010-11-07 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Sun Nov  7 17:51:52 UTC 2010

Modified Files:
src/doc: CHANGES

Log Message:
Note import of atf 0.12.


To generate a diff of this commit:
cvs rdiff -u -r1.1452 -r1.1453 src/doc/CHANGES

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
diff -u src/doc/CHANGES:1.1452 src/doc/CHANGES:1.1453
--- src/doc/CHANGES:1.1452	Sat Nov  6 21:16:14 2010
+++ src/doc/CHANGES	Sun Nov  7 17:51:52 2010
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1452 $
+# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1453 $
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -773,3 +773,4 @@
 		[gsutre 20101105]
 	schide(4): Add Intel SCH IDE driver from OpenBSD.
 		[jakllsch 20101106]
+	atf(7): Import 0.12.  [jmmv 20101107]



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

2010-11-07 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Sun Nov  7 17:54:03 UTC 2010

Modified Files:
src/external/bsd/atf/dist/atf-run: config_test.cpp integration_test.sh

Log Message:
Pull in post-release fix 3d5597b0076ade841abf03fc274da72d17cb3ad6 to resolve
issues with the default NetBSD settings.  Tests were producing invalid results
because they were unexpectedly reading the system-wide settings.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 \
src/external/bsd/atf/dist/atf-run/config_test.cpp
cvs rdiff -u -r1.1.1.3 -r1.2 \
src/external/bsd/atf/dist/atf-run/integration_test.sh

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

Modified files:

Index: src/external/bsd/atf/dist/atf-run/config_test.cpp
diff -u src/external/bsd/atf/dist/atf-run/config_test.cpp:1.1.1.2 src/external/bsd/atf/dist/atf-run/config_test.cpp:1.2
--- src/external/bsd/atf/dist/atf-run/config_test.cpp:1.1.1.2	Wed Oct 20 09:14:23 2010
+++ src/external/bsd/atf/dist/atf-run/config_test.cpp	Sun Nov  7 17:54:03 2010
@@ -27,7 +27,9 @@
 // IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 //
 
+#include atf-c++/detail/env.hpp
 #include atf-c++/detail/test_helpers.hpp
+#include atf-c++/config.hpp
 #include atf-c++/macros.hpp
 
 #include config.hpp
@@ -37,6 +39,14 @@
 
 using atf::tests::vars_map;
 
+namespace atf {
+namespace config {
+
+void __reinit(void);
+
+}  // namespace config
+}  // namespace atf
+
 // -
 // Tests for the config parser.
 // -
@@ -351,6 +361,8 @@
 ATF_TEST_CASE(read_config_files_none);
 ATF_TEST_CASE_HEAD(read_config_files_none) {}
 ATF_TEST_CASE_BODY(read_config_files_none) {
+atf::env::set(ATF_CONFDIR, .);
+atf::config::__reinit();
 ATF_REQUIRE(vars_map() == impl::read_config_files(test-suite));
 }
 

Index: src/external/bsd/atf/dist/atf-run/integration_test.sh
diff -u src/external/bsd/atf/dist/atf-run/integration_test.sh:1.1.1.3 src/external/bsd/atf/dist/atf-run/integration_test.sh:1.2
--- src/external/bsd/atf/dist/atf-run/integration_test.sh:1.1.1.3	Sun Nov  7 17:43:28 2010
+++ src/external/bsd/atf/dist/atf-run/integration_test.sh	Sun Nov  7 17:54:03 2010
@@ -29,6 +29,8 @@
 
 create_atffile()
 {
+ATF_CONFDIR=$(pwd); export ATF_CONFDIR
+
 cat Atffile EOF
 Content-Type: application/X-atf-atffile; version=1
 



CVS commit: src/sys/compat/sys

2010-11-07 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Sun Nov  7 19:45:06 UTC 2010

Modified Files:
src/sys/compat/sys: sockio.h

Log Message:
If someone wants to define COMPAT_OIFDATA / COMPAT_OIFREQ outside
of config, let them.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/compat/sys/sockio.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/sys/sockio.h
diff -u src/sys/compat/sys/sockio.h:1.8 src/sys/compat/sys/sockio.h:1.9
--- src/sys/compat/sys/sockio.h:1.8	Sat Nov 28 22:11:42 2009
+++ src/sys/compat/sys/sockio.h	Sun Nov  7 19:45:06 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: sockio.h,v 1.8 2009/11/28 22:11:42 dsl Exp $	*/
+/*	$NetBSD: sockio.h,v 1.9 2010/11/07 19:45:06 pooka Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1990, 1993, 1994
@@ -52,11 +52,6 @@
 #define COMPAT_OIFDATA
 #endif
 
-#else /* !_KERNEL_OPT */
-
-#undef COMPAT_OIFREQ
-#undef COMPAT_OIFDATA
-
 #endif /* _KERNEL_OPT */
 
 struct oifreq {



CVS commit: src/sys/rump/net/lib/libnet

2010-11-07 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Sun Nov  7 19:47:19 UTC 2010

Modified Files:
src/sys/rump/net/lib/libnet: Makefile

Log Message:
support compat ioctl's (OlalaSIOC stuff)


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/rump/net/lib/libnet/Makefile

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/net/lib/libnet/Makefile
diff -u src/sys/rump/net/lib/libnet/Makefile:1.7 src/sys/rump/net/lib/libnet/Makefile:1.8
--- src/sys/rump/net/lib/libnet/Makefile:1.7	Sat Dec 12 17:10:19 2009
+++ src/sys/rump/net/lib/libnet/Makefile	Sun Nov  7 19:47:18 2010
@@ -1,16 +1,18 @@
-#	$NetBSD: Makefile,v 1.7 2009/12/12 17:10:19 pooka Exp $
+#	$NetBSD: Makefile,v 1.8 2010/11/07 19:47:18 pooka Exp $
 #
 
-.PATH:	${.CURDIR}/../../../../net
+.PATH:	${.CURDIR}/../../../../net ${.CURDIR}/../../../../compat/common
 
 LIB=	rumpnet_net
 
 # iffy stuff
 SRCS=	if.c if_loop.c route.c rtsock.c raw_usrreq.c raw_cb.c		\
 	if_media.c link_proto.c net_stats.c if_ethersubr.c
+SRCS+=	if_43.c uipc_syscalls_50.c
 SRCS+=	component.c
 
 CPPFLAGS+=	-I${.CURDIR}/opt -I${.CURDIR}/../libnetinet/opt
+CPPFLAGS+=	-DCOMPAT_OIFREQ -DCOMPAT_OIFDATA
 
 .include ${.CURDIR}/../libnetinet/Makefile.inc
 



CVS commit: src/tests/net

2010-11-07 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Sun Nov  7 19:53:42 UTC 2010

Modified Files:
src/tests/net: Makefile
Added Files:
src/tests/net/if: Makefile t_compat.c

Log Message:
convert program in PR kern/44054 to an atf test case


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/net/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/net/if/Makefile src/tests/net/if/t_compat.c

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

Modified files:

Index: src/tests/net/Makefile
diff -u src/tests/net/Makefile:1.6 src/tests/net/Makefile:1.7
--- src/tests/net/Makefile:1.6	Tue Aug 10 21:55:28 2010
+++ src/tests/net/Makefile	Sun Nov  7 19:53:42 2010
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.6 2010/08/10 21:55:28 pooka Exp $
+# $NetBSD: Makefile,v 1.7 2010/11/07 19:53:42 pooka Exp $
 
 .include bsd.own.mk
 
 TESTSDIR=	${TESTSBASE}/net
 
-TESTS_SUBDIRS=		bpf carp icmp if_loop sys
+TESTS_SUBDIRS=		bpf carp icmp if if_loop sys
 
 .include bsd.test.mk

Added files:

Index: src/tests/net/if/Makefile
diff -u /dev/null src/tests/net/if/Makefile:1.1
--- /dev/null	Sun Nov  7 19:53:42 2010
+++ src/tests/net/if/Makefile	Sun Nov  7 19:53:42 2010
@@ -0,0 +1,13 @@
+# $NetBSD: Makefile,v 1.1 2010/11/07 19:53:42 pooka Exp $
+#
+
+.include bsd.own.mk
+
+TESTSDIR=	${TESTSBASE}/net/if
+
+TESTS_C=	t_compat
+
+LDADD+=		-lrumpnet_shmif -lrumpnet_netinet -lrumpnet_net -lrumpnet -lrump
+LDADD+=		-lrumpuser -lpthread
+
+.include bsd.test.mk
Index: src/tests/net/if/t_compat.c
diff -u /dev/null src/tests/net/if/t_compat.c:1.1
--- /dev/null	Sun Nov  7 19:53:42 2010
+++ src/tests/net/if/t_compat.c	Sun Nov  7 19:53:42 2010
@@ -0,0 +1,83 @@
+/*	$NetBSD: t_compat.c,v 1.1 2010/11/07 19:53:42 pooka Exp $	*/
+
+#include sys/socket.h
+#include sys/ioctl.h
+#include net/if.h
+#include netinet/in.h
+
+#include string.h
+#include stdio.h
+#include stdlib.h
+
+#include rump/rump.h
+#include rump/rump_syscalls.h
+
+#include ../config/netconfig.c
+
+/*
+ * Test for stack smashing in compat ioctl handling.  Adapted as an
+ * atf test from code provided by Onno van der Linden in PR kern/44054
+ */
+
+struct oifreq {
+charifr_name[IFNAMSIZ]; /* if name, e.g. en0 */
+union {
+struct  sockaddr ifru_addr;
+struct  sockaddr ifru_dstaddr;
+struct  sockaddr ifru_broadaddr;
+short   ifru_flags;  
+int ifru_metric;
+int ifru_mtu; 
+int ifru_dlt;
+u_int   ifru_value;
+void *  ifru_data;
+struct {
+uint32_tb_buflen;
+void*b_buf;
+} ifru_b;
+} ifr_ifru;
+};  
+#define OOSIOCGIFBRDADDR _IOWR('i', 18, struct oifreq)
+
+ATF_TC(OOSIOCGIFBRDADDR);
+ATF_TC_HEAD(OOSIOCGIFBRDADDR, tc)
+{
+
+	atf_tc_set_md_var(tc, descr, Checks that OOSIOCGIFBRDADDR works 
+	(PR kern/44054));
+}
+
+ATF_TC_BODY(OOSIOCGIFBRDADDR, tc)
+{
+int fd, ifnum;
+struct oifreq ifreq;
+struct sockaddr_in *sin;
+	int rv;
+
+memset(ifreq,'\0',sizeof ifreq);
+
+	rump_init();
+
+	/* create an interface and give it netmask 0x */
+	rv = rump_pub_shmif_create(bus, ifnum);
+	if (rv)
+		atf_tc_fail(failed to create shmif: %s, strerror(rv));
+	sprintf(ifreq.ifr_name, shmif%d, ifnum);
+	netcfg_rump_if(ifreq.ifr_name, 1.7.64.10, 255.255.0.0);
+
+	/* query kernel for iface bcast */
+RL(fd = rump_sys_socket(AF_INET, SOCK_DGRAM, 0));
+RL(rump_sys_ioctl(fd, OOSIOCGIFBRDADDR, ifreq));
+
+	/* make sure we got what we deserve */
+sin = (struct sockaddr_in *)ifreq.ifr_broadaddr;
+	ATF_REQUIRE_EQ(sin-sin_addr.s_addr, htonl(0x0107));
+rump_sys_close(fd);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+	ATF_TP_ADD_TC(tp, OOSIOCGIFBRDADDR);
+	return atf_no_error();
+}



CVS commit: src

2010-11-07 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Sun Nov  7 19:55:58 UTC 2010

Modified Files:
src/distrib/sets/lists/tests: mi
src/etc/mtree: NetBSD.dist.base

Log Message:
usual goop for new tp  dir


To generate a diff of this commit:
cvs rdiff -u -r1.151 -r1.152 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.59 -r1.60 src/etc/mtree/NetBSD.dist.base

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.151 src/distrib/sets/lists/tests/mi:1.152
--- src/distrib/sets/lists/tests/mi:1.151	Fri Nov  5 11:32:42 2010
+++ src/distrib/sets/lists/tests/mi	Sun Nov  7 19:55:58 2010
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.151 2010/11/05 11:32:42 pooka Exp $
+# $NetBSD: mi,v 1.152 2010/11/07 19:55:58 pooka Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -382,6 +382,8 @@
 ./usr/libdata/debug/usr/tests/net/icmp	tests-net-debug
 ./usr/libdata/debug/usr/tests/net/icmp/t_forward.debug		tests-net-debug		debug,atf
 ./usr/libdata/debug/usr/tests/net/icmp/t_ping.debug		tests-net-debug		debug,atf
+./usr/libdata/debug/usr/tests/net/if	tests-net-debug
+./usr/libdata/debug/usr/tests/net/if/t_compat.debug		tests-net-debug		debug,atf
 ./usr/libdata/debug/usr/tests/net/if_loop	tests-net-debug
 ./usr/libdata/debug/usr/tests/net/if_loop/t_pr.debug		tests-net-debug		debug,atf
 ./usr/libdata/debug/usr/tests/net/sys	tests-net-debug
@@ -1585,6 +1587,9 @@
 ./usr/tests/net/icmp/Atffile			tests-net-tests		atf
 ./usr/tests/net/icmp/t_forward		tests-net-tests		atf
 ./usr/tests/net/icmp/t_ping		tests-net-tests		atf
+./usr/tests/net/if			tests-net-tests
+./usr/tests/net/if/Atffile			tests-net-tests		atf
+./usr/tests/net/if/t_compat		tests-net-tests		atf
 ./usr/tests/net/if_looptests-net-tests
 ./usr/tests/net/if_loop/Atffile			tests-net-tests		atf
 ./usr/tests/net/if_loop/t_pr		tests-net-tests		atf

Index: src/etc/mtree/NetBSD.dist.base
diff -u src/etc/mtree/NetBSD.dist.base:1.59 src/etc/mtree/NetBSD.dist.base:1.60
--- src/etc/mtree/NetBSD.dist.base:1.59	Thu Nov  4 13:24:27 2010
+++ src/etc/mtree/NetBSD.dist.base	Sun Nov  7 19:55:58 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.base,v 1.59 2010/11/04 13:24:27 pooka Exp $
+#	$NetBSD: NetBSD.dist.base,v 1.60 2010/11/07 19:55:58 pooka Exp $
 #	@(#)4.4BSD.dist	8.1 (Berkeley) 6/13/93
 
 # Do not customize this file as it may be overwritten on upgrades.
@@ -262,6 +262,7 @@
 ./usr/libdata/debug/usr/tests/net/bpf
 ./usr/libdata/debug/usr/tests/net/carp
 ./usr/libdata/debug/usr/tests/net/icmp
+./usr/libdata/debug/usr/tests/net/if
 ./usr/libdata/debug/usr/tests/net/if_loop
 ./usr/libdata/debug/usr/tests/net/sys
 ./usr/libdata/debug/usr/tests/rump
@@ -1202,6 +1203,7 @@
 ./usr/tests/net/bpf
 ./usr/tests/net/carp
 ./usr/tests/net/icmp
+./usr/tests/net/if
 ./usr/tests/net/if_loop
 ./usr/tests/net/sys
 ./usr/tests/rump



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

2010-11-07 Thread Alistair G. Crooks
Module Name:src
Committed By:   agc
Date:   Sun Nov  7 21:16:00 UTC 2010

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

Log Message:
Fix a build problem on OpenBSD (we're not the only one who has trouble
with their header files, it seems - insight from the tor project mailing
list).

And just so that the search engines can find it:

 In file included from ssh2pgp.c:39:
 /usr/include/arpa/inet.h:74: warning: 'struct in_addr' declared inside 
 parameter list
 /usr/include/arpa/inet.h:74: warning: its scope is only this definition or 
 declaration, which is probably not what you want
 /usr/include/arpa/inet.h:75: warning: 'struct in_addr' declared inside 
 parameter list
 *** Error code 1

is fixed by including netinet/in.h before arpa/inet.h - found after a
long-distance debug session with Anthony Bentley - thanks!


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 \
src/crypto/external/bsd/netpgp/dist/src/lib/ssh2pgp.c

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

Modified files:

Index: src/crypto/external/bsd/netpgp/dist/src/lib/ssh2pgp.c
diff -u src/crypto/external/bsd/netpgp/dist/src/lib/ssh2pgp.c:1.18 src/crypto/external/bsd/netpgp/dist/src/lib/ssh2pgp.c:1.19
--- src/crypto/external/bsd/netpgp/dist/src/lib/ssh2pgp.c:1.18	Sun Nov  7 08:39:59 2010
+++ src/crypto/external/bsd/netpgp/dist/src/lib/ssh2pgp.c	Sun Nov  7 21:16:00 2010
@@ -36,6 +36,8 @@
 #include sys/stat.h
 #include sys/param.h
 
+#include netinet/in.h
+
 #include arpa/inet.h
 
 #include inttypes.h



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

2010-11-07 Thread Alistair G. Crooks
Module Name:src
Committed By:   agc
Date:   Sun Nov  7 21:41:39 UTC 2010

Modified Files:
src/crypto/external/bsd/netpgp/dist/src/lib: netpgp.c ssh2pgp.c
Added Files:
src/crypto/external/bsd/netpgp/dist/src/lib: ssh2pgp.h
Removed Files:
src/crypto/external/bsd/netpgp/dist/src/lib: ops-ssh.h

Log Message:
Rename internal ops-ssh.h header file to ssh2pgp.h to better reflect its
use.


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 \
src/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c
cvs rdiff -u -r1.3 -r0 src/crypto/external/bsd/netpgp/dist/src/lib/ops-ssh.h
cvs rdiff -u -r1.19 -r1.20 \
src/crypto/external/bsd/netpgp/dist/src/lib/ssh2pgp.c
cvs rdiff -u -r0 -r1.1 src/crypto/external/bsd/netpgp/dist/src/lib/ssh2pgp.h

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

Modified files:

Index: src/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c
diff -u src/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c:1.81 src/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c:1.82
--- src/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c:1.81	Sun Nov  7 08:39:59 2010
+++ src/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c	Sun Nov  7 21:41:38 2010
@@ -34,7 +34,7 @@
 
 #if defined(__NetBSD__)
 __COPYRIGHT(@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.);
-__RCSID($NetBSD: netpgp.c,v 1.81 2010/11/07 08:39:59 agc Exp $);
+__RCSID($NetBSD: netpgp.c,v 1.82 2010/11/07 21:41:38 agc Exp $);
 #endif
 
 #include sys/types.h
@@ -81,7 +81,7 @@
 #include readerwriter.h
 #include netpgpdefs.h
 #include crypto.h
-#include ops-ssh.h
+#include ssh2pgp.h
 #include defs.h
 
 /* read any gpg config file */

Index: src/crypto/external/bsd/netpgp/dist/src/lib/ssh2pgp.c
diff -u src/crypto/external/bsd/netpgp/dist/src/lib/ssh2pgp.c:1.19 src/crypto/external/bsd/netpgp/dist/src/lib/ssh2pgp.c:1.20
--- src/crypto/external/bsd/netpgp/dist/src/lib/ssh2pgp.c:1.19	Sun Nov  7 21:16:00 2010
+++ src/crypto/external/bsd/netpgp/dist/src/lib/ssh2pgp.c	Sun Nov  7 21:41:39 2010
@@ -68,7 +68,7 @@
 #include netpgpsdk.h
 #include crypto.h
 #include netpgpdigest.h
-#include ops-ssh.h
+#include ssh2pgp.h
 
 /* structure for earching for constant strings */
 typedef struct str_t {

Added files:

Index: src/crypto/external/bsd/netpgp/dist/src/lib/ssh2pgp.h
diff -u /dev/null src/crypto/external/bsd/netpgp/dist/src/lib/ssh2pgp.h:1.1
--- /dev/null	Sun Nov  7 21:41:39 2010
+++ src/crypto/external/bsd/netpgp/dist/src/lib/ssh2pgp.h	Sun Nov  7 21:41:39 2010
@@ -0,0 +1,41 @@
+/*-
+ * Copyright (c) 2009 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Alistair Crooks (a...@netbsd.org)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef SSH2PGP_H_
+#define SSH2PGP_H_
+
+#include keyring.h
+#include types.h
+
+int pgp_ssh2pubkey(pgp_io_t *, const char *, pgp_key_t *, pgp_hash_alg_t);
+int pgp_ssh2seckey(pgp_io_t *, const char *, pgp_key_t *, pgp_pubkey_t *, pgp_hash_alg_t);
+
+int pgp_ssh2_readkeys(pgp_io_t *, pgp_keyring_t *, pgp_keyring_t *,
+		const char *, const char *, unsigned);
+
+#endif



CVS commit: src/external/historical/nawk/dist

2010-11-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Nov  7 22:55:27 UTC 2010

Modified Files:
src/external/historical/nawk/dist: lib.c proto.h tran.c

Log Message:
PR/44063: Aleksey Cheusov: awk: setting NF doesn't change $i
http://www.opengroup.org/onlinepubs/009695399/utilities/awk.html

...
References to nonexistent fields (that is, fields after $NF),
shall evaluate to the uninitialized value.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/historical/nawk/dist/lib.c \
src/external/historical/nawk/dist/proto.h \
src/external/historical/nawk/dist/tran.c

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

Modified files:

Index: src/external/historical/nawk/dist/lib.c
diff -u src/external/historical/nawk/dist/lib.c:1.2 src/external/historical/nawk/dist/lib.c:1.3
--- src/external/historical/nawk/dist/lib.c:1.2	Thu Aug 26 10:55:20 2010
+++ src/external/historical/nawk/dist/lib.c	Sun Nov  7 17:55:26 2010
@@ -400,6 +400,7 @@
 		}
 	}
 	setfval(nfloc, (Awkfloat) lastfld);
+	donerec = 1; /* restore */
 	if (dbg) {
 		for (j = 0; j = lastfld; j++) {
 			p = fldtab[j];
@@ -431,6 +432,19 @@
 	setfval(nfloc, (Awkfloat) n);
 }
 
+void setlastfld(int n)	/* set lastfld cleaning fldtab cells if necessary */
+{
+	if (n  nfields)
+		growfldtab(n);
+
+	if (lastfld  n)
+	cleanfld(lastfld+1, n);
+	else
+	cleanfld(n+1, lastfld);
+
+	lastfld = n;
+}
+
 Cell *fieldadr(int n)	/* get nth field */
 {
 	if (n  0)
Index: src/external/historical/nawk/dist/proto.h
diff -u src/external/historical/nawk/dist/proto.h:1.2 src/external/historical/nawk/dist/proto.h:1.3
--- src/external/historical/nawk/dist/proto.h:1.2	Thu Aug 26 10:55:20 2010
+++ src/external/historical/nawk/dist/proto.h	Sun Nov  7 17:55:26 2010
@@ -127,6 +127,7 @@
 extern	void	fldbld(void);
 extern	void	cleanfld(int, int);
 extern	void	newfld(int);
+extern	void	setlastfld(int);
 extern	int	refldbld(const char *, const char *);
 extern	void	recbld(void);
 extern	Cell	*fieldadr(int);
Index: src/external/historical/nawk/dist/tran.c
diff -u src/external/historical/nawk/dist/tran.c:1.2 src/external/historical/nawk/dist/tran.c:1.3
--- src/external/historical/nawk/dist/tran.c:1.2	Thu Aug 26 10:55:20 2010
+++ src/external/historical/nawk/dist/tran.c	Sun Nov  7 17:55:26 2010
@@ -298,6 +298,10 @@
 		if (fldno  *NF)
 			newfld(fldno);
 		   dprintf( (setting field %d to %g\n, fldno, f) );
+	} else if (vp-fval == NF) {
+		donerec = 0;	/* mark $0 invalid */
+		setlastfld(f);
+		dprintf( (setting NF to %g\n, f) );
 	} else if (isrec(vp)) {
 		donefld = 0;	/* mark $1... invalid */
 		donerec = 1;
@@ -324,6 +328,7 @@
 {
 	char *t;
 	int fldno;
+	Awkfloat f;
 
 	   dprintf( (starting setsval %p: %s = \%s\, t=%o, r,f=%d,%d\n, 
 		vp, NN(vp-nval), s, vp-tval, donerec, donefld) );
@@ -347,6 +352,14 @@
 	vp-tval = ~DONTFREE;
 	   dprintf( (setsval %p: %s = \%s (%p) \, t=%o r,f=%d,%d\n, 
 		vp, NN(vp-nval), t,t, vp-tval, donerec, donefld) );
+
+	if (vp-fval == NF) {
+		donerec = 0;	/* mark $0 invalid */
+		f = getfval(vp);
+		setlastfld(f);
+		dprintf( (setting NF to %g\n, f) );
+	}
+
 	return(vp-sval = t);
 }
 



CVS commit: src/share/man/man3

2010-11-07 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Mon Nov  8 03:20:59 UTC 2010

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

Log Message:
- Add library section.
- Fix function signatures.
- Describe added member to an ops structure.
- Describe rb_tree_remove_node.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/man/man3/rbtree.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/rbtree.3
diff -u src/share/man/man3/rbtree.3:1.1 src/share/man/man3/rbtree.3:1.2
--- src/share/man/man3/rbtree.3:1.1	Sun Oct 24 06:57:04 2010
+++ src/share/man/man3/rbtree.3	Mon Nov  8 03:20:59 2010
@@ -1,4 +1,4 @@
-.\ $NetBSD: rbtree.3,v 1.1 2010/10/24 06:57:04 jruoho Exp $
+.\ $NetBSD: rbtree.3,v 1.2 2010/11/08 03:20:59 enami Exp $
 .\
 .\ Copyright (c) 2010 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -27,26 +27,30 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd October 24, 2010
+.Dd November 8, 2010
 .Dt RBTREE 3
 .Os
 .Sh NAME
 .Nm rbtree
 .Nd red-black tree
+.Sh LIBRARY
+.Lb libc
 .Sh SYNOPSIS
 .In sys/rbtree.h
 .Ft void
-.Fn rb_tree_init struct rb_tree * const struct rb_tree_ops *
-.Ft bool
-.Fn rb_tree_insert_node struct rb_tree * struct rb_node *
-.Ft struct rb_node *
-.Fn rb_tree_find_node struct rb_tree * const void *
-.Ft struct rb_node *
-.Fn rb_tree_find_node_geq struct rb_tree * const void *
-.Ft struct rb_node *
-.Fn rb_tree_find_node_leq struct rb_tree * const void *
-.Ft struct rb_node *
-.Fn rb_tree_iterate struct rb_tree * struct rb_node * const unsigned int
+.Fn rb_tree_init rb_tree_t * const rb_tree_ops_t *
+.Ft void *
+.Fn rb_tree_insert_node rb_tree_t * void *
+.Ft void
+.Fn rb_tree_remove_node rb_tree_t * void *
+.Ft void *
+.Fn rb_tree_find_node rb_tree_t * const void *
+.Ft void *
+.Fn rb_tree_find_node_geq rb_tree_t * const void *
+.Ft void *
+.Fn rb_tree_find_node_leq rb_tree_t * const void *
+.Ft void *
+.Fn rb_tree_iterate rb_tree_t * void * const unsigned int
 .Sh DESCRIPTION
 .Nm
 provides red-black trees.
@@ -67,10 +71,10 @@
 The maximum height of a red-black tree is 2lg (n+1).
 .Sh TYPES
 .Bl -tag -width compact
-.It Vt struct rb_tree
+.It Vt rb_tree_t
 A red-black tree.
 .It Vt typedef signed int \
-(*const rbto_compare_nodes_fn)(const struct rb_node *, const struct rb_node *);
+(*const rbto_compare_nodes_fn)(void *, const void *, const void *);
 The node-comparison operator.
 Defines an ordering on nodes.
 Returns a positive value if the first node precedes the second node.
@@ -78,24 +82,30 @@
 Returns 0 if the first node and the second are identical according
 to the ordering.
 .It Vt typedef signed int \
-(*const rbto_compare_key_fn)(const struct rb_node *, const void *);
+(*const rbto_compare_key_fn)(void *, const void *, const void *);
 The node-key comparison operator.
 Defines the order of nodes and keys.
 Returns a positive value if the node precedes the key.
 Returns a negative value if the node follows the key.
 Returns 0 if the node is identical to the key according to the ordering.
-.It Vt struct rb_tree_ops
-Defines the operators for comparing two nodes in the same tree,
-and for comparing a node in the tree with a key.
+.It Vt rb_tree_ops_t
+Defines the operator for comparing two nodes in the same tree,
+the operator for comparing a node in the tree with a key,
+the offset of member
+.Vt rb_node_t
+within a node,
+and the opaque context passed to the operators.
 Members of
-.Vt rb_tree_ops
+.Vt rb_tree_ops_t
 are
 .Bd -literal
 rbto_compare_nodes_fn rbto_compare_nodes;
 rbto_compare_key_fn rbto_compare_key;
+size_t rbto_node_offset;
+void *rbto_context;
 .Ed
-.It Vt struct rb_node
-A node in a red-black tree.
+.It Vt rb_node_t
+A node in a red-black tree has this structure as a member.
 .El
 .Sh FUNCTIONS
 .Bl -tag -width compact
@@ -113,11 +123,13 @@
 .Fa rb
 into the tree
 .Fa rbt .
-Return
-.Dv true
-on success,
-.Dv false
-on failure.
+Return inserted node on success,
+already existing node on failure.
+.It Fn rb_tree_remove_node rbt rb
+Remove the node
+.Fa node
+from the tree
+.Fa rbt .
 .It Fn rb_tree_find_node rbt key
 Search the tree
 .Fa rbt



CVS commit: src/share/mk

2010-11-07 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Mon Nov  8 06:54:53 UTC 2010

Modified Files:
src/share/mk: bsd.lib.mk bsd.prog.mk

Log Message:
Preserve date on original shared library or program when stripping
the debug symbols and adding the debug-link to .debug.
Use '(rm -f file; false)' in the failure path to force failure.
Based on solution proposed by Nicolas Joly on tech-toolchain in July 2010.
Should fix PR toolchain/44046 from Andreas Gustafsson.


To generate a diff of this commit:
cvs rdiff -u -r1.308 -r1.309 src/share/mk/bsd.lib.mk
cvs rdiff -u -r1.250 -r1.251 src/share/mk/bsd.prog.mk

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

Modified files:

Index: src/share/mk/bsd.lib.mk
diff -u src/share/mk/bsd.lib.mk:1.308 src/share/mk/bsd.lib.mk:1.309
--- src/share/mk/bsd.lib.mk:1.308	Tue Jul  6 05:59:56 2010
+++ src/share/mk/bsd.lib.mk	Mon Nov  8 06:54:52 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.lib.mk,v 1.308 2010/07/06 05:59:56 mrg Exp $
+#	$NetBSD: bsd.lib.mk,v 1.309 2010/11/08 06:54:52 lukem Exp $
 #	@(#)bsd.lib.mk	8.3 (Berkeley) 4/22/94
 
 .include bsd.init.mk
@@ -589,10 +589,10 @@
 .if defined(_LIB.debug)
 ${_LIB.debug}: ${_LIB.so}
 	${_MKTARGET_CREATE}
-	${OBJCOPY} --only-keep-debug ${_LIB.so} ${_LIB.debug}
-	${OBJCOPY} --strip-debug \
-	-R .gnu_debuglink --add-gnu-debuglink=${_LIB.debug} ${_LIB.so} \
-	|| rm -f ${_LIB.debug}
+	(  ${OBJCOPY} --only-keep-debug ${_LIB.so} ${_LIB.debug} \
+	 ${OBJCOPY} --strip-debug -p -R .gnu_debuglink \
+		--add-gnu-debuglink=${_LIB.debug} ${_LIB.so} \
+	) || (rm -f ${_LIB.debug}; false)
 .endif
 
 .if !empty(LOBJS)			# {

Index: src/share/mk/bsd.prog.mk
diff -u src/share/mk/bsd.prog.mk:1.250 src/share/mk/bsd.prog.mk:1.251
--- src/share/mk/bsd.prog.mk:1.250	Sun Oct 31 11:52:53 2010
+++ src/share/mk/bsd.prog.mk	Mon Nov  8 06:54:52 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.prog.mk,v 1.250 2010/10/31 11:52:53 mbalmer Exp $
+#	$NetBSD: bsd.prog.mk,v 1.251 2010/11/08 06:54:52 lukem Exp $
 #	@(#)bsd.prog.mk	8.2 (Berkeley) 4/2/94
 
 .ifndef HOSTPROG
@@ -315,9 +315,10 @@
 .if defined(_PROGDEBUG.${_P})
 ${_PROGDEBUG.${_P}}: ${_P}
 	${_MKTARGET_CREATE}
-	${OBJCOPY} --only-keep-debug ${_P} ${_PROGDEBUG.${_P}}
-	${OBJCOPY} --strip-debug -R .gnu_debuglink --add-gnu-debuglink=${_PROGDEBUG.${_P}} ${_P} \
-	|| rm -f ${_PROGDEBUG.${_P}}
+	(  ${OBJCOPY} --only-keep-debug ${_P} ${_PROGDEBUG.${_P}} \
+	 ${OBJCOPY} --strip-debug -p -R .gnu_debuglink \
+		--add-gnu-debuglink=${_PROGDEBUG.${_P}} ${_P} \
+	) || (rm -f ${_PROGDEBUG.${_P}}; false)
 .endif
 
 .endif	# defined(OBJS.${_P})  !empty(OBJS.${_P})			# }