From ebbbda978619648ae361d00fea8075304f31f4f8 Mon Sep 17 00:00:00 2001 From: "ian%hixie.ch" Date: Sat, 20 Sep 2003 18:17:53 +0000 Subject: [PATCH] 'IGNORE' doesn't seem to work on all platforms. Let's go back to our old reaping code. It still seems to fix the bug. Also, fix another instance of the '/bin/bash might be tainted' problem. --- webtools/mozbot/mozbot.pl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/webtools/mozbot/mozbot.pl b/webtools/mozbot/mozbot.pl index 08722b78e68..32487aef893 100755 --- a/webtools/mozbot/mozbot.pl +++ b/webtools/mozbot/mozbot.pl @@ -83,7 +83,7 @@ $SIG{'INT'} = sub { &killed('INT'); }; $SIG{'KILL'} = sub { &killed('KILL'); }; $SIG{'TERM'} = sub { &killed('TERM'); }; -$SIG{'CHLD'} = 'IGNORE'; # autoreap children +$SIG{'CHLD'} = sub { wait(); }; # reap children # this allows us to exit() without shutting down (by exec($0)ing) BEGIN { exit() if ((defined($ARGV[0])) and ($ARGV[0] eq '--abort')); } @@ -2482,10 +2482,11 @@ sub Restart { $self->debug("About to defer to a new $0 process..."); # we have done our best to shutdown, so go for it! eval { + $0 =~ m/^(.*)$/os; # untaint $0 so that we can call it below (as $1) if ($CHROOT) { - exec { $0 } ($0, '--assume-chrooted', $cfgfile); + exec { $1 } ($1, '--assume-chrooted', $cfgfile); } else { - exec { $0 } ($0, $cfgfile); + exec { $1 } ($1, $cfgfile); } # I am told (by some nice people in #perl on Efnet) that our # memory is all cleared up for us. So don't worry that even