This file is indexed.

/usr/share/icingaweb2/test/php/bootstrap.php is in icingaweb2-common 2.4.1-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
/* Icinga Web 2 | (c) 2014 Icinga Development Team | GPLv2+ */

$applicationPath = realpath(dirname(__FILE__) . '/../../application/');
$modulePath = realpath(dirname(__FILE__) . '/../../modules/');
$libraryPath = realpath(dirname(__FILE__) . '/../../library/');
$testLibraryPath = realpath(dirname(__FILE__) . '/library/');
$configPath = realpath($libraryPath . '/../config');

// Is usually done in the application's bootstrap and is used by some of our internals
if (!defined('ICINGAWEB_APPDIR')) {
    define('ICINGAWEB_APPDIR', $applicationPath);
}
if (!defined('ICINGA_LIBDIR')) {
    define('ICINGA_LIBDIR', $libraryPath);
}

// This is needed to get the Zend Plugin loader working
set_include_path(implode(PATH_SEPARATOR, array($libraryPath, get_include_path())));

require_once 'Mockery/Loader.php';
$mockeryLoader = new \Mockery\Loader;
$mockeryLoader->register();

require_once($libraryPath . '/Icinga/Test/ClassLoader.php');

$loader = new Icinga\Test\ClassLoader();
$loader->registerNamespace('Tests', $testLibraryPath);
$loader->registerNamespace('Icinga', $libraryPath . '/Icinga');
$loader->registerNamespace('Icinga\\Forms', $applicationPath . '/forms');

$modules = scandir($modulePath);
foreach ($modules as $module) {
    if ($module === '.' || $module === '..') {
        continue;
    }

    $moduleNamespace = 'Icinga\\Module\\' . ucfirst($module);
    $moduleLibraryPath = $modulePath . '/' . $module . '/library/' . ucfirst($module);

    if (is_dir($moduleLibraryPath)) {
        $loader->registerNamespace($moduleNamespace, $moduleLibraryPath);
    }

    $moduleTestPath = $modulePath . '/' . $module . '/test/php';
    if (is_dir($moduleTestPath)) {
        $loader->registerNamespace('Tests\\' . $moduleNamespace, $moduleTestPath);
    }

    $moduleFormPath = $modulePath . '/' . $module . '/application/forms';
    if (is_dir($moduleFormPath)) {
        $loader->registerNamespace($moduleNamespace . '\\Forms', $moduleFormPath);
    }
}

$loader->register();

set_include_path(
    implode(
        PATH_SEPARATOR,
        array($libraryPath . '/vendor', get_include_path())
    )
);

require_once 'Zend/Loader/Autoloader.php';
\Zend_Loader_Autoloader::getInstance();

Icinga\Application\Config::$configDir = $configPath;