From: Guus Sliepen Date: Sun, 24 Mar 2002 16:22:59 +0000 (+0000) Subject: Don't try to execute scripts unless they exist. X-Git-Tag: release-1.0pre6~22 X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=commitdiff_plain;h=6ad5dd1a9adb1c1322ceb44d6f0fd160229e72ff;hp=594d5b5d15551bd802c43926c7cb8863b7531654 Don't try to execute scripts unless they exist. --- diff --git a/src/process.c b/src/process.c index a7f5d5ff..0b17d7ac 100644 --- a/src/process.c +++ b/src/process.c @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id: process.c,v 1.1.2.37 2002/03/19 00:07:09 guus Exp $ + $Id: process.c,v 1.1.2.38 2002/03/24 16:22:59 guus Exp $ */ #include "config.h" @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -260,7 +261,13 @@ int execute_script(const char *name) { pid_t pid; int status; + struct stat s; cp + /* First check if there is a script */ + + if(stat(name, &s)) + return 0; + if((pid = fork()) < 0) { syslog(LOG_ERR, _("System call `%s' failed: %s"), "fork", strerror(errno));