diff options
author | Rich Megginson <rmeggins@redhat.com> | 2009-10-01 15:56:20 -0600 |
---|---|---|
committer | Rich Megginson <rmeggins@redhat.com> | 2009-10-07 09:06:21 -0600 |
commit | d1214317ca2bcefd18db4e1a7414ac2a8408e5a9 (patch) | |
tree | 59081a1417b3445dc67f92db2b297b4c71398750 /ldap/admin | |
parent | 6eb6e4b521357fa28ed85ad58c7ecd6bd26a7a32 (diff) | |
download | ds-d1214317ca2bcefd18db4e1a7414ac2a8408e5a9.tar.gz ds-d1214317ca2bcefd18db4e1a7414ac2a8408e5a9.tar.xz ds-d1214317ca2bcefd18db4e1a7414ac2a8408e5a9.zip |
more updates - add missing rundir - remove ldapiautodnsuffix389-ds-base-1.2.3
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!)
Diffstat (limited to 'ldap/admin')
-rw-r--r-- | ldap/admin/src/scripts/10delautodnsuffix.pl | 23 | ||||
-rw-r--r-- | ldap/admin/src/scripts/10fixrundir.pl | 28 |
2 files changed, 51 insertions, 0 deletions
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 (); +} |