streamlets: find only executable files v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Sun, 19 Jan 2020 15:44:30 +0100
branchv_0
changeset 47 beefddde951e
parent 46 b5ae61996281
child 48 26a8b1a14889
streamlets: find only executable files
src/StreamletAttributeFinder.h
--- a/src/StreamletAttributeFinder.h	Sun Jan 19 00:57:22 2020 +0100
+++ b/src/StreamletAttributeFinder.h	Sun Jan 19 15:44:30 2020 +0100
@@ -21,6 +21,7 @@
 #include <regex>
 #include <memory>
 #include <sstream>
+#include <unistd.h>
 
 #include <relpipe/writer/typedefs.h>
 #include <relpipe/writer/AttributeMetadata.h>
@@ -53,7 +54,7 @@
 				if (streamletPath[i] == ':' || i == streamletPathSize - 1) { // FIXME: support \: and \\ escaping
 					current << L"/" << field.name;
 					fs::path streamletFile(current.str());
-					if (fs::exists(streamletFile)) { // FIXME: check executable bit
+					if (fs::exists(streamletFile) && ::access(streamletFile.c_str(), X_OK) == 0) { // n.b. must be set executable using e.g. chmod – files executable through only ACL, are actually not executable
 						return current.str();
 					} else {
 						current.str(L"");