Skip to content

Locate desktop files more carefully

Vlad Zahorodnii requested to merge work/zzag/window-finddesktopfile-careful into master

It may happen that the specified app id is a file path to a binary file. In which case, the findDesktopFile() will return that file path and KConfig will try to parse a binary file.

On the other hand, the findDesktopFile() function should ideally always append the ".desktop" suffix. If there's no file with such a file name, nothing should be returned. But due to some Qt applications providing app ids with the ".desktop" suffix, the findDesktopFile() function also tries to find a desktop file without appending the ".desktop" suffix. However, the fallback code doesn't actually try to verify that the desktop file name contains the ".desktop" suffix, which can result in the findDesktopFile() function providing values that it shouldn't. In this case, returning the file path to a binary executable.

BUG: 492584

Edited by Vlad Zahorodnii

Merge request reports

Loading