[vhffs-dev] [1386] added a suphp patch to allow executing scripts without shebang |
[ Thread Index |
Date Index
| More vhffs.org/vhffs-dev Archives
]
Revision: 1386
Author: gradator
Date: 2009-03-19 00:26:23 +0100 (Thu, 19 Mar 2009)
Log Message:
-----------
added a suphp patch to allow executing scripts without shebang
Added Paths:
-----------
trunk/vhffs-packages/patches/suphp-0.6.2-3-add-targetmode-execute.patch
Added: trunk/vhffs-packages/patches/suphp-0.6.2-3-add-targetmode-execute.patch
===================================================================
--- trunk/vhffs-packages/patches/suphp-0.6.2-3-add-targetmode-execute.patch (rev 0)
+++ trunk/vhffs-packages/patches/suphp-0.6.2-3-add-targetmode-execute.patch 2009-03-18 23:26:23 UTC (rev 1386)
@@ -0,0 +1,36 @@
+diff -Nru a/src/Application.cpp b/src/Application.cpp
+--- a/src/Application.cpp 2006-02-05 21:21:03.000000000 +0100
++++ b/src/Application.cpp 2009-03-19 00:22:58.000000000 +0100
+@@ -447,6 +447,8 @@
+ return TARGETMODE_PHP;
+ else if (interpreter == "execute:!self")
+ return TARGETMODE_SELFEXECUTE;
++ else if (interpreter.substr(0, 8) == "execute:")
++ return TARGETMODE_EXECUTE;
+ else
+ throw SecurityException("Unknown Interpreter: " + interpreter,
+ __FILE__, __LINE__);
+@@ -472,6 +474,12 @@
+ CommandLine cline;
+ cline.putArgument(scriptFilename);
+ API_Helper::getSystemAPI().execute(scriptFilename, cline, env);
++ } else if (mode == TARGETMODE_EXECUTE) {
++ std::string interpreterPath = interpreter.substr(8);
++ CommandLine cline;
++ cline.putArgument(interpreterPath);
++ cline.putArgument(scriptFilename);
++ API_Helper::getSystemAPI().execute(interpreterPath, cline, env);
+ }
+ } catch (SystemException& e) {
+ throw SoftException("Could not execute script \"" + scriptFilename
+diff -Nru a/src/Application.hpp b/src/Application.hpp
+--- a/src/Application.hpp 2005-02-27 18:53:05.000000000 +0100
++++ b/src/Application.hpp 2009-03-19 00:22:58.000000000 +0100
+@@ -26,6 +26,7 @@
+
+ enum TargetMode {
+ TARGETMODE_PHP,
++ TARGETMODE_EXECUTE,
+ TARGETMODE_SELFEXECUTE
+ };
+