Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/user Fix -p:



details:   https://anonhg.NetBSD.org/src/rev/5a2f485b4099
branches:  trunk
changeset: 748192:5a2f485b4099
user:      hubertf <hubertf%NetBSD.org@localhost>
date:      Thu Oct 15 23:03:02 2009 +0000

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

diffstat:

 usr.sbin/user/user.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 9ebb117e81c2 -r 5a2f485b4099 usr.sbin/user/user.c
--- a/usr.sbin/user/user.c      Thu Oct 15 22:59:12 2009 +0000
+++ b/usr.sbin/user/user.c      Thu Oct 15 23:03:02 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: user.c,v 1.123 2009/03/20 02:53:47 mike Exp $ */
+/* $NetBSD: user.c,v 1.124 2009/10/15 23:03:02 hubertf 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.123 2009/03/20 02:53:47 mike Exp $");
+__RCSID("$NetBSD: user.c,v 1.124 2009/10/15 23:03:02 hubertf 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);



Home | Main Index | Thread Index | Old Index