From owner-freebsd-hackers@FreeBSD.ORG  Wed May 28 21:29:42 2003
Return-Path: <owner-freebsd-hackers@FreeBSD.ORG>
Delivered-To: freebsd-hackers@freebsd.org
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id D334E37B401
	for <freebsd-hackers@FreeBSD.org>;
	Wed, 28 May 2003 21:29:42 -0700 (PDT)
Received: from mail.auriga.ru (mail.auriga.ru [80.240.102.102])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 3EA7243F75
	for <freebsd-hackers@FreeBSD.org>;
	Wed, 28 May 2003 21:29:42 -0700 (PDT)
	(envelope-from alex.neyman@auriga.ru)
Received: from mail.loopback.interface ([127.0.0.1] helo=vagabond.auriga.ru)
	by mail.auriga.ru with esmtp (Exim 4.14)
	id 19LF5t-00042N-IP; Thu, 29 May 2003 08:32:49 +0400
From: Alexey Neyman <alex.neyman@auriga.ru>
Organization: Auriga, Inc
To: Alexey Neyman <alex.neyman@auriga.ru>
Date: Thu, 29 May 2003 08:29:54 +0400
User-Agent: KMail/1.5.2
References: <200305290825.55132.alex.neyman@auriga.ru>
In-Reply-To: <200305290825.55132.alex.neyman@auriga.ru>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200305290829.54686.alex.neyman@auriga.ru>
cc: freebsd-hackers@FreeBSD.org
Subject: Re: should pw(8) accept spaces/tabs in passwords?
X-BeenThere: freebsd-hackers@freebsd.org
X-Mailman-Version: 2.1.1
Precedence: list
List-Id: Technical Discussions relating to FreeBSD
	<freebsd-hackers.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-hackers>,
	<mailto:freebsd-hackers-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-hackers>
List-Post: <mailto:freebsd-hackers@freebsd.org>
List-Help: <mailto:freebsd-hackers-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-hackers>,
	<mailto:freebsd-hackers-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 29 May 2003 04:29:43 -0000

On Thursday 29 May 2003 08:25, Alexey Neyman wrote:
> attached patch makes it behave consistently with passwd(1).

Seems that attachments are stripped somewhere on the way; resend inline.

Index: pw_user.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/pw/pw_user.c,v
retrieving revision 1.54
diff -u -r1.54 pw_user.c
--- pw_user.c	2003/02/11 02:17:11	1.54
+++ pw_user.c	2003/05/29 04:14:36
@@ -639,7 +639,7 @@
 				return EX_IOERR;
 			}
 			line[b] = '\0';
-			if ((p = strpbrk(line, " \t\r\n")) != NULL)
+			if ((p = strpbrk(line, "\r\n")) != NULL)
 				*p = '\0';
 			if (!*line)
 				errx(EX_DATAERR, "empty password read on file descriptor %d", fd);
Index: pw_group.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/pw/pw_group.c,v
retrieving revision 1.13
diff -u -r1.13 pw_group.c
--- pw_group.c	2000/06/22 16:48:41	1.13
+++ pw_group.c	2003/05/29 04:14:37
@@ -192,7 +192,7 @@
 				return EX_OSERR;
 			}
 			line[b] = '\0';
-			if ((p = strpbrk(line, " \t\r\n")) != NULL)
+			if ((p = strpbrk(line, "\r\n")) != NULL)
 				*p = '\0';
 			if (!*line)
 				errx(EX_DATAERR, "empty password read on file descriptor %d", fd);


-- 
,----------------------------------------,
| A quoi ca sert d'etre sur la terre     | Alexey V. Neyman
| Si c'est pour faire nos vies a genoux! | mailto:alex.neyman@auriga.ru
`------------------( Les Rois du Monde )-'