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

zuza’s picture

Thank 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?

mgzrobles’s picture

you can prevent unauthorized access to this file using something like this:

/**
 * Implementation of hook_file_download().
 */
function YOURMODULE_file_download($filepath) {
  /*
   *  CODE TO VALIDATE
   */
  if ( ! $access) {
    return -1;
  }
}
mgzrobles’s picture

Issue summary: View changes

change in description