Support filepaths with accents
Needs ReviewPublic

Authored by davidedmundson on Wed, Sep 6, 11:20 PM.

Details

Reviewers
None
Group Reviewers
Plasma
Summary

Our helper runs as root and doesn't have the user's environment
(including $LANG). This defaults to one without UTF-8.

Without a locale with UTF-8
QFileInfo::exists("/home/david/wallpapers/crepé.png") returns false and
we fail to set a wallpaper.

By forcing the locale we fix that. It doesn't matter that we're using C,
as we don't have any UI related code in the helper.

BUG: 384294
Fixed-in: 5.11.0

Test Plan

Created a folder
Changed wallpaper

Diff Detail

Repository
R123 SDDM Configuration Panel (KCM)
Branch
Plasma/5.10
Lint
No Linters Available
Unit
No Unit Test Coverage
davidedmundson created this revision.Wed, Sep 6, 11:20 PM
Restricted Application added a project: Plasma. · View Herald TranscriptWed, Sep 6, 11:20 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
apol added a subscriber: apol.Thu, Sep 7, 1:32 PM
apol added inline comments.
sddmauthhelper.cpp
228

I just realized we have something similar in samba-mounter for the exact same reason:
https://cgit.kde.org/samba-mounter.git/tree/src/helper/sambahelper.cpp#n49

In this case we're forwarding the LANG from the user: in the end it's what the user requested not something specific to UTF-8. Nobody is enforcing paths to be utf8 AFAIK.

I wonder if we could come up with a generic solution...

davidedmundson added inline comments.Thu, Sep 7, 3:01 PM
sddmauthhelper.cpp
228

in my case I need to change the locale of my helper, not just subprocesses, which means I need to set it before I extract args from the user.

apol added inline comments.Fri, Sep 8, 1:34 AM
sddmauthhelper.cpp
228

Maybe it could still be done by KAuth::HelperSupport::helperMain and fix it for everyone everywhere?