VERSION.sh | 2 +-
ldap/admin/src/scripts/50fixNsState.pl | 14 ++++++++++----
ldap/admin/src/scripts/DSCreate.pm.in | 4 ++--
ldap/admin/src/scripts/DSUpdate.pm.in | 8 +++++++-
ldap/servers/plugins/replication/windows_protocol_util.c | 9 +++++++--
ldap/servers/slapd/back-ldbm/ldbm_search.c | 10 +++++-----
ldap/servers/slapd/opshared.c | 12 ------------
7 files changed, 32 insertions(+), 27 deletions(-)
New commits:
commit 9ef5240e2e0d2867f150cbc363b3918214c52ff1
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Thu Sep 1 14:15:39 2011 -0600
bump version to 1.2.9.9
diff --git a/VERSION.sh b/VERSION.sh
index 2794d1c..b224300 100644
--- a/VERSION.sh
+++ b/VERSION.sh
@@ -10,7 +10,7 @@ vendor="389 Project"
# PACKAGE_VERSION is constructed from these
VERSION_MAJOR=1
VERSION_MINOR=2
-VERSION_MAINT=9.8
+VERSION_MAINT=9.9
# if this is a PRERELEASE, set VERSION_PREREL
# otherwise, comment it out
# be sure to include the dot prefix in the prerel
commit 1eee799f02555ee8e959193b5c53c3a10ce359f7
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Thu Sep 1 10:30:06 2011 -0600
Bug 735121 - simple paged search + ip/dns based ACI hangs server
https://bugzilla.redhat.com/show_bug.cgi?id=735121
Resolves: bug 735121
Bug Description: simple paged search + ip/dns based ACI hangs server
Reviewed by: nhosoi (Thanks!)
Branch: 389-ds-base-1.2.9
Fix Description: The pb_conn->c_mutex lock around be->be_next_search_entry()
was too big. Other code inside be->be_next_search_entry needs to lock
the conn. In this particular case, the aci code needed to access the
client ip address from the conn object. The fix is to remove the mutex
around be->be_next_search_entry() in iterate() and instead make sure
code that accesses pb_conn locks first.
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
(cherry picked from commit b5f77c693d50ca3acf58eb7a41d9eded59328632)
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_search.c
b/ldap/servers/slapd/back-ldbm/ldbm_search.c
index ddebaaf..b204428 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_search.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_search.c
@@ -1228,7 +1228,7 @@ ldbm_back_next_search_entry_ext( Slapi_PBlock *pb, int use_extension
)
if ( slapi_op_abandoned( pb ) || (NULL == sr) )
{
/* in case paged results, clean up the conn */
- pagedresults_set_search_result(pb->pb_conn, NULL, 1);
+ pagedresults_set_search_result(pb->pb_conn, NULL, 0);
slapi_pblock_set( pb, SLAPI_SEARCH_RESULT_SET, NULL );
slapi_pblock_set( pb, SLAPI_SEARCH_RESULT_SET_SIZE_ESTIMATE, &estimate
);
if ( use_extension ) {
@@ -1245,7 +1245,7 @@ ldbm_back_next_search_entry_ext( Slapi_PBlock *pb, int use_extension
)
if ( tlimit != -1 && curtime > stoptime )
{
/* in case paged results, clean up the conn */
- pagedresults_set_search_result(pb->pb_conn, NULL, 1);
+ pagedresults_set_search_result(pb->pb_conn, NULL, 0);
slapi_pblock_set( pb, SLAPI_SEARCH_RESULT_SET, NULL );
slapi_pblock_set( pb, SLAPI_SEARCH_RESULT_SET_SIZE_ESTIMATE, &estimate
);
if ( use_extension ) {
@@ -1262,7 +1262,7 @@ ldbm_back_next_search_entry_ext( Slapi_PBlock *pb, int use_extension
)
if ( llimit != -1 && sr->sr_lookthroughcount >= llimit )
{
/* in case paged results, clean up the conn */
- pagedresults_set_search_result(pb->pb_conn, NULL, 1);
+ pagedresults_set_search_result(pb->pb_conn, NULL, 0);
slapi_pblock_set( pb, SLAPI_SEARCH_RESULT_SET, NULL );
slapi_pblock_set( pb, SLAPI_SEARCH_RESULT_SET_SIZE_ESTIMATE, &estimate
);
if ( use_extension ) {
@@ -1282,7 +1282,7 @@ ldbm_back_next_search_entry_ext( Slapi_PBlock *pb, int use_extension
)
/* No more entries */
/* destroy back_search_result_set */
/* in case paged results, clean up the conn */
- pagedresults_set_search_result(pb->pb_conn, NULL, 1);
+ pagedresults_set_search_result(pb->pb_conn, NULL, 0);
slapi_pblock_set( pb, SLAPI_SEARCH_RESULT_SET, NULL );
slapi_pblock_set( pb, SLAPI_SEARCH_RESULT_SET_SIZE_ESTIMATE, &estimate
);
if ( use_extension ) {
@@ -1425,7 +1425,7 @@ ldbm_back_next_search_entry_ext( Slapi_PBlock *pb, int use_extension
)
if ( --slimit < 0 ) {
CACHE_RETURN( &inst->inst_cache, &e );
/* in case paged results, clean up the conn */
- pagedresults_set_search_result(pb->pb_conn, NULL, 1);
+ pagedresults_set_search_result(pb->pb_conn, NULL, 0);
slapi_pblock_set( pb, SLAPI_SEARCH_RESULT_SET, NULL );
slapi_pblock_set( pb, SLAPI_SEARCH_RESULT_SET_SIZE_ESTIMATE,
&estimate );
delete_search_result_set( &sr );
diff --git a/ldap/servers/slapd/opshared.c b/ldap/servers/slapd/opshared.c
index b65507b..d533d01 100644
--- a/ldap/servers/slapd/opshared.c
+++ b/ldap/servers/slapd/opshared.c
@@ -1150,19 +1150,7 @@ iterate(Slapi_PBlock *pb, Slapi_Backend *be, int send_result,
slapi_pblock_get (pb, SLAPI_OPERATION, &operation);
is_paged = operation->o_flags & OP_FLAG_PAGED_RESULTS;
- /*
- * If it is paged results, the search result set could be released when
- * it reaches the timelimit. This lock protects the search result set
- * not to be released while sending a next entry.
- * (see pagedresults_cleanup called from disconnect_server_nomutex)
- */
- if ( is_paged && pb->pb_conn && pb->pb_conn->c_mutex )
{
- PR_Lock( pb->pb_conn->c_mutex );
- }
rc = be->be_next_search_entry(pb);
- if ( is_paged && pb->pb_conn && pb->pb_conn->c_mutex )
{
- PR_Unlock( pb->pb_conn->c_mutex );
- }
if (rc < 0)
{
/*
commit 737cd0807f67b42a05d6b15de6cbbd0fee34fd7e
Author: Nathan Kinder <nkinder(a)redhat.com>
Date: Thu Sep 1 09:41:06 2011 -0700
Bug 722292 - (cov#11030) Leak of mapped_sdn in winsync rename code
The previous fix for bug 722292 introduced a memory leak of the
mapped DN used to detect entry renames. This ensures that we
free the mapped DN.
Branch: 389-ds-base-1.2.9
(cherry picked from commit 576d90b25524b06dad4b5497fc6f7e5e673c8899)
diff --git a/ldap/servers/plugins/replication/windows_protocol_util.c
b/ldap/servers/plugins/replication/windows_protocol_util.c
index a1c8c0d..771475b 100644
--- a/ldap/servers/plugins/replication/windows_protocol_util.c
+++ b/ldap/servers/plugins/replication/windows_protocol_util.c
@@ -4509,7 +4509,7 @@ windows_update_local_entry(Private_Repl_Protocol *prp,Slapi_Entry
*remote_entry,
newrdn ? newrdn:"NULL", newsuperior ? newsuperior:"NULL");
slapi_ch_free_string(&newsuperior);
slapi_rdn_done(&rdn);
- return retval;
+ goto bail;
}
slapi_ch_free_string(&newsuperior);
slapi_rdn_done(&rdn);
@@ -4524,10 +4524,12 @@ windows_update_local_entry(Private_Repl_Protocol *prp,Slapi_Entry
*remote_entry,
"failed to get local entry \"%s\" after rename\n",
slapi_sdn_get_ndn(mapped_sdn));
local_entry = orig_local_entry;
- return retval;
+ orig_local_entry = NULL;
+ goto bail;
}
}
+
slapi_mods_init (&smods, 0);
retval =
windows_generate_update_mods(prp,remote_entry,local_entry,0,&smods,&do_modify);
@@ -4566,6 +4568,9 @@ windows_update_local_entry(Private_Repl_Protocol *prp,Slapi_Entry
*remote_entry,
slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,
"no mods generated for local entry: %s\n", escape_string(dn, dnbuf));
}
+
+bail:
+ slapi_sdn_free(&mapped_sdn);
slapi_mods_done(&smods);
if (orig_local_entry) {
slapi_entry_free(local_entry);
commit 311c606e011c12e507457928bdb5fbab673bd142
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Tue Aug 30 17:47:55 2011 -0600
Bug 703990 - cross-platform - Support upgrade from Red Hat Directory Server
https://bugzilla.redhat.com/show_bug.cgi?id=703990
Resolves: bug 703990
Bug Description: cross-platform - Support upgrade from Red Hat Directory Server
Reviewed by: nhosoi (Thanks!)
Branch: 389-ds-base-1.2.9
Fix Description: There was bug in handling nsState from big-endian systems.
Also, create the instance specific directories if they do not exist, which
is useful if doing a cross-platform upgrade from a system that does not
use the same paths.
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
(cherry picked from commit 1afc45edb18d22c6bb9c7160a1065f7ec3560622)
diff --git a/ldap/admin/src/scripts/50fixNsState.pl
b/ldap/admin/src/scripts/50fixNsState.pl
index acf6506..b331e9c 100644
--- a/ldap/admin/src/scripts/50fixNsState.pl
+++ b/ldap/admin/src/scripts/50fixNsState.pl
@@ -72,7 +72,7 @@ sub convert_uniqueid {
my $maxdiff = 86400*365*10; # 10 years
if (($tsdiff > $maxdiff) || (($last_update != 0) && ($last_update != 1)))
{
# try big endian
- ($tslow, $tshigh, $node, $clockseq, $last_update) = unpack($bigfmt, $val);
+ ($tshigh, $tslow, $node, $clockseq, $last_update) = unpack($bigfmt, $val);
$ts = convert_from_32bit($tshigh, $tslow);
$tssecs = ($ts - 0x01B21DD213814000) / 10000000;
$tsdiff = abs($curts - $tssecs);
@@ -120,7 +120,7 @@ sub convert_replica {
$timefmt = 'V'; # timevals are unsigned 64-bit int
$fmtstr = "vx" . $pad . $timefmt . "6vx" . $pad;
$bigfmtstr = 'nx' . $pad . 'N' . '6nx' . $pad;
- ($rid, $st_low, $st_high, $lo_low, $lo_high, $rt_low, $rt_high, $seq_num) =
unpack($fmtstr, $val);
+ ($rid, $st_low, $st_high, $lo_low, $lo_high, $ro_low, $ro_high, $seq_num) =
unpack($fmtstr, $val);
$sampled_time = convert_from_32bit($st_high, $st_low);
$local_offset = convert_from_32bit($lo_high, $lo_low);
$remote_offset = convert_from_32bit($ro_high, $ro_low);
@@ -134,7 +134,7 @@ sub convert_replica {
if ($len <= 20) {
($rid, $sampled_time, $local_offset, $remote_offset, $seq_num) =
unpack($bigfmtstr, $val);
} else {
- ($rid, $st_low, $st_high, $lo_low, $lo_high, $rt_low, $rt_high, $seq_num) =
unpack($bigfmtstr, $val);
+ ($rid, $st_high, $st_low, $lo_high, $lo_low, $ro_high, $ro_low, $seq_num) =
unpack($bigfmtstr, $val);
$sampled_time = convert_from_32bit($st_high, $st_low);
$local_offset = convert_from_32bit($lo_high, $lo_low);
$remote_offset = convert_from_32bit($ro_high, $ro_low);
@@ -222,13 +222,19 @@ sub testit {
#my $testval = "00a43cb4d11db2018b7912fd0000a42e01000000";
#my $testval = "0029B605D21DB201FEB70FFC00007EB301000000";
#my $testval = "00E8FEB72B80E001EC359ED2F4D9F1670100000000000000";
-my $testval = "00123781D21DB201F74C95A90000862201000000";
+#my $testval = "00123781D21DB201F74C95A90000862201000000";
+my $testval = '01E0D2DA53198600A12C2D6BADF15D630100000000000000';
+my $testreplval =
"\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00N\\\x8b5\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x01\x00\x00\x00\x00\x00\x00";
my $testdecval = $testval;
# base16 decode
$testdecval =~ s/(..)/chr(hex($1))/eg;
my $ent = new Mozilla::LDAP::Entry;
$ent->setDN("cn=uniqueid generator");
my ($rc, $newval) = convert_uniqueid($ent, $testdecval);
+$ent->setDN('cn=replica');
+my ($rc, $newval2) = convert_replica($ent, $testreplval);
}
+testit() unless caller();
+
1;
diff --git a/ldap/admin/src/scripts/DSCreate.pm.in
b/ldap/admin/src/scripts/DSCreate.pm.in
index ed40ae1..6af5910 100644
--- a/ldap/admin/src/scripts/DSCreate.pm.in
+++ b/ldap/admin/src/scripts/DSCreate.pm.in
@@ -64,9 +64,9 @@ use Mozilla::LDAP::LDIF;
use Exporter;
@ISA = qw(Exporter);
-@EXPORT = qw(createDSInstance removeDSInstance setDefaults createInstanceScripts
+@EXPORT = qw(createDSInstance removeDSInstance setDefaults createInstanceScripts
makeDSDirs
makeOtherConfigFiles installSchema updateSelinuxPolicy
updateTmpfilesDotD);
-@EXPORT_OK = qw(createDSInstance removeDSInstance setDefaults createInstanceScripts
+@EXPORT_OK = qw(createDSInstance removeDSInstance setDefaults createInstanceScripts
makeDSDirs
makeOtherConfigFiles installSchema updateSelinuxPolicy
updateTmpfilesDotD);
use strict;
diff --git a/ldap/admin/src/scripts/DSUpdate.pm.in
b/ldap/admin/src/scripts/DSUpdate.pm.in
index 3b6ccd5..36aa3c9 100644
--- a/ldap/admin/src/scripts/DSUpdate.pm.in
+++ b/ldap/admin/src/scripts/DSUpdate.pm.in
@@ -47,7 +47,8 @@ package DSUpdate;
use DSUtil;
use Inf;
use FileConn;
-use DSCreate qw(setDefaults createInstanceScripts makeOtherConfigFiles
updateSelinuxPolicy updateTmpfilesDotD);
+use DSCreate qw(setDefaults createInstanceScripts makeOtherConfigFiles
+ makeDSDirs updateSelinuxPolicy updateTmpfilesDotD);
use File::Basename qw(basename dirname);
@@ -314,6 +315,11 @@ sub updateDSInstance {
return @errs;
}
+ # create dirs if missing e.g. cross platform upgrade
+ if (@errs = makeDSDirs($inf)) {
+ return @errs;
+ }
+
# upgrade instance scripts
if (@errs = createInstanceScripts($inf, 0)) {
return @errs;