Module Name:    src
Committed By:   sborrill
Date:           Fri Oct 16 14:50:41 UTC 2009

Modified Files:
        src/usr.sbin/user [netbsd-5]: user.c

Log Message:
Pull up the following revisions(s) (requested by hubertf in ticket #1096):
        usr.sbin/user/user.c:   revision 1.124

Fix -p flag.
- rm_eo is the first character *after* the match, so no need for a +1.
- Blowfish hashes are only 53 chars long, not 54.


To generate a diff of this commit:
cvs rdiff -u -r1.120.4.1 -r1.120.4.2 src/usr.sbin/user/user.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.sbin/user/user.c
diff -u src/usr.sbin/user/user.c:1.120.4.1 src/usr.sbin/user/user.c:1.120.4.2
--- src/usr.sbin/user/user.c:1.120.4.1	Sun Mar 15 20:03:49 2009
+++ src/usr.sbin/user/user.c	Fri Oct 16 14:50:41 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: user.c,v 1.120.4.1 2009/03/15 20:03:49 snj Exp $ */
+/* $NetBSD: user.c,v 1.120.4.2 2009/10/16 14:50:41 sborrill Exp $ */
 
 /*
  * Copyright (c) 1999 Alistair G. Crooks.  All rights reserved.
@@ -33,7 +33,7 @@
 #ifndef lint
 __COPYRIGHT("@(#) Copyright (c) 1999\
  The NetBSD Foundation, Inc.  All rights reserved.");
-__RCSID("$NetBSD: user.c,v 1.120.4.1 2009/03/15 20:03:49 snj Exp $");
+__RCSID("$NetBSD: user.c,v 1.120.4.2 2009/10/16 14:50:41 sborrill Exp $");
 #endif
 
 #include <sys/types.h>
@@ -908,7 +908,7 @@
 
 static passwd_type_t	passwd_types[] = {
 	{ "$sha1",	5,	28,	"\\$[^$]+\\$[^$]+\\$[^$]+\\$(.*)", 1 },	/* SHA1 */
-	{ "$2a",	3,	54,	"\\$[^$]+\\$[^$]+\\$(.*)",	1 },	/* Blowfish */
+	{ "$2a",	3,	53,	"\\$[^$]+\\$[^$]+\\$(.*)",	1 },	/* Blowfish */
 	{ "$1",		2,	34,	NULL,				0 },	/* MD5 */
 	{ "",		0,	DES_Len,NULL,				0 },	/* standard DES */
 	{ NULL,		(size_t)~0,	(size_t)~0,	NULL,		0 }
@@ -932,7 +932,7 @@
 			if (regexec(&r, newpasswd, 10, matchv, 0) == 0) {
 				regfree(&r);
 				return (int)(matchv[pwtp->re_sub].rm_eo -
-				    matchv[pwtp->re_sub].rm_so + 1) ==
+				    matchv[pwtp->re_sub].rm_so) ==
 				    pwtp->length;
 			}
 			regfree(&r);

Reply via email to