3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-26 13:59:47 +01:00

chdir to modules directory before executing module

This commit is contained in:
Pragmatic Software 2010-05-26 22:34:34 +00:00
parent a04dae42ca
commit a255cf258d

View File

@ -124,6 +124,11 @@ sub execute_module {
if($pid == 0) { # start child block if($pid == 0) { # start child block
$self->{child} = 1; # set to be killed after returning $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) { if(defined $tonick) {
$self->{pbot}->logger->log("($from): $nick!$user\@$host) sent to $tonick\n"); $self->{pbot}->logger->log("($from): $nick!$user\@$host) sent to $tonick\n");
$text = `$module_dir/$module $arguments`; $text = `$module_dir/$module $arguments`;