Bug 344233

Summary: desktopexecparser spits out bogus arguments
Product: [Frameworks and Libraries] frameworks-kio Reporter: Harald Sitter <sitter>
Component: generalAssignee: KIO Bugs <kio-bugs-null>
Status: REPORTED ---    
Severity: major CC: kdelibs-bugs-null
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Harald Sitter 2015-02-16 11:37:57 UTC
using a desktop file with substituteuid=true and an exec line that contains option switches screws with both su -c and kdesu -c as both need to be quoted (one presumes anyway)

e.g. argumentList is:
> /usr/bin/kdesu -u root -c /usr/bin/do-release-upgrade -m desktop -f DistUpgradeViewKDE
but should be something like
> /usr/bin/kdesu -u root -c '/usr/bin/do-release-upgrade -m desktop -f DistUpgradeViewKDE'

cat ~/.local/share/applications/muon-release-upgrade.desktop
[Desktop Entry]
Categories=Qt;KDE;System;
Exec=do-release-upgrade -m desktop -f DistUpgradeViewKDE
GenericName=Release Upgrader
Icon=system-software-update
Name=Release Upgrader
NoDisplay=true
Type=Application
X-KDE-SubstituteUID=true

    KService::Ptr service = KService::serviceByDesktopName(QLatin1String("muon-release-upgrade"));
    KIO::DesktopExecParser parser(*service, QList<QUrl>());
    QProcess::startDetached(parser.resultingArguments().join(' '));

leads to 
Unknown option 'm'.


Reproducible: Always
Comment 1 Justin Zobel 2021-03-09 05:54:07 UTC
Thank you for the bug report.

As this report hasn't seen any changes in 5 years or more, we ask if you can please confirm that the issue still persists.

If this bug is no longer persisting or relevant please change the status to resolved.