mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 10:22:48 +00:00
kinit: make exception for authorized executable desktop files
will be required for a follow-up commit Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
e0c4945a94
commit
aa66a2e00b
1 changed files with 6 additions and 0 deletions
|
@ -23,6 +23,7 @@
|
|||
#include "kshell.h"
|
||||
#include "kconfiggroup.h"
|
||||
#include "kmessagebox.h"
|
||||
#include "kdesktopfile.h"
|
||||
#include "kmimetype.h"
|
||||
#include "kmimetypetrader.h"
|
||||
#include "kprotocolmanager.h"
|
||||
|
@ -447,6 +448,11 @@ bool KLauncherAdaptor::start_service_by_url(const QString &url, const QStringLis
|
|||
kDebug() << "MIME type of" << url << "is" << urlmimetype;
|
||||
if (KRun::isExecutable(urlmimetype)) {
|
||||
kDebug() << "execuable file" << url;
|
||||
// safety second for some
|
||||
if (urlmimetype == QLatin1String("application/x-desktop") && KDesktopFile::isAuthorizedDesktopFile(url)) {
|
||||
kDebug() << "desktop file is authorized" << url;
|
||||
return start_service_by_storage_id(url, QStringList(), envs, window, temp);
|
||||
}
|
||||
KMessageBox::sorryWId(
|
||||
static_cast<WId>(window),
|
||||
i18n("The file <tt>%1</tt> is an executable program.<br/>For safety it will not be started.", realurl.prettyUrl())
|
||||
|
|
Loading…
Add table
Reference in a new issue