This file is indexed.

/usr/share/dirsrv/updates/10fixrundir.pl is in 389-ds-base 1.3.3.5-4.

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
use Mozilla::LDAP::Conn;
use Mozilla::LDAP::Utils qw(normalizeDN);
use Mozilla::LDAP::API qw(:constant ldap_url_parse ldap_explode_dn);

sub runinst {
    my ($inf, $inst, $dseldif, $conn) = @_;

    my @errs;
    my $mode;

    # see if nsslapd-rundir is defined
    my $ent = $conn->search("cn=config", "base", "(objectclass=*)");
    if (!$ent) {
        return ('error_finding_config_entry', 'cn=config', $conn->getErrorString());
    }

    if (!$ent->getValues('nsslapd-rundir')) {
        $ent->setValues('nsslapd-rundir', $inf->{slapd}->{run_dir});
        # mark as modified so update will use a replace instead of an add
        $ent->attrModified('nsslapd-rundir');
        $conn->update($ent);
        my $rc = $conn->getErrorCode();
        if ($rc) {
            return ('error_updating_entry', 'cn=config', $conn->getErrorString());
        }
    }

    # ensure that other doesn't have permissions on rundir
    $mode = (stat($inf->{slapd}->{run_dir}))[2] or return ('error_chmoding_file', $inf->{slapd}->{run_dir}, $!);
    # mask off permissions for other
    $mode &= 07770;
    $! = 0; # clear errno
    chmod $mode, $inf->{slapd}->{run_dir};
    if ($!) {
        return ('error_chmoding_file', $inf->{slapd}->{run_dir}, $!);
    }

    return ();
}