summaryrefslogtreecommitdiffstats
path: root/library/Director/Core/LegacyDeploymentApi.php
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 13:17:47 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 13:17:47 +0000
commit5419d4428c86c488a43124f85e5407d7cbae6541 (patch)
tree772c4221a20fd7d1b3e7e67c6e21755a50e80fd7 /library/Director/Core/LegacyDeploymentApi.php
parentAdding upstream version 1.10.2. (diff)
downloadicingaweb2-module-director-5419d4428c86c488a43124f85e5407d7cbae6541.tar.xz
icingaweb2-module-director-5419d4428c86c488a43124f85e5407d7cbae6541.zip
Adding upstream version 1.11.1.upstream/1.11.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--library/Director/Core/LegacyDeploymentApi.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/library/Director/Core/LegacyDeploymentApi.php b/library/Director/Core/LegacyDeploymentApi.php
index 7287c4a..0ab77e0 100644
--- a/library/Director/Core/LegacyDeploymentApi.php
+++ b/library/Director/Core/LegacyDeploymentApi.php
@@ -128,6 +128,10 @@ class LegacyDeploymentApi implements DeploymentApiInterface
if (file_exists($path)) {
if (is_link($path)) {
$linkTarget = readlink($path);
+ if (! $linkTarget) {
+ throw new IcingaException('Failed to read symlink');
+ }
+
$linkTargetDir = dirname($linkTarget);
$linkTargetName = basename($linkTarget);
@@ -165,7 +169,7 @@ class LegacyDeploymentApi implements DeploymentApiInterface
$this->assertDeploymentPath();
$dh = @opendir($this->deploymentPath);
- if ($dh === null) {
+ if ($dh === false) {
throw new IcingaException('Can not list contents of %s', $this->deploymentPath);
}
@@ -279,7 +283,7 @@ class LegacyDeploymentApi implements DeploymentApiInterface
$this->mkdir(dirname($fullPath), true);
$fh = @fopen($fullPath, 'w');
- if ($fh === null) {
+ if ($fh === false) {
throw new IcingaException('Could not open file "%s" for writing.', $fullPath);
}
chmod($fullPath, $this->file_mode);
@@ -334,7 +338,7 @@ class LegacyDeploymentApi implements DeploymentApiInterface
protected function listDirectoryContents($path, $depth = 0)
{
$dh = @opendir($path);
- if ($dh === null) {
+ if ($dh === false) {
throw new IcingaException('Can not list contents of %s', $path);
}