summaryrefslogtreecommitdiffstats
path: root/ldap/admin/src/scripts/10cleanupldapi.pl
blob: a09abe6733c4c092ccd810d0bd70df41b7ef2df4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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 $ldapifile;

    # 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());
    }

    $ldapifile = $ent->getValues('nsslapd-ldapifilepath');
    if ($ldapifile) {
        unlink($ldapifile);
    }

    return ();
}