From nobody@FreeBSD.org  Mon Jan 18 11:37:48 2010
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5E4AB1065672
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 18 Jan 2010 11:37:48 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 4D7638FC14
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 18 Jan 2010 11:37:48 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o0IBbluM061694
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 18 Jan 2010 11:37:47 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id o0IBblVV061693;
	Mon, 18 Jan 2010 11:37:47 GMT
	(envelope-from nobody)
Message-Id: <201001181137.o0IBblVV061693@www.freebsd.org>
Date: Mon, 18 Jan 2010 11:37:47 GMT
From: Serg <mail_of_sergey@mail.ru>
To: freebsd-gnats-submit@FreeBSD.org
Subject: adduser script add bogus symbol at "full name" field when russian letter is deleted by backspace key
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         142932
>Category:       bin
>Synopsis:       adduser(8) script add bogus symbol at "full name" field when russian letter is deleted by backspace key
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 18 11:40:06 UTC 2010
>Closed-Date:    
>Last-Modified:  Mon Jan 18 21:11:40 UTC 2010
>Originator:     Serg
>Release:        FreeBSD 8.0-RELEASE-p2
>Organization:
>Environment:
FreeBSD acc.acc.tula.ru 8.0-RELEASE-p2 FreeBSD 8.0-RELEASE-p2 #5: Fri Jan 15 17:04:04 MSK 2010     root@acc.acc.tula.ru:/usr/src/sys/i386/compile/Z  i386
echo $LANG
ru_RU.UTF-8
putty 0.60: the backspace key: Control-? (127), charset - UTF-8.
>Description:
I connect to remote FreeBSD machine via via Putty.
I add new user by adduser script.
I type russian letters at "full name" field and delete one russian letter
by backspace key and type new russian letters.
At this case the adduser script shows the "full name" field with bogus symbol:
Password   : <blank>
Full Name  : &#1051;<D0>&#1080;&#1085;
Uid        : 1180

The bogus symbol is in brockets. I see bogus symbol D0 and D1.
This bogus symbol will be written to GEOS field of password file. :(


According to UTF-8 encoding table and Unicode characters
(http://www.utf8-chartable.de/unicode-utf8-table.pl) (don't forget select
cyrllic page) any russian letter is presented by two bytes. The first
byte is D0 (or D1 for some letters)

It is looks like the backspace key deleted only one byte of two-byte encoding.
>How-To-Repeat:
1. run adduser
2. Start to type full name by russian letters (or other two-byte presented
   letters)
3. Delete one letter by backspace key
4. Continue type letters
5. Continue add user.
6. tail /etc/passwd
>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:
