Active
Project:
Graphviz Filter
Version:
6.x-1.6
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
25 Aug 2011 at 12:05 UTC
Updated:
22 Oct 2012 at 09:59 UTC
The problem is the following function, which generates and routes the path of being a private.
function _graphviz_filter_render($dotfile, $outputfile, $format, $command) {
$command = _graphviz_create_filepath(variable_get('graphviz_filter_dot_path', ''), $command);
$command .= ' -T'.escapeshellarg($format)
.' -o'.escapeshellarg(getcwd() .'/'. $outputfile)
.' '.escapeshellarg(getcwd() .'/'. $dotfile)
.' 2>&1';
$output = array();
$return = 0;
exec($command, $output, $return);
clearstatcache();
if ($return != 0) {
$msg = 'Graphviz encountered an error while rendering to format %format:<br />%output';
$arg = array('%format' => $format, '%output' => check_plain(implode('<br />', $output)));
drupal_set_message(t($msg, $arg), 'error');
watchdog('graphviz filter', $msg, $arg, WATCHDOG_ERROR);
return FALSE;
}
return TRUE;
}
You can substitute this code
$command .= ' -T'.escapeshellarg($format)
.' -o'.escapeshellarg(getcwd() .'/'. $outputfile)
.' '.escapeshellarg(getcwd() .'/'. $dotfile)
.' 2>&1';
by this
$command .= ' -T'.escapeshellarg($format)
.' -o'. $outputfile
.' '. $dotfile
.' 2>&1';
with this change everything works fine for me
Comments
Comment #1
zuza commentedThank you, after changing this code the error message disappeared, but PNG bitmaps generated by Graphviz are available for unauthorized users. Is there any way to fix it?
Comment #2
mgzrobles commentedyou can prevent unauthorized access to this file using something like this:
Comment #2.0
mgzrobles commentedchange in description