Private GIT

Skip to content
Snippets Groups Projects
Commit eca10f3f authored by Laurent Pinsivy's avatar Laurent Pinsivy
Browse files

fix(downtimes): prevent permission denied to centcore cmd for downtimeManager

parent 4e7191b9
No related branches found
No related tags found
No related merge requests found
...@@ -502,7 +502,7 @@ class CentreonDowntimeBroker extends CentreonDowntime ...@@ -502,7 +502,7 @@ class CentreonDowntimeBroker extends CentreonDowntime
/* send remote commands */ /* send remote commands */
$remoteCommands = implode(PHP_EOL, $this->remoteCommands); $remoteCommands = implode(PHP_EOL, $this->remoteCommands);
if ($remoteCommands) { if ($remoteCommands) {
file_put_contents($this->remoteCmdFile, $remoteCommands, FILE_APPEND); file_put_contents($this->remoteCmdDir . "/" . time() . "-downtimes", $remoteCommands, FILE_APPEND);
} }
} }
} }
...@@ -49,6 +49,7 @@ class CentreonDowntime ...@@ -49,6 +49,7 @@ class CentreonDowntime
protected $localCmdFile = ''; protected $localCmdFile = '';
protected $remoteCommands; protected $remoteCommands;
protected $remoteCmdFile = ''; protected $remoteCmdFile = '';
protected $remoteCmdDir = '';
protected $varlib; protected $varlib;
protected $periods = null; protected $periods = null;
protected $downtimes = null; protected $downtimes = null;
...@@ -65,7 +66,7 @@ class CentreonDowntime ...@@ -65,7 +66,7 @@ class CentreonDowntime
$this->localCommands = array(); $this->localCommands = array();
$this->remoteCommands = array(); $this->remoteCommands = array();
if (!is_null($varlib)) { if (!is_null($varlib)) {
$this->remoteCmdFile = $varlib . '/centcore.cmd'; $this->remoteCmdDir = $varlib . '/centcore';
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment