Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for #206 - can't find graphviz binary dot #388

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion share/server/core/sources/automap_pos.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ function automap_check_graphviz($binary) {
$bFound = false;
foreach(Array(cfg('automap','graphvizpath').$binary, $binary) AS $path) {
// Check if dot can be found in path (If it is there $returnCode is 0, if not it is 1)
exec('which '.$path.' 2>/dev/null', $arrReturn, $exitCode);
// Thanks @NicolasGoeddel for the fix for this that makes it safer and makes it work on at least
// some CentOS 7+ / Red Hat family Linux systems.
// Fixes https://github.com/NagVis/nagvis/issues/206
exec('PATH='.escapeshellarg($_SERVER['PATH']).' which '.escapeshellarg($path).' 2>&1', $arrReturn, $exitCode);

if($exitCode == 0) {
$automap_graphviz_path = str_replace($binary, '', $arrReturn[0]);
Expand Down