Bug 149369 - KDE widget that accepts password behaves wrong when keyboard layout is not US
Summary: KDE widget that accepts password behaves wrong when keyboard layout is not US
Status: RESOLVED FIXED
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Stephan Kulow
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-30 06:36 UTC by Ana Guerrero
Modified: 2009-04-27 22:21 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Patch by Max Dmitrichenko <dmitrmax@rain.ifmo.ru> (1.73 KB, patch)
2007-08-30 06:38 UTC, Ana Guerrero
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ana Guerrero 2007-08-30 06:36:30 UTC
Version:            (using KDE KDE 3.5.7)
Installed from:    Debian testing/unstable Packages
OS:                Linux

[Bug from the Debian BTS: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=413055]

Max Dmitrichenko:
I have configured my keyboard for two layouts "us" and "ru". If I switch keyboard to "ru" layout and KDE dialog prompting password appears then for every character I type into password field two asteriks appear. To reproduce it, you can run Control Center and in any administration applet click appropriate button to switch into admin mode and when dialog prompting root password appears switch the layout to different language and try to type something. Another way to reproduce it is KDE lock screen: try to enter password there with switched layout.

Plain Qt programs do not suffer from this bug. Checked on Psi.


-----

> One thing I don't fully understand in your bug report. Is it just a 'cosmetic' 
> issue - or does logging in not work?
> What if you use backspace? do one or two stars dissapear ?

No, it isn't just a 'cosmetic' issue. Backspace deletes only one star. I didn't
check weather a correct password is entered or not, because I don't have passwords which contain non-latin chars.

I suspect that problem is with UTF-8, i.e. entering a two-byte UTF-8 character displays two "*".

-----

Ok. I have found the bug and written the patch. The bug is in KPasswordEdit 
widget. The author has chosen to store password in a raw char[] array (maybe, 
for security reasons). When the password field was updated, it printed as
many * as the length of this array. Backspace deleted only one char, that
is a half of UTF-8 cyrillic char, so this is definitely a bug.

I've tested it with latin and cyrillic passwords, both works!.

-----

Attached patch from Max Dmitrichenko for your consideration.
Comment 1 Ana Guerrero 2007-08-30 06:38:07 UTC
Created attachment 21510 [details]
Patch by Max Dmitrichenko <dmitrmax@rain.ifmo.ru>
Comment 2 Dotan Cohen 2008-10-14 12:29:41 UTC
I can confirm this bug in KDE 3.x when typing in Hebrew. I will check KDE 4.x as soon as I get the chance.
Comment 3 Dotan Cohen 2009-04-27 22:21:19 UTC
This issue seems to be resolved in KDE 4.2.2. If you still have this issue, then please reopen. Thanks.