From 68854aaed74ec69c0cde0ff4aea0bf9aacbf363e Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Tue, 31 Mar 2015 01:17:00 +0200 Subject: [PATCH] - mod_yparser: add find-exec function; return full path and filename of given executabe --- src/nhttpd/yhttpd_mods/mod_yparser.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/nhttpd/yhttpd_mods/mod_yparser.cpp b/src/nhttpd/yhttpd_mods/mod_yparser.cpp index 35464dbe4..6d3670553 100644 --- a/src/nhttpd/yhttpd_mods/mod_yparser.cpp +++ b/src/nhttpd/yhttpd_mods/mod_yparser.cpp @@ -371,8 +371,9 @@ std::string CyParser::cgi_cmd_parsing(CyhookHandler *hh, // ini-set:;;[~open|save|cache] // if-empty:~~ // if-equal:~~~ (left_value == right_value?) -// if-not-equal:~~~ (left_val!e == right_value?) +// if-not-equal:~~~ (left_value == right_value?) // if-file-exists:~~ +// find-exec: // include-block:;[;] // var-get: // var-set:= @@ -427,6 +428,8 @@ std::string CyParser::YWeb_cgi_cmd(CyhookHandler *hh, std::string ycmd) { yresult = (access(if_value, R_OK) == 0) ? if_then : if_else; } + } else if (ycmd_type == "find-exec") { + yresult = find_executable(ycmd_name.c_str()); } else if (ycmd_type == "include") { std::string ytmp; std::fstream fin(ycmd_name.c_str(), std::fstream::in);