Bug 488854 - KProcessRunner::escapeUnitName is using signed numbers to escape application names
Summary: KProcessRunner::escapeUnitName is using signed numbers to escape application ...
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 6.3.0
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: KIO Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-21 01:45 UTC by kdrk
Modified: 2024-08-13 14:28 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kdrk 2024-06-21 01:45:25 UTC
SUMMARY
KProcessRunner::escapeUnitName is called when generating systemd service names. It's using signed numbers to escape the names of the applications.

STEPS TO REPRODUCE
Run a .desktop file named "夜.desktop". Close it immediately.

OBSERVED RESULT
The following entry is logged in journalctl -e
Jun 20 19:06:10 hostname systemd[3368]: app-\x-1b\x-5c\x-64@3991d30e5b5a45448a73899c539c2f34.service: Consumed 1.877s CPU time.

EXPECTED RESULT
The part generated by KProcessRunner::escapeUnitName should use unsigned hex numbers:  \xe5\xa4\x9c instead of \x-1b\x-5c\x-64

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20240618
KDE Plasma Version: 6.0.5
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.1
Comment 1 Bug Janitor Service 2024-08-13 10:33:56 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/1685
Comment 2 David Redondo 2024-08-13 14:28:09 UTC
Git commit 9df9d3e9ecebd01f512dd00a4ca7b7fb15b26abc by David Redondo.
Committed on 13/08/2024 at 10:32.
Pushed by davidre into branch 'master'.

Correctly escape unit names

When char is signed we where implicitely calling the QString::arg(int, ...
overload.

M  +1    -1    src/gui/kprocessrunner.cpp

https://invent.kde.org/frameworks/kio/-/commit/9df9d3e9ecebd01f512dd00a4ca7b7fb15b26abc