bin/142932: adduser script add bogus symbol at "full name" field
when russian letter is deleted by backspace key
mail_of_sergey at mail.ru
Mon Jan 18 11:40:07 UTC 2010
>Synopsis: adduser script add bogus symbol at "full name" field when russian letter is deleted by backspace key
>Arrival-Date: Mon Jan 18 11:40:06 UTC 2010
>Release: FreeBSD 8.0-RELEASE-p2
FreeBSD acc.acc.tula.ru 8.0-RELEASE-p2 FreeBSD 8.0-RELEASE-p2 #5: Fri Jan 15 17:04:04 MSK 2010 root at acc.acc.tula.ru:/usr/src/sys/i386/compile/Z i386
putty 0.60: the backspace key: Control-? (127), charset - UTF-8.
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 : Л<D0>ин
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 cyrylic 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.
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. Conrinue add user.
6. tail /etc/passwd
More information about the freebsd-bugs