This file is indexed.

/usr/bin/imp-admin-upgrade is in php-horde-imp 6.2.21-1ubuntu1.

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

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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/usr/bin/php
<?php
/**
 * Perform admin upgrade tasks specific to IMP.
 *
 * Copyright 2013-2017 Horde LLC (http://www.horde.org/)
 *
 * See the enclosed file COPYING for license information (GPL). If you
 * did not receive this file, see http://www.horde.org/licenses/gpl.
 *
 * @author    Michael Slusarz <slusarz@horde.org>
 * @category  Horde
 * @copyright 2013-2017 Horde LLC
 * @license   http://www.horde.org/licenses/gpl GPL
 * @package   IMP
 */

$baseFile = __DIR__ . '/../lib/Application.php';
if (file_exists($baseFile)) {
    require_once $baseFile;
} else {
    require_once 'PEAR/Config.php';
    require_once PEAR_Config::singleton()
        ->get('horde_dir', null, 'pear.horde.org') . '/imp/lib/Application.php';
}
Horde_Registry::appInit('imp', array('cli' => true));

$parser = new Horde_Argv_Parser();
$parser->addOption('-t', '--task', array(
    'dest' => 'task',
    'help' => 'Upgrade task'
));
list($values,) = $parser->parseArgs();

switch ($values->task) {
case 'backend_perms':
case 'backend_perms_force':
    $upgrade = array(
        'create_folders' => 'create_mboxes',
        'max_folders' => 'max_create_mboxes'
    );

    $backends = array_keys(IMP_Imap::loadServerConfig());
    $perms = $injector->getInstance('Horde_Perms');

    $cli->message($cli->bold('Upgrading permissions.'));

    if ($values->task == 'backend_perms_force') {
        foreach ($backends as $backend) {
            try {
                $perms->removePermission($perms->getPermission('imp:' . $backend), true);
                $cli->message(sprintf('Force deletion of all "%s" backend permissions.', $backend));
            } catch (Horde_Exception $e) {}
        }
    }

    foreach ($upgrade as $key => $val) {
        $pkey = 'imp:' . $key;

        try {
            if ($perms->exists($pkey)) {
                $pval = $perms->getPermission($pkey);

                foreach ($backends as $backend) {
                    $parent_perm = 'imp:' . $backend;
                    if (!$perms->exists($parent_perm)) {
                        $perms->addPermission($perms->newPermission($parent_perm));
                    }

                    $perm_edit = clone $pval;
                    $perm_edit->setName($parent_perm . ':' . $key);
                    $perms->addPermission($perm_edit);
                    $cli->message(sprintf('Added "%s" permission to the "%s" backend.', $key, $backend));
                }

                $perms->removePermission($pval);
                $cli->message(sprintf('Removed obsolete "%s" permission.', $key));
            }
        } catch (Horde_Exception $e) {
            $cli->message(sprintf('Error upgrading "%s" permission: %s.', $key, $e->getMessage()), 'cli.error');
        }
    }

    $cli->message($cli->bold('DONE upgrading permissions.'));
    break;
}