CVS commit: [agc-netpgp-standalone] src/crypto/external/bsd/netpgp/dist/src/libverify

2012-10-22 Thread Alistair G. Crooks
Module Name:src
Committed By:   agc
Date:   Mon Oct 22 08:35:14 UTC 2012

Modified Files:
src/crypto/external/bsd/netpgp/dist/src/libverify 
[agc-netpgp-standalone]:
libverify.c

Log Message:
fix DSA signature verification so it DTRT


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

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

Modified files:

Index: src/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c
diff -u src/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c:1.1.2.4 src/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c:1.1.2.5
--- src/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c:1.1.2.4	Sat Oct 20 12:18:31 2012
+++ src/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c	Mon Oct 22 08:35:13 2012
@@ -1465,7 +1465,7 @@ verify_dsa_verify(uint8_t *calculated, u
 	BIGNUM		 *t1;
 	int		  ret;
 
-	if (sig[DSA_P].bn == NULL || sig[DSA_Q].bn == NULL || sig[DSA_G].bn == NULL) {
+	if (pubkey[DSA_P].bn == NULL || pubkey[DSA_Q].bn == NULL || pubkey[DSA_G].bn == NULL) {
 		return 0;
 	}
 	M = W = t1 = NULL;
@@ -1479,11 +1479,10 @@ verify_dsa_verify(uint8_t *calculated, u
 		printf(dsa: bad # of Q bits\n);
 		return 0;
 	}
-	if (pubkey-bn[DSA_Q].bits  DSA_MAX_MODULUS_BITS) {
+	if (pubkey-bn[DSA_P].bits  DSA_MAX_MODULUS_BITS) {
 		printf(dsa: p too large\n);
 		return 0;
 	}
-	/* no love for SHA512? */
 	if (calclen  SHA256_DIGEST_LENGTH) {
 		printf(dsa: digest too long\n);
 		return 0;
@@ -1492,8 +1491,8 @@ verify_dsa_verify(uint8_t *calculated, u
 	if ((M = BN_new()) == NULL || (W = BN_new()) == NULL || (t1 = BN_new()) == NULL ||
 	BN_is_zero(sig[DSA_R].bn) || BN_is_negative(sig[DSA_R].bn) || BN_cmp(sig[DSA_R].bn, pubkey-bn[DSA_Q].bn) = 0 ||
 	BN_is_zero(sig[DSA_S].bn) || BN_is_negative(sig[DSA_S].bn) || BN_cmp(sig[DSA_S].bn, pubkey-bn[DSA_Q].bn) = 0 ||
-	BN_mod_inverse(W, sig[DSA_S].bn, pubkey-bn[DSA_Q].bn, NULL) != MP_OKAY) {
-		goto err;
+	BN_mod_inverse(W, sig[DSA_S].bn, pubkey-bn[DSA_Q].bn, NULL) == NULL) {
+		goto done;
 	}
 	if (calclen  qbits / 8) {
 		calclen = qbits / 8;
@@ -1501,12 +1500,14 @@ verify_dsa_verify(uint8_t *calculated, u
 	if (BN_bin2bn(calculated, (int)calclen, M) == NULL ||
 	!BN_mod_mul(M, M, W, pubkey-bn[DSA_Q].bn, NULL) ||
 	!BN_mod_mul(W, sig[DSA_R].bn, W, pubkey-bn[DSA_Q].bn, NULL) ||
-	!BN_mod_exp(pubkey-bn[DSA_P].bn, t1, pubkey-bn[DSA_G].bn, M, NULL) ||
-	!BN_div(NULL, M, t1, pubkey-bn[DSA_Q].bn, NULL)) {
-		goto err;
+	!BN_mod_exp(t1, pubkey-bn[DSA_G].bn, M, pubkey-bn[DSA_P].bn, NULL) ||
+	!BN_mod_exp(W, pubkey-bn[DSA_Y].bn, W, pubkey-bn[DSA_P].bn, NULL) ||
+	!BN_mod_mul(t1, t1, W, pubkey-bn[DSA_P].bn, NULL) ||
+	!BN_div(NULL, t1, t1, pubkey-bn[DSA_Q].bn, NULL)) {
+		goto done;
 	}
-	ret = (BN_cmp(M, sig[DSA_R].bn) == 0);
-err:
+	ret = (BN_cmp(t1, sig[DSA_R].bn) == 0);
+done:
 	if (M) {
 		BN_free(M);
 	}



CVS commit: src/doc

2012-10-22 Thread Matthias Drochner
Module Name:src
Committed By:   drochner
Date:   Mon Oct 22 10:37:44 UTC 2012

Modified Files:
src/doc: CHANGES

Log Message:
mention discard (ATA TRIM) support


To generate a diff of this commit:
cvs rdiff -u -r1.1750 -r1.1751 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.1750 src/doc/CHANGES:1.1751
--- src/doc/CHANGES:1.1750	Thu Oct 18 08:57:26 2012
+++ src/doc/CHANGES	Mon Oct 22 10:37:44 2012
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1750 $
+# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1751 $
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -128,3 +128,6 @@ Changes from NetBSD 6.0 to NetBSD 7.0:
 		[tsutsui,isaki 20121012]
 	x68k: Add support for formatting floppy. [tsutsui 20121014]
 	zoneinfo: Import tzdata2012g. [apb 20121018]
+	kernel: Added experimental support for the (mostly SSD specific)
+		discard, or ATA TRIM command to wd(4) and ffs
+		[drochner 20121019]



CVS commit: src/sys/sys

2012-10-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Oct 22 14:00:07 UTC 2012

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

Log Message:
define __alignof() in terms of __alignof__ if it is available.


To generate a diff of this commit:
cvs rdiff -u -r1.101 -r1.102 src/sys/sys/cdefs.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/cdefs.h
diff -u src/sys/sys/cdefs.h:1.101 src/sys/sys/cdefs.h:1.102
--- src/sys/sys/cdefs.h:1.101	Sun Oct 21 18:35:52 2012
+++ src/sys/sys/cdefs.h	Mon Oct 22 10:00:07 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: cdefs.h,v 1.101 2012/10/21 22:35:52 christos Exp $	*/
+/*	$NetBSD: cdefs.h,v 1.102 2012/10/22 14:00:07 christos Exp $	*/
 
 /*
  * Copyright (c) 1991, 1993
@@ -500,7 +500,11 @@
 /*
  * Return the natural alignment in bytes for the given type
  */
-#define	__alignof(__t)  (sizeof(struct { char __x; __t __y; }) - sizeof(__t))
+#ifdef __alignof__
+#define	__alignof(__t)  __alignof__(__t)
+#else
+#define __alignof(__t) (sizeof(struct { char __x; __t __y; }) - sizeof(__t))
+#endif
 
 /*
  * Return the number of elements in a statically-allocated array,



CVS commit: src/games/fortune/datfiles

2012-10-22 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Mon Oct 22 14:33:28 UTC 2012

Modified Files:
src/games/fortune/datfiles: fortunes fortunes2

Log Message:
Attribute The STAR WARS Song to Weird Al Yankovic under the proper title,
Yoda.  Correct said lyrics.

Correct lyrics to Weird Al Yankovic's One Of Those Days.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/games/fortune/datfiles/fortunes
cvs rdiff -u -r1.44 -r1.45 src/games/fortune/datfiles/fortunes2

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

Modified files:

Index: src/games/fortune/datfiles/fortunes
diff -u src/games/fortune/datfiles/fortunes:1.52 src/games/fortune/datfiles/fortunes:1.53
--- src/games/fortune/datfiles/fortunes:1.52	Wed Oct  3 19:41:46 2012
+++ src/games/fortune/datfiles/fortunes	Mon Oct 22 14:33:27 2012
@@ -13216,11 +13216,11 @@ something badly enough, you can always g
 the Russians.
 		-- Marshall Brickman, Playboy, April, 1973
 %
-		The STAR WARS Song
+	 Yoda, by Weird Al Yankovic;
 	Sung to the tune of Lola, by the Kinks:
 
 I met him in a swamp down in Dagobah
-Where it bubbles all the time like a giant cabinet soda
+Where it bubbles all the time like a giant carbonated soda
 	S-O-D-A soda
 I saw the little runt sitting there on a log
 I asked him his name and in a raspy voice he said Yoda

Index: src/games/fortune/datfiles/fortunes2
diff -u src/games/fortune/datfiles/fortunes2:1.44 src/games/fortune/datfiles/fortunes2:1.45
--- src/games/fortune/datfiles/fortunes2:1.44	Sat Aug  4 22:29:58 2012
+++ src/games/fortune/datfiles/fortunes2	Mon Oct 22 14:33:27 2012
@@ -26128,12 +26128,8 @@ this was for practice; then he made scho
 In the force if Yoda's so strong, construct a sentence with words in
 the proper order then why can't he?
 %
-In the force if Yoda's so strong, construct a sentence with words in
-the proper order then why can't he?
-
-
 I met him in a swamp down in Dagobah
-Where it bubbles all the time like a giant cabinet soda
+Where it bubbles all the time like a giant carbonated soda
 	S-O-D-A soda
 I saw the little runt sitting there on a log
 I asked him his name and in a raspy voice he said Yoda
@@ -26145,7 +26141,7 @@ A guy who looks like a Muppet but he's w
 Well I'm not dumb but I can't understand
 How he can raise me in the air just by raising his hand
 	Oh my Yoda, Yo-Yo-Yo-Yo Yoda, Yo-Yo-Yo-Yo Yoda
-		-- The STAR WARS Song, to Lola, by the Kinks
+		-- Yoda by Weird Al Yankovic, to Lola, by the Kinks
 %
 In the future, there will be fewer but better Russians.
 		-- Joseph Stalin
@@ -41229,10 +41225,11 @@ The avoidance of taxes is the only intel
 carries any reward.
 		-- John Maynard Keynes
 %
-The bank called to tell me that I'm overdrawn,
-Some freaks are burning crosses out on my front lawn,
-And I *can't*believe* it, all the Cheetos are gone,
-	It's just ONE OF THOSE DAYS!
+The bank called me up and told me I'm overdrawn,
+Some freaks are burnin' crosses out on my front lawn,
+And I can't believe it, all the Cheetos are gone,
+	It's just, just one of those, one of those days,
+	Just one of those, one of those days
 		-- Weird Al Yankovic, One of Those Days
 %
 The bank sent our statement this morning,



CVS commit: src/bin/chmod

2012-10-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Oct 22 17:47:06 UTC 2012

Modified Files:
src/bin/chmod: chmod.1 chmod.c

Log Message:
add --reference=rfile


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/bin/chmod/chmod.1
cvs rdiff -u -r1.36 -r1.37 src/bin/chmod/chmod.c

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

Modified files:

Index: src/bin/chmod/chmod.1
diff -u src/bin/chmod/chmod.1:1.23 src/bin/chmod/chmod.1:1.24
--- src/bin/chmod/chmod.1:1.23	Fri Jan 22 00:41:36 2010
+++ src/bin/chmod/chmod.1	Mon Oct 22 13:47:06 2012
@@ -1,4 +1,4 @@
-.\	$NetBSD: chmod.1,v 1.23 2010/01/22 05:41:36 snj Exp $
+.\	$NetBSD: chmod.1,v 1.24 2012/10/22 17:47:06 christos Exp $
 .\
 .\ Copyright (c) 1989, 1990, 1993, 1994
 .\	The Regents of the University of California.  All rights reserved.
@@ -32,7 +32,7 @@
 .\
 .\	@(#)chmod.1	8.4 (Berkeley) 3/31/94
 .\
-.Dd January 22, 2010
+.Dd October 22, 2012
 .Dt CHMOD 1
 .Os
 .Sh NAME
@@ -47,13 +47,26 @@
 .Op Fl fh
 .Ar mode
 .Ar
+.Nm
+.Oo
+.Fl R
+.Op Fl H | Fl L | Fl P
+.Oc
+.Op Fl fh
+.Fl Fl reference=rfile
+.Ar
 .Sh DESCRIPTION
 The
 .Nm
 utility modifies the file mode bits of the listed files
 as specified by the
 .Ar mode
-operand.
+operand, or
+copied from a reference
+.Ar rfile ,
+as specified with the
+.Fl Fl reference
+argument.
 .Pp
 The options are as follows:
 .Bl -tag -width Ds

Index: src/bin/chmod/chmod.c
diff -u src/bin/chmod/chmod.c:1.36 src/bin/chmod/chmod.c:1.37
--- src/bin/chmod/chmod.c:1.36	Mon Aug 29 10:51:17 2011
+++ src/bin/chmod/chmod.c	Mon Oct 22 13:47:06 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: chmod.c,v 1.36 2011/08/29 14:51:17 joerg Exp $ */
+/* $NetBSD: chmod.c,v 1.37 2012/10/22 17:47:06 christos Exp $ */
 
 /*
  * Copyright (c) 1989, 1993, 1994
@@ -40,7 +40,7 @@ __COPYRIGHT(
 #if 0
 static char sccsid[] = @(#)chmod.c	8.8 (Berkeley) 4/1/94;
 #else
-__RCSID($NetBSD: chmod.c,v 1.36 2011/08/29 14:51:17 joerg Exp $);
+__RCSID($NetBSD: chmod.c,v 1.37 2012/10/22 17:47:06 christos Exp $);
 #endif
 #endif /* not lint */
 
@@ -57,25 +57,39 @@ __RCSID($NetBSD: chmod.c,v 1.36 2011/08
 #include stdlib.h
 #include string.h
 #include unistd.h
+#include getopt.h
 
 __dead static void	usage(void);
 
+struct option chmod_longopts[] = {
+	{ reference,		required_argument,	0,
+		1 },
+	{ NULL,			0,			0,
+		0 },
+};
+
 int
 main(int argc, char *argv[])
 {
 	FTS *ftsp;
 	FTSENT *p;
-	mode_t *set;
+	void *set;
+	mode_t mval;
 	int Hflag, Lflag, Rflag, ch, fflag, fts_options, hflag, rval;
-	char *mode;
+	char *mode, *reference;
 	int (*change_mode)(const char *, mode_t);
 
 	setprogname(argv[0]);
 	(void)setlocale(LC_ALL, );
 
 	Hflag = Lflag = Rflag = fflag = hflag = 0;
-	while ((ch = getopt(argc, argv, HLPRXfghorstuwx)) != -1)
+	reference = NULL;
+	while ((ch = getopt_long(argc, argv, HLPRXfghorstuwx,
+	chmod_longopts, NULL)) != -1)
 		switch (ch) {
+		case 1:
+			reference = optarg;
+			break;
 		case 'H':
 			Hflag = 1;
 			Lflag = 0;
@@ -124,7 +138,7 @@ main(int argc, char *argv[])
 done:	argv += optind;
 	argc -= optind;
 
-	if (argc  2)
+	if (argc  2  (argc  1  reference == NULL))
 		usage();
 
 	fts_options = FTS_PHYSICAL;
@@ -147,13 +161,23 @@ done:	argv += optind;
 	else
 		change_mode = chmod;
 
-	mode = *argv;
-	if ((set = setmode(mode)) == NULL) {
-		err(EXIT_FAILURE, Cannot set file mode `%s', mode);
-		/* NOTREACHED */
+	if (reference == NULL) {
+		mode = *argv++;
+		if ((set = setmode(mode)) == NULL) {
+			err(EXIT_FAILURE, Cannot set file mode `%s', mode);
+			/* NOTREACHED */
+		}
+		mval = 0;
+	} else {
+		struct stat st;
+
+		if (stat(reference, st) == -1)
+			err(EXIT_FAILURE, Cannot stat `%s', reference);
+		mval = st.st_mode;
+		set = NULL;
 	}
 
-	if ((ftsp = fts_open(++argv, fts_options, 0)) == NULL) {
+	if ((ftsp = fts_open(argv, fts_options, 0)) == NULL) {
 		err(EXIT_FAILURE, fts_open);
 		/* NOTREACHED */
 	}
@@ -189,7 +213,8 @@ done:	argv += optind;
 			break;
 		}
 		if ((*change_mode)(p-fts_accpath,
-		getmode(set, p-fts_statp-st_mode))  !fflag) {
+		set ? getmode(set, p-fts_statp-st_mode) : mval)
+		 !fflag) {
 			warn(%s, p-fts_path);
 			rval = 1;
 		}
@@ -206,8 +231,9 @@ static void
 usage(void)
 {
 	(void)fprintf(stderr,
-	usage: %s [-R [-H | -L | -P]] [-fh] mode file ...\n,
-	getprogname());
+	Usage: %s [-R [-H | -L | -P]] [-fh] mode file ...\n
+	\t%s [-R [-H | -L | -P]] [-fh] --reference=rfile file ...\n,
+	getprogname(), getprogname());
 	exit(1);
 	/* NOTREACHED */
 }



CVS commit: src/bin/chmod

2012-10-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Oct 22 18:00:46 UTC 2012

Modified Files:
src/bin/chmod: chmod.c

Log Message:
fix argument parsing.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/bin/chmod/chmod.c

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

Modified files:

Index: src/bin/chmod/chmod.c
diff -u src/bin/chmod/chmod.c:1.37 src/bin/chmod/chmod.c:1.38
--- src/bin/chmod/chmod.c:1.37	Mon Oct 22 13:47:06 2012
+++ src/bin/chmod/chmod.c	Mon Oct 22 14:00:46 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: chmod.c,v 1.37 2012/10/22 17:47:06 christos Exp $ */
+/* $NetBSD: chmod.c,v 1.38 2012/10/22 18:00:46 christos Exp $ */
 
 /*
  * Copyright (c) 1989, 1993, 1994
@@ -40,7 +40,7 @@ __COPYRIGHT(
 #if 0
 static char sccsid[] = @(#)chmod.c	8.8 (Berkeley) 4/1/94;
 #else
-__RCSID($NetBSD: chmod.c,v 1.37 2012/10/22 17:47:06 christos Exp $);
+__RCSID($NetBSD: chmod.c,v 1.38 2012/10/22 18:00:46 christos Exp $);
 #endif
 #endif /* not lint */
 
@@ -138,7 +138,7 @@ main(int argc, char *argv[])
 done:	argv += optind;
 	argc -= optind;
 
-	if (argc  2  (argc  1  reference == NULL))
+	if (argc == 0 || (argc == 1  reference == NULL))
 		usage();
 
 	fts_options = FTS_PHYSICAL;



CVS commit: src/sbin/chown

2012-10-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Oct 22 18:02:26 UTC 2012

Modified Files:
src/sbin/chown: chgrp.1 chown.8 chown.c

Log Message:
support --reference=rfile


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sbin/chown/chgrp.1 src/sbin/chown/chown.8
cvs rdiff -u -r1.5 -r1.6 src/sbin/chown/chown.c

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

Modified files:

Index: src/sbin/chown/chgrp.1
diff -u src/sbin/chown/chgrp.1:1.4 src/sbin/chown/chgrp.1:1.5
--- src/sbin/chown/chgrp.1:1.4	Thu Jan 13 17:28:36 2011
+++ src/sbin/chown/chgrp.1	Mon Oct 22 14:02:26 2012
@@ -29,9 +29,9 @@
 .\ SUCH DAMAGE.
 .\
 .\ from: @(#)chgrp.1	8.3 (Berkeley) 3/31/94
-.\	$NetBSD: chgrp.1,v 1.4 2011/01/13 22:28:36 haad Exp $
+.\	$NetBSD: chgrp.1,v 1.5 2012/10/22 18:02:26 christos Exp $
 .\
-.Dd September 25, 2003
+.Dd October 22, 2012
 .Dt CHGRP 1
 .Os
 .Sh NAME
@@ -45,7 +45,15 @@
 .Oc
 .Op Fl fhv
 .Ar group
-.Ar file ...
+.Ar
+.Nm
+.Oo
+.Fl R
+.Op Fl H | Fl L | Fl P
+.Oc
+.Op Fl fhv
+.Fl Fl reference=rfile
+.Ar
 .Sh DESCRIPTION
 The
 .Nm
@@ -53,7 +61,12 @@ utility sets the group ID of the file na
 .Ar file
 operand to the
 .Ar group
-ID specified by the group operand.
+ID specified by the group operand,
+or to the group of the given
+.Ar rfile ,
+specified by the
+.Fl Fl reference
+argument.
 .Pp
 Options:
 .Bl -tag -width Ds
Index: src/sbin/chown/chown.8
diff -u src/sbin/chown/chown.8:1.4 src/sbin/chown/chown.8:1.5
--- src/sbin/chown/chown.8:1.4	Thu Jan 13 17:28:36 2011
+++ src/sbin/chown/chown.8	Mon Oct 22 14:02:26 2012
@@ -26,9 +26,9 @@
 .\ SUCH DAMAGE.
 .\
 .\ from: @(#)chown.8	8.3 (Berkeley) 3/31/94
-.\	$NetBSD: chown.8,v 1.4 2011/01/13 22:28:36 haad Exp $
+.\	$NetBSD: chown.8,v 1.5 2012/10/22 18:02:26 christos Exp $
 .\
-.Dd December 9, 2005
+.Dd October 22, 2012
 .Dt CHOWN 8
 .Os
 .Sh NAME
@@ -42,7 +42,7 @@
 .Oc
 .Op Fl fhv
 .Ar owner Ns Op Ar :group
-.Ar file ...
+.Ar
 .Nm
 .Oo
 .Fl R
@@ -50,7 +50,15 @@
 .Oc
 .Op Fl fhv
 .Ar :group
-.Ar file ...
+.Ar
+.Nm
+.Oo
+.Fl R
+.Op Fl H | Fl L | Fl P
+.Oc
+.Op Fl fhv
+.Fl Fl reference=rfile
+.Ar
 .Sh DESCRIPTION
 .Nm
 sets the user ID and/or the group ID of the specified files.
@@ -107,7 +115,12 @@ The
 .Ar owner
 and
 .Ar group
-operands are both optional, however, one must be specified.
+operands are both optional, however, one must be specified; alternative
+both the owner and group may be specified using a reference
+.Ar rfile
+specified using the
+.Fl Fl reference
+argument.
 If the
 .Ar group
 operand is specified, it must be preceded by a colon (``:'') character.

Index: src/sbin/chown/chown.c
diff -u src/sbin/chown/chown.c:1.5 src/sbin/chown/chown.c:1.6
--- src/sbin/chown/chown.c:1.5	Mon Aug 29 10:34:59 2011
+++ src/sbin/chown/chown.c	Mon Oct 22 14:02:26 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: chown.c,v 1.5 2011/08/29 14:34:59 joerg Exp $	*/
+/*	$NetBSD: chown.c,v 1.6 2012/10/22 18:02:26 christos Exp $	*/
 
 /*
  * Copyright (c) 1988, 1993, 1994, 2003
@@ -39,7 +39,7 @@ __COPYRIGHT(@(#) Copyright (c) 1988, 19
 #if 0
 static char sccsid[] = @(#)chown.c	8.8 (Berkeley) 4/4/94;
 #else
-__RCSID($NetBSD: chown.c,v 1.5 2011/08/29 14:34:59 joerg Exp $);
+__RCSID($NetBSD: chown.c,v 1.6 2012/10/22 18:02:26 christos Exp $);
 #endif
 #endif /* not lint */
 
@@ -58,6 +58,7 @@ __RCSID($NetBSD: chown.c,v 1.5 2011/08/
 #include stdlib.h
 #include string.h
 #include unistd.h
+#include getopt.h
 
 static void	a_gid(const char *);
 static void	a_uid(const char *);
@@ -69,23 +70,35 @@ static gid_t gid;
 static int ischown;
 static char *myname;
 
+struct option chown_longopts[] = {
+	{ reference,		required_argument,	0,
+		1 },
+	{ NULL,			0,			0,
+		0 },
+};
+
 int
 main(int argc, char **argv)
 {
 	FTS *ftsp;
 	FTSENT *p;
 	int Hflag, Lflag, Rflag, ch, fflag, fts_options, hflag, rval, vflag;
-	char *cp;
+	char *cp, *reference;
 	int (*change_owner)(const char *, uid_t, gid_t);
 
 	(void)setlocale(LC_ALL, );
 
 	myname = (cp = strrchr(*argv, '/')) ? cp + 1 : *argv;
 	ischown = (myname[2] == 'o');
+	reference = NULL;
 
 	Hflag = Lflag = Rflag = fflag = hflag = vflag = 0;
-	while ((ch = getopt(argc, argv, HLPRfhv)) != -1)
+	while ((ch = getopt_long(argc, argv, HLPRfhv,
+	chown_longopts, NULL)) != -1)
 		switch (ch) {
+		case 1:
+			reference = optarg;
+			break;
 		case 'H':
 			Hflag = 1;
 			Lflag = 0;
@@ -123,7 +136,7 @@ main(int argc, char **argv)
 	argv += optind;
 	argc -= optind;
 
-	if (argc  2)
+	if (argc == 0 || (argc == 1  reference == NULL))
 		usage();
 
 	fts_options = FTS_PHYSICAL;
@@ -143,24 +156,35 @@ main(int argc, char **argv)
 
 	uid = (uid_t)-1;
 	gid = (gid_t)-1;
-	if (ischown) {
-		if ((cp = strchr(*argv, ':')) != NULL) {
-			*cp++ = '\0';
-			a_gid(cp);
-		}
-#ifdef SUPPORT_DOT
-		else if ((cp = strrchr(*argv, '.')) != NULL) {
-			if (uid_from_user(*argv, uid) == -1) {
+	if (reference == NULL) {
+		if (ischown) {
+			if ((cp = strchr(*argv, ':')) 

CVS commit: [netbsd-6] src/lib/libl

2012-10-22 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Mon Oct 22 19:43:58 UTC 2012

Removed Files:
src/lib/libl [netbsd-6]: Makefile

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #613):
lib/libl/Makefile: file removal
Remove unused lib/libl. Approved by christos.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r0 src/lib/libl/Makefile

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



CVS commit: [netbsd-6] src/sbin/ping6

2012-10-22 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Mon Oct 22 19:45:46 UTC 2012

Modified Files:
src/sbin/ping6 [netbsd-6]: ping6.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #614):
sbin/ping6/ping6.c: revision 1.81
Accept -s 0


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.80.2.1 src/sbin/ping6/ping6.c

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

Modified files:

Index: src/sbin/ping6/ping6.c
diff -u src/sbin/ping6/ping6.c:1.80 src/sbin/ping6/ping6.c:1.80.2.1
--- src/sbin/ping6/ping6.c:1.80	Wed Jan  4 16:09:42 2012
+++ src/sbin/ping6/ping6.c	Mon Oct 22 19:45:46 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ping6.c,v 1.80 2012/01/04 16:09:42 drochner Exp $	*/
+/*	$NetBSD: ping6.c,v 1.80.2.1 2012/10/22 19:45:46 riz Exp $	*/
 /*	$KAME: ping6.c,v 1.164 2002/11/16 14:05:37 itojun Exp $	*/
 
 /*
@@ -77,7 +77,7 @@ static char sccsid[] = @(#)ping.c	8.1 (
 #else
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: ping6.c,v 1.80 2012/01/04 16:09:42 drochner Exp $);
+__RCSID($NetBSD: ping6.c,v 1.80.2.1 2012/10/22 19:45:46 riz Exp $);
 #endif
 #endif
 
@@ -504,7 +504,7 @@ main(int argc, char *argv[])
 			break;
 		case 's':		/* size of packet to send */
 			datalen = strtol(optarg, e, 10);
-			if (datalen = 0 || *optarg == '\0' || *e != '\0')
+			if (datalen  0 || *optarg == '\0' || *e != '\0')
 errx(1, illegal datalen value -- %s, optarg);
 			if (datalen  MAXDATALEN) {
 errx(1,



CVS commit: [netbsd-6] src/doc

2012-10-22 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Mon Oct 22 19:46:36 UTC 2012

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

Log Message:
Ticket 612-614.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.6 -r1.1.2.7 src/doc/CHANGES-6.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-6.1
diff -u src/doc/CHANGES-6.1:1.1.2.6 src/doc/CHANGES-6.1:1.1.2.7
--- src/doc/CHANGES-6.1:1.1.2.6	Sat Oct 20 23:16:24 2012
+++ src/doc/CHANGES-6.1	Mon Oct 22 19:46:36 2012
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.1,v 1.1.2.6 2012/10/20 23:16:24 riz Exp $
+# $NetBSD: CHANGES-6.1,v 1.1.2.7 2012/10/22 19:46:36 riz Exp $
 
 A complete list of changes from the 6.0 release until the 6.1 release:
 
@@ -183,3 +183,19 @@ usr.bin/calendar/calendars/calendar.netb
 	Note the date of the NetBSD 6.0 release.
 	[jnemeth, ticket #611]
 
+external/gpl3/gcc/lib/libgcc/Makefile.inc	1.15
+
+	Fix Wrong number of words (1) in .for substitution list with
+	2 vars problem while mknative-ing.
+	[msaitoh, ticket #612]
+
+lib/libl/Makefiledelete
+
+	lib/libl was unused, remove it.
+	[msaitoh, ticket #613]
+
+sbin/ping6/ping6.c1.81
+
+	Allow ping6 to send 0-length packets.
+	[msaitoh, ticket #614]
+



CVS commit: src/sys/external/bsd/sljit/sljit

2012-10-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Oct 22 21:21:07 UTC 2012

Added Files:
src/sys/external/bsd/sljit/sljit: sljit_mod.c

Log Message:
This move is taking too long :-) make the file re-appear to fix the build.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/external/bsd/sljit/sljit/sljit_mod.c

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

Added files:

Index: src/sys/external/bsd/sljit/sljit/sljit_mod.c
diff -u /dev/null src/sys/external/bsd/sljit/sljit/sljit_mod.c:1.1
--- /dev/null	Mon Oct 22 17:21:08 2012
+++ src/sys/external/bsd/sljit/sljit/sljit_mod.c	Mon Oct 22 17:21:07 2012
@@ -0,0 +1,53 @@
+/*	$NetBSD: sljit_mod.c,v 1.1 2012/10/22 21:21:07 christos Exp $	*/
+
+/*-
+ * Copyright (c) 2012 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE 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.
+ */
+
+#include sys/cdefs.h
+__KERNEL_RCSID(0, $NetBSD: sljit_mod.c,v 1.1 2012/10/22 21:21:07 christos Exp $);
+
+#include sys/param.h
+#include sys/kernel.h
+#include sys/module.h
+
+MODULE(MODULE_CLASS_MISC, sljit, NULL)
+
+
+static int
+sljit_modcmd(modcmd_t cmd, void *arg)
+{
+
+	switch (cmd) {
+	case MODULE_CMD_INIT:
+		return 0;
+
+	case MODULE_CMD_FINI:
+		return EOPNOTSUPP;
+
+	default:
+		return ENOTTY;
+	}
+}



CVS commit: src/usr.bin/touch

2012-10-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Oct 22 21:51:58 UTC 2012

Modified Files:
src/usr.bin/touch: touch.1 touch.c

Log Message:
Recognize --date and --reference like gnu.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/usr.bin/touch/touch.1
cvs rdiff -u -r1.31 -r1.32 src/usr.bin/touch/touch.c

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

Modified files:

Index: src/usr.bin/touch/touch.1
diff -u src/usr.bin/touch/touch.1:1.21 src/usr.bin/touch/touch.1:1.22
--- src/usr.bin/touch/touch.1:1.21	Fri Jul 27 14:34:35 2012
+++ src/usr.bin/touch/touch.1	Mon Oct 22 17:51:58 2012
@@ -1,4 +1,4 @@
-.\	$NetBSD: touch.1,v 1.21 2012/07/27 18:34:35 wiz Exp $
+.\	$NetBSD: touch.1,v 1.22 2012/10/22 21:51:58 christos Exp $
 .\
 .\ Copyright (c) 1991, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -32,7 +32,7 @@
 .\
 .\ @(#)touch.1	8.3 (Berkeley) 4/28/95
 .\
-.Dd July 24, 2012
+.Dd October 22, 2012
 .Dt TOUCH 1
 .Os
 .Sh NAME
@@ -66,6 +66,7 @@ The
 utility does not treat this as an error.
 No error messages are displayed and the exit value is not affected.
 .It Fl d Ar human-datetime
+.It Fl Fl date Ar human-datetime
 Parse
 .Ar human-datetime
 using the human datetime parser
@@ -84,6 +85,7 @@ The access time of the file is not chang
 .Fl a
 flag is also specified.
 .It Fl r Ar file
+.It Fl Fl reference Ar file
 Use the access and modifications times from
 .Ar file
 instead of the current time of day.

Index: src/usr.bin/touch/touch.c
diff -u src/usr.bin/touch/touch.c:1.31 src/usr.bin/touch/touch.c:1.32
--- src/usr.bin/touch/touch.c:1.31	Tue Jul 24 21:23:46 2012
+++ src/usr.bin/touch/touch.c	Mon Oct 22 17:51:58 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: touch.c,v 1.31 2012/07/25 01:23:46 christos Exp $	*/
+/*	$NetBSD: touch.c,v 1.32 2012/10/22 21:51:58 christos Exp $	*/
 
 /*
  * Copyright (c) 1993
@@ -39,7 +39,7 @@ __COPYRIGHT(@(#) Copyright (c) 1993\
 #if 0
 static char sccsid[] = @(#)touch.c	8.2 (Berkeley) 4/28/95;
 #endif
-__RCSID($NetBSD: touch.c,v 1.31 2012/07/25 01:23:46 christos Exp $);
+__RCSID($NetBSD: touch.c,v 1.32 2012/10/22 21:51:58 christos Exp $);
 #endif /* not lint */
 
 #include sys/types.h
@@ -57,6 +57,7 @@ __RCSID($NetBSD: touch.c,v 1.31 2012/07
 #include tzfile.h
 #include unistd.h
 #include util.h
+#include getopt.h
 
 static void	stime_arg0(char *, struct timeval *);
 static void	stime_arg1(char *, struct timeval *);
@@ -64,6 +65,15 @@ static void	stime_arg2(char *, int, stru
 static void	stime_file(char *, struct timeval *);
 __dead static void	usage(void);
 
+struct option touch_longopts[] = {
+	{ date,		required_argument,	0,
+		'd' },
+	{ reference,		required_argument,	0,
+		'r' },
+	{ NULL,			0,			0,
+		0 },
+};
+
 int
 main(int argc, char *argv[])
 {
@@ -80,7 +90,8 @@ main(int argc, char *argv[])
 	if (gettimeofday(tv[0], NULL))
 		err(1, gettimeofday);
 
-	while ((ch = getopt(argc, argv, acd:fhmr:t:)) != -1)
+	while ((ch = getopt_long(argc, argv, acd:fhmr:t:, touch_longopts,
+	NULL)) != -1)
 		switch(ch) {
 		case 'a':
 			aflag = 1;
@@ -320,7 +331,7 @@ static void
 usage(void)
 {
 	(void)fprintf(stderr,
-	Usage: %s [-acfhm] [-d datetime] [-r file] [-t time] file ...\n,
+	Usage: %s [-acfhm] [-d|--date datetime] [-r|--reference file] [-t time] file ...\n,
 	getprogname());
 	exit(EXIT_FAILURE);
 }



CVS commit: src/usr.bin/touch

2012-10-22 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Oct 22 22:59:33 UTC 2012

Modified Files:
src/usr.bin/touch: touch.1

Log Message:
Note that -d flag also precludes historical usage.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/usr.bin/touch/touch.1

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/touch/touch.1
diff -u src/usr.bin/touch/touch.1:1.22 src/usr.bin/touch/touch.1:1.23
--- src/usr.bin/touch/touch.1:1.22	Mon Oct 22 21:51:58 2012
+++ src/usr.bin/touch/touch.1	Mon Oct 22 22:59:33 2012
@@ -1,4 +1,4 @@
-.\	$NetBSD: touch.1,v 1.22 2012/10/22 21:51:58 christos Exp $
+.\	$NetBSD: touch.1,v 1.23 2012/10/22 22:59:33 pgoyette Exp $
 .\
 .\ Copyright (c) 1991, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -143,7 +143,8 @@ The obsolescent form of
 .Nm ,
 where a time format is specified as the first argument, is supported.
 When no
-.Fl r
+.Fl r ,
+.Fl d ,
 or
 .Fl t
 option is specified, there are at least two arguments, and the first



CVS commit: src/sbin/wsconsctl

2012-10-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Oct 23 01:59:18 UTC 2012

Modified Files:
src/sbin/wsconsctl: map_parse.y

Log Message:
- remove obsolete = { syntac
- print context for yyerror()
- add a production to clarify a syntax error


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sbin/wsconsctl/map_parse.y

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

Modified files:

Index: src/sbin/wsconsctl/map_parse.y
diff -u src/sbin/wsconsctl/map_parse.y:1.10 src/sbin/wsconsctl/map_parse.y:1.11
--- src/sbin/wsconsctl/map_parse.y:1.10	Sat Aug 27 15:01:34 2011
+++ src/sbin/wsconsctl/map_parse.y	Mon Oct 22 21:59:18 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: map_parse.y,v 1.10 2011/08/27 19:01:34 joerg Exp $ */
+/*	$NetBSD: map_parse.y,v 1.11 2012/10/23 01:59:18 christos Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@ ksym_lookup(keysym_t ksym)
 
 %%
 
-program		: = {
+program		: {
 			int i;
 			struct wscons_keymap *mp;
 
@@ -123,7 +123,7 @@ expr		: keysym_expr
 		| keycode_expr
 		;
 
-keysym_expr	: T_KEYSYM keysym_var = keysym_var = {
+keysym_expr	: T_KEYSYM keysym_var = keysym_var {
 			size_t src, dst;
 
 			dst = ksym_lookup($2);
@@ -134,7 +134,7 @@ keysym_expr	: T_KEYSYM keysym_var = ke
 		}
 		;
 
-keycode_expr	: T_KEYCODE T_NUMBER = = {
+keycode_expr	: T_KEYCODE T_NUMBER = {
 			if ($2 = KS_NUMKEYCODES)
 errx(EXIT_FAILURE, %d: keycode too large, $2);
 			if ((unsigned int)$2 = newkbmap.maplen)
@@ -144,35 +144,38 @@ keycode_expr	: T_KEYCODE T_NUMBER = = 
 		;
 
 keysym_cmd	: /* empty */
-		| T_KEYSYM_CMD_VAR = {
+		| T_KEYSYM_CMD_VAR {
 			cur_mp-command = $1;
 		}
-		| T_CMD T_KEYSYM_CMD_VAR = {
+		| T_CMD T_KEYSYM_CMD_VAR {
 			cur_mp-command = KS_Cmd;
 			cur_mp-group1[0] = $2;
+		} 
+		| T_CMD T_KEYSYM_VAR {
+			yyerror(Not a command keysym);
 		}
 		;
 
 keysym_list	: /* empty */
-		| keysym_var = {
+		| keysym_var {
 			cur_mp-group1[0] = $1;
 			cur_mp-group1[1] = ksym_upcase(cur_mp-group1[0]);
 			cur_mp-group2[0] = cur_mp-group1[0];
 			cur_mp-group2[1] = cur_mp-group1[1];
 		}
-		| keysym_var keysym_var = {
+		| keysym_var keysym_var {
 			cur_mp-group1[0] = $1;
 			cur_mp-group1[1] = $2;
 			cur_mp-group2[0] = cur_mp-group1[0];
 			cur_mp-group2[1] = cur_mp-group1[1];
 		}
-		| keysym_var keysym_var keysym_var = {
+		| keysym_var keysym_var keysym_var {
 			cur_mp-group1[0] = $1;
 			cur_mp-group1[1] = $2;
 			cur_mp-group2[0] = $3;
 			cur_mp-group2[1] = ksym_upcase(cur_mp-group2[0]);
 		}
-		| keysym_var keysym_var keysym_var keysym_var = {
+		| keysym_var keysym_var keysym_var keysym_var {
 			cur_mp-group1[0] = $1;
 			cur_mp-group1[1] = $2;
 			cur_mp-group2[0] = $3;
@@ -180,10 +183,10 @@ keysym_list	: /* empty */
 		}
 		;
 
-keysym_var	: T_KEYSYM_VAR = {
+keysym_var	: T_KEYSYM_VAR {
 			$$ = $1;
 		}
-		| T_NUMBER = {
+		| T_NUMBER {
 			char name[2];
 			int res;
 
@@ -201,6 +204,8 @@ keysym_var	: T_KEYSYM_VAR = {
 __dead static void
 yyerror(const char *msg)
 {
+	extern char *yytext;
+	extern int yyleng;
 
-	errx(EXIT_FAILURE, parse: %s, msg);
+	errx(EXIT_FAILURE, parse: %s [%.*s], msg, yyleng, yytext);
 }