Bug 138932 - Confusion on password with period character
Summary: Confusion on password with period character
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Mike Kaganski
URL:
Whiteboard: target:7.2.0
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-15 10:06 UTC by lenainjaune
Modified: 2020-12-15 16:26 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description lenainjaune 2020-12-15 10:06:05 UTC
Description:
Hi,

I am french and I use an AZERTY keyboard. I just want to tell you about a confusing situation.

Here is the problematic condition that prompted me to open this bug report (which is more a request for improvement because it creates confusion in my opinion): I use the period character in a password to secure a document.

If I use the period character in it (which is not the comma character), I don't get the same thing if I use the alphanumeric keypad as if I use the numeric keypad.
Why ? Quite simply because the period character of the numeric keypad is considered by LibreOffice application as the decimal separator character. But the keyboard does not show this distinction. In fact users can type one or the other (I had difficulty opening some documents before I understood why).

So I suggest in LibreOffice when we type a password to manage the keys for what they represent on the keyboard to avoid confusion.

I experienced it on Linux Debian Buster x64 with LibreOffice Version: 6.1.5.2 for Calc and Writer and I suppose the problem is related only to the way libreoffice handles passwords.

Regards,
lnj

Steps to Reproduce:
1. Save the document with "save as" and with a password
2. Type a password with period character on a numeric keypad
3. Open the document and use the period character from alphanumeric keypad

Actual Results:
Bad password and the document does not open

Expected Results:
The document opens


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 6.1.5.2
Build ID: 1:6.1.5-3+deb10u6
Threads CPU : 4; OS : Linux 4.19; UI Render : par défaut; VCL: gtk3; 
Locale : fr-FR (fr_FR.UTF-8); Calc: group threaded
Comment 1 Mike Kaganski 2020-12-15 10:24:24 UTC
IMO this makes sense.

Caolan, do you know if we may somehow handle keyboard input differently in password fields wrt org.openoffice.Setup/L10N/DecimalSeparatorAsLocale?
Comment 2 Mike Kaganski 2020-12-15 10:49:43 UTC
Code pointer:

In vcl/source/window/winproc.cxx, ImplHandleKey tests if nEvCode == KEY_DECIMAL, and then behaves according to Application::GetSettings().GetMiscSettings().GetEnableLocalizedDecimalSep().

But I don't know how to check if that's a password box: pWindow points to dialog window, it seems.
Comment 3 Mike Kaganski 2020-12-15 12:00:36 UTC
So here is the proposed patch: https://gerrit.libreoffice.org/c/core/+/107751
Comment 4 Caolán McNamara 2020-12-15 12:19:36 UTC
yikes, that's a hilarious gotcha. Proposed patch looks reasonable under the circumstances
Comment 5 Commit Notification 2020-12-15 13:33:00 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/86de82ae54a243743b3775d44281dd02fcad6014

tdf#138932: don't modify KEY_DECIMAL for password box

It will be available in 7.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Commit Notification 2020-12-15 16:26:20 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/491efa1e5513f9c7901849dfb2c72e379efc91bd

tdf#138932 don't replace . with , for gtk password GtkEntries too

It will be available in 7.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.