aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-01-16 13:31:24 -0500
committerKen Moore <ken@ixsystems.com>2017-01-16 13:31:24 -0500
commit5886e6a0b95057014431cc7b2d5c9e3907678ed7 (patch)
tree18eca77096c1c5c54f220065d824edb52177aef2
parentMerge branch 'master' of github.com:trueos/lumina (diff)
downloadlumina-5886e6a0b95057014431cc7b2d5c9e3907678ed7.tar.gz
lumina-5886e6a0b95057014431cc7b2d5c9e3907678ed7.tar.bz2
lumina-5886e6a0b95057014431cc7b2d5c9e3907678ed7.zip
Quick fix for running files with the executable bit set: Only run them if they have no extension or a ".sh" extension (can extend later to check if there is no known mimetype as another valid use-case).
-rw-r--r--src-qt5/core/lumina-open/main.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src-qt5/core/lumina-open/main.cpp b/src-qt5/core/lumina-open/main.cpp
index 2d86327c..8d9f4cda 100644
--- a/src-qt5/core/lumina-open/main.cpp
+++ b/src-qt5/core/lumina-open/main.cpp
@@ -1,6 +1,6 @@
//===========================================
// Lumina-DE source code
-// Copyright (c) 2012, Ken Moore
+// Copyright (c) 2012-2017, Ken Moore
// Available under the 3-clause BSD license
// See the LICENSE file for full details
//===========================================
@@ -234,7 +234,7 @@ void getCMD(int argc, char ** argv, QString& binary, QString& args, QString& pat
if(inFile.startsWith("file://")){ inFile.remove(0,7); }
//First make sure this is not a binary name first
QString bin = inFile.section(" ",0,0).simplified();
- if(LUtils::isValidBinary(bin) && !bin.endsWith(".desktop") && !QFileInfo(inFile).isDir() ){isFile=true; extension="binary"; }
+ if(LUtils::isValidBinary(bin) && !bin.endsWith(".desktop") && !QFileInfo(inFile).isDir() ){isFile=true; }
//Now check what type of file this is
else if(QFile::exists(inFile)){ isFile=true; }
else if(QFile::exists(QDir::currentPath()+"/"+inFile)){isFile=true; inFile = QDir::currentPath()+"/"+inFile;} //account for relative paths
@@ -248,7 +248,7 @@ void getCMD(int argc, char ** argv, QString& binary, QString& args, QString& pat
extension=info.suffix();
//qDebug() << " - Extension:" << extension;
if(info.isDir()){ extension="inode/directory"; }
- else if(info.isExecutable() && extension.isEmpty()){ extension="binary"; }
+ else if(info.isExecutable() && (extension.isEmpty() || extension=="sh") ){ extension="binary"; }
else if(extension!="desktop"){ extension="mimetype"; } //flag to check for mimetype default based on file
}
else if(isUrl && inFile.startsWith("mailto:")){ extension = "application/email"; }
bgstack15