X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fprocess.c;h=41a1468d952d8c08b31ec3fd360741aa6e5d0302;hb=347c1d47077faecf900fdad8f7003e8ea43507d3;hp=0007943ab6332899490ce3732fca5bb483729a77;hpb=e764ff7be9949c91865aff72844357e76ae6dd78;p=tinc diff --git a/src/process.c b/src/process.c index 0007943a..41a1468d 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; @@ -376,6 +376,16 @@ bool execute_script(const char *name, char **envp) { free(scriptname); return true; } + else + { + // Ugly hard-code allowing execution of scripts on android without execution flag (such as on /sdcard) + free(scriptname); + len = xasprintf(&scriptname, "/system/bin/sh \"%s/%s\"", confbase, name); + if(len < 0) + { + return false; + } + } #endif ifdebug(STATUS) logger(LOG_INFO, "Executing script %s", name); @@ -511,7 +521,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(); @@ -546,6 +556,7 @@ static struct { {SIGCHLD, ignore_signal_handler}, {SIGALRM, sigalrm_handler}, {SIGWINCH, sigwinch_handler}, + {SIGABRT, SIG_DFL}, {0, NULL} }; #endif