Capture output directly instead of using a temp file
authorJamie Cameron <jcameron@webmin.com>
Sat, 11 Sep 2010 18:43:16 +0000 (11:43 -0700)
committerJamie Cameron <jcameron@webmin.com>
Sat, 11 Sep 2010 18:43:16 +0000 (11:43 -0700)
bind8/bind8-lib.pl

index eec7b14..59cdb7e 100755 (executable)
@@ -1766,10 +1766,8 @@ else {
        $cmd = "chroot $chroot $config{'named_path'} -c $config{'named_conf'} $user </dev/null 2>&1";
        }
 
-local $temp = &transname();
-local $rv = &system_logged("$cmd </dev/null >$temp 2>&1");
-local $out = &read_file_contents($temp);
-unlink($temp);
+local $out = &backquote_logged("$cmd 2>&1 </dev/null");
+local $rv = $?;
 if ($rv || $out =~ /chroot.*not available/i) {
        return &text('start_error', $out ? "<tt>$out</tt>" : "Unknown error");
        }