use pwquality_strerror to get error strings
ClosedPublic

Authored by sitter on Jun 27 2019, 1:08 PM.

Details

Summary

libpwquality has localized error string mappings, no need to reinvent
the wheel here. the previous mapping was fairly incomplete resulting in
cases where one would get the generic "use another password" option
was shown, which is fairly meh as it can mean literally anything.

should libpwquality for whatever reason fail to provide a string we will
still fall back to the unfortunate generic default. better than nothing
I suppose.

also carry around auxerror. it contains data such as how many digits
would have been reuired. auxerror doesn't need freeing it simply contains
pointers to internals for the benefit of pwquality_strerror

CHANGELOG: Password quality problems are better explained in the UI

Test Plan

password 'a' now gets error'd as a palindrom rather than the generic error. other errors such as too-short, no-match continue to be reported properly as well

Diff Detail

Repository
R128 User Manager
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
sitter created this revision.Jun 27 2019, 1:08 PM
Restricted Application added a project: Plasma. · View Herald TranscriptJun 27 2019, 1:08 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
sitter requested review of this revision.Jun 27 2019, 1:08 PM
anthonyfieroni added inline comments.
src/passworddialog.cpp
157

Shouldn't be fromUtf8 ? You can't handle all languages by latin.

sitter added inline comments.Jun 27 2019, 3:18 PM
src/passworddialog.cpp
157

Oh, indeed!

Concept makes sense.
+1

@ltoscano can you confirm you're ok from an i18n side.

sitter updated this revision to Diff 60770.Jun 28 2019, 12:18 PM

use fromUtf8

sitter marked 2 inline comments as done.Jun 28 2019, 12:18 PM

Concept makes sense.
+1

@ltoscano can you confirm you're ok from an i18n side.

ping @ltoscano

Sorry, I totally missed the notifications (but I received them).

I think that there is an encoding issue with any characters over the canonical 127 base ones. Observed with Italian and Ukrainian, see

and
.

Is that with the latest diff (the one changed to fromUtf8)?

LANGUAGE=uk seems to work for me

ltoscano accepted this revision.Jul 31 2019, 2:45 PM

My bad, there were some typos in the value of the variable.

I confirm that it works. +1 from the translation point of view.

This revision is now accepted and ready to land.Jul 31 2019, 2:45 PM
This revision was automatically updated to reflect the committed changes.