X-Git-Url: https://www.tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fprocess.c;h=262b092c165404dd2e78f8e586a6661fac611b8a;hp=a3de06591c86b40ccf28b7c3bb1102adee70c258;hb=3bd810ea79d6933839ddac4a2cf1445c51947d38;hpb=257cb6ac60bb0924720de9e252cdf7f4759bf741 diff --git a/src/process.c b/src/process.c index a3de0659..262b092c 100644 --- a/src/process.c +++ b/src/process.c @@ -1,7 +1,7 @@ /* process.c -- process management functions Copyright (C) 1999-2005 Ivo Timmermans, - 2000-2009 Guus Sliepen + 2000-2011 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -25,6 +25,7 @@ #include "device.h" #include "edge.h" #include "logger.h" +#include "net.h" #include "node.h" #include "pidfile.h" #include "process.h" @@ -41,10 +42,9 @@ extern char *identname; extern char *pidfilename; extern char **g_argv; extern bool use_logfile; -extern volatile bool running; #ifndef HAVE_MINGW -sigset_t emptysigset; +static sigset_t emptysigset; #endif static int saved_debug_level = -1; @@ -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 @@ -511,7 +522,7 @@ static RETSIGTYPE sigusr1_handler(int a) { } static RETSIGTYPE sigusr2_handler(int a) { - dump_device_stats(); + devops.dump_stats(); dump_nodes(); dump_edges(); dump_subnets();