From a255cf258d631a9714bbe488118442d619e52566 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Wed, 26 May 2010 22:34:34 +0000 Subject: [PATCH] chdir to modules directory before executing module --- PBot/FactoidModuleLauncher.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PBot/FactoidModuleLauncher.pm b/PBot/FactoidModuleLauncher.pm index 64de1737..8612ecac 100644 --- a/PBot/FactoidModuleLauncher.pm +++ b/PBot/FactoidModuleLauncher.pm @@ -124,6 +124,11 @@ sub execute_module { if($pid == 0) { # start child block $self->{child} = 1; # set to be killed after returning + if(not chdir $module_dir) { + $self->{pbot}->logger->log("Could not chdir to '$module_dir': $!\n"); + die $!; + } + if(defined $tonick) { $self->{pbot}->logger->log("($from): $nick!$user\@$host) sent to $tonick\n"); $text = `$module_dir/$module $arguments`;