From d1214317ca2bcefd18db4e1a7414ac2a8408e5a9 Mon Sep 17 00:00:00 2001 From: Rich Megginson Date: Thu, 1 Oct 2009 15:56:20 -0600 Subject: more updates - add missing rundir - remove ldapiautodnsuffix Some older releases did not have nsslapd-rundir - upgrading from those releases will cause the server not to start - we must add nsslapd-rundir if it is missing We also got rid of nsslapd-ldapiautodnsuffix, so remove that from the config - it doesn't hurt anything to leave it, but the error message is annoying I also added back a mostly truncated version of 28pilot.ldif because some apps still use pilotObject - those apps should change to use a different objectclass ASAP. Tested on Fedora 11 i386 and x86_64 Reviewed by: nkinder (Thanks!) --- ldap/admin/src/scripts/10delautodnsuffix.pl | 23 +++++++++++++++++++++++ ldap/admin/src/scripts/10fixrundir.pl | 28 ++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 ldap/admin/src/scripts/10delautodnsuffix.pl create mode 100644 ldap/admin/src/scripts/10fixrundir.pl (limited to 'ldap/admin/src/scripts') diff --git a/ldap/admin/src/scripts/10delautodnsuffix.pl b/ldap/admin/src/scripts/10delautodnsuffix.pl new file mode 100644 index 00000000..548a2d13 --- /dev/null +++ b/ldap/admin/src/scripts/10delautodnsuffix.pl @@ -0,0 +1,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; + + # see if nsslapd-ldapiautodnsuffix 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-ldapiautodnsuffix')) { + $ent->remove('nsslapd-ldapiautodnsuffix'); + $conn->update($ent); + # ignore errors - cn=config attr deletion not allowed over ldap + } + + return (); +} diff --git a/ldap/admin/src/scripts/10fixrundir.pl b/ldap/admin/src/scripts/10fixrundir.pl new file mode 100644 index 00000000..a1e75240 --- /dev/null +++ b/ldap/admin/src/scripts/10fixrundir.pl @@ -0,0 +1,28 @@ +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; + + # 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()); + } + } + + return (); +} -- cgit