You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've added a custom library path for icingaweb2 in the apache config. After that I created my own library in this path. The name of the library (composer.json) does not contain any slash. When I now navigate to configuration->module and view other modules having dependencies, like vspheredb or icingadb, I get this exception:
This exception points to a condition inside Libraries.php. The elseif clause just assumes every name has at least one slash without testing for it.
publicfunctionget($name)
{
$candidate = null;
foreach ($this->librariesas$library) {
$libraryName = $library->getName();
if ($libraryName === $name) {
return$library;
} elseif (explode('/', $libraryName)[1] === $name) {
// Also return libs which only partially match$candidate = $library;
}
}
return$candidate;
}
If I change the name of my library to have at least one slash inside its name, then the exception is gone.
To Reproduce
Go to /etc/httpd/conf.d/icingaweb2.conf and change the libdir like this: SetEnv ICINGAWEB_LIBDIR "/usr/share/icinga-php:/usr/share/icingaweb2/modules/libraries".
( I know this is not 100% clean, because its inside the module path, but it was working so far)
Reload Apache Service
Create your own library inside the non-default path and in the composer.json give it a name not containing any slash.
In IcingaWeb, navigate to configuration->module and click any module, which is having dependencies for libraries. E.g.: icingadb or vspheredb
Expected behavior
Don't throw exception when names of libraries not contain a slash
Screenshots
Your Environment
Include as many relevant details about the environment you experienced the problem in
Icinga Web 2 version and modules (System - About): 2.9.6
Web browser used: Chromium (108.0.5359.125)
Icinga 2 version used (icinga2 --version): 2.13.6
PHP version used (php --version): 7.3.33
Server operating system and version: RHEL 7.9
Additional context
The text was updated successfully, but these errors were encountered:
Describe the bug
I've added a custom library path for icingaweb2 in the apache config. After that I created my own library in this path. The name of the library (composer.json) does not contain any slash. When I now navigate to
configuration->module
and view other modules having dependencies, like vspheredb or icingadb, I get this exception:This exception points to a condition inside
Libraries.php
. Theelseif
clause just assumes every name has at least one slash without testing for it.If I change the name of my library to have at least one slash inside its name, then the exception is gone.
To Reproduce
/etc/httpd/conf.d/icingaweb2.conf
and change the libdir like this:SetEnv ICINGAWEB_LIBDIR "/usr/share/icinga-php:/usr/share/icingaweb2/modules/libraries"
.( I know this is not 100% clean, because its inside the module path, but it was working so far)
composer.json
give it a name not containing any slash.configuration->module
and click any module, which is having dependencies for libraries. E.g.: icingadb or vspheredbExpected behavior
Don't throw exception when names of libraries not contain a slash
Screenshots
Your Environment
Include as many relevant details about the environment you experienced the problem in
icinga2 --version
): 2.13.6php --version
): 7.3.33Additional context
The text was updated successfully, but these errors were encountered: