X-Git-Url: https://www.tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fprocess.c;h=262b092c165404dd2e78f8e586a6661fac611b8a;hp=f33355ce1e739ff2837f8df919b3234f98fd37ca;hb=aa9d61b5cd0d6dd8b911cfd06f6bb50ec028d0d1;hpb=178e52f76ef4ba40748c13ea7e518837394d6dbc diff --git a/src/process.c b/src/process.c index f33355ce..262b092c 100644 --- a/src/process.c +++ b/src/process.c @@ -358,6 +358,7 @@ bool execute_script(const char *name, char **envp) { int status, len; char *scriptname; int i; + char *interpreter = NULL; #ifndef HAVE_MINGW len = xasprintf(&scriptname, "\"%s/%s\"", confbase, name); @@ -378,6 +379,16 @@ bool execute_script(const char *name, char **envp) { } #endif + // Custom scripts interpreter + if(get_config_string(lookup_config(config_tree, "ScriptsInterpreter"), &interpreter)) { + // Force custom scripts interpreter allowing execution of scripts on android without execution flag (such as on /sdcard) + free(scriptname); + len = xasprintf(&scriptname, "%s \"%s/%s\"", interpreter, confbase, name); + free(interpreter); + if(len < 0) + return false; + } + ifdebug(STATUS) logger(LOG_INFO, "Executing script %s", name); #ifdef HAVE_PUTENV