[Fedora-directory-commits] ldapserver/ldap/servers/plugins/statechange statechange.c, 1.7, 1.8
by Doctor Conrad
Author: rmeggins
Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/statechange
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv21558/ldapserver/ldap/servers/plugins/statechange
Modified Files:
statechange.c
Log Message:
Resolves: bug 297221
Description: rhds71 Malformed Dynamic Authorization Group makes Directory Server Crash
Reviewed by: supplemental
Fix Description: In some cases, it is ok if the filter is NULL. So just allow NULL in those cases. slapi_str2filter must take either NULL or a writable string, so make sure we pass those in correctly.
Index: statechange.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/statechange/statechange.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- statechange.c 18 Oct 2007 22:25:14 -0000 1.7
+++ statechange.c 19 Oct 2007 15:36:01 -0000 1.8
@@ -331,7 +331,8 @@
item->dn = 0;
item->filter = slapi_ch_strdup(filter);
item->caller_data = caller_data;
- if (NULL == (item->realfilter = slapi_str2filter(writable_filter))) {
+ if (writable_filter &&
+ (NULL == (item->realfilter = slapi_str2filter(writable_filter)))) {
slapi_log_error(SLAPI_LOG_FATAL, SCN_PLUGIN_SUBSYSTEM,
"Error: invalid filter in statechange entry [%s]: [%s]\n",
dn, filter);
@@ -341,6 +342,8 @@
slapi_ch_free_string(&writable_filter);
slapi_ch_free((void **)&item);
return -1;
+ } else if (!writable_filter) {
+ item->realfilter = NULL;
}
item->func = func;
16 years, 6 months
[Fedora-directory-commits] ldapserver/ldap/servers/plugins/acl aclanom.c, 1.6, 1.7 acllas.c, 1.9, 1.10
by Doctor Conrad
Author: rmeggins
Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/acl
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv21558/ldapserver/ldap/servers/plugins/acl
Modified Files:
aclanom.c acllas.c
Log Message:
Resolves: bug 297221
Description: rhds71 Malformed Dynamic Authorization Group makes Directory Server Crash
Reviewed by: supplemental
Fix Description: In some cases, it is ok if the filter is NULL. So just allow NULL in those cases. slapi_str2filter must take either NULL or a writable string, so make sure we pass those in correctly.
Index: aclanom.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/acl/aclanom.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- aclanom.c 10 Nov 2006 23:44:49 -0000 1.6
+++ aclanom.c 19 Oct 2007 15:36:01 -0000 1.7
@@ -238,8 +238,16 @@
}
a_profile->anom_targetinfo[a_numacl].anom_filter = NULL;
- if ( aci->targetFilterStr )
+ if ( aci->targetFilterStr ) {
a_profile->anom_targetinfo[a_numacl].anom_filter = slapi_str2filter ( aci->targetFilterStr );
+ if (NULL == a_profile->anom_targetinfo[a_numacl].anom_filter) {
+ const char *dn = slapi_sdn_get_dn ( aci->aci_sdn );
+ slapi_log_error(SLAPI_LOG_FATAL, plugin_name,
+ "Error: invalid filter [%s] in anonymous aci in entry [%s]\n",
+ aci->targetFilterStr, dn);
+ goto cleanup;
+ }
+ }
i = 0;
srcattrArray = aci->targetAttr;
Index: acllas.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/acl/acllas.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- acllas.c 18 Oct 2007 22:25:13 -0000 1.9
+++ acllas.c 19 Oct 2007 15:36:01 -0000 1.10
@@ -3027,7 +3027,7 @@
/* Convert the filter string */
f = slapi_str2filter ( ludp->lud_filter );
- if (f == NULL) { /* bogus filter */
+ if (ludp->lud_filter && (f == NULL)) { /* bogus filter */
slapi_log_error(SLAPI_LOG_FATAL, plugin_name,
"DS_LASUserAttrEval: The member URL search filter in entry [%s] is not valid: [%s]\n",
n_clientdn, ludp->lud_filter);
@@ -3036,8 +3036,8 @@
}
rc = ACL_TRUE;
- if (0 != slapi_vattr_filter_test ( aclpb->aclpb_pblock,
- aclpb->aclpb_client_entry, f, 0 /* no acces chk */ ))
+ if (f && (0 != slapi_vattr_filter_test ( aclpb->aclpb_pblock,
+ aclpb->aclpb_client_entry, f, 0 /* no acces chk */ )))
rc = ACL_FALSE;
ldap_free_urldesc( ludp );
@@ -3843,6 +3843,8 @@
int rc = ACL_FALSE;
Slapi_Filter *f = NULL;
+ PR_ASSERT(str);
+
if ((f = slapi_str2filter(str)) == NULL) {
slapi_log_error(SLAPI_LOG_FATAL, plugin_name,
"Warning: Bad targetfilter(%s) in aci: does not match\n", str);
16 years, 6 months
[Fedora-directory-commits] ldapserver/ldap/servers/slapd ssl.c, 1.15, 1.16
by Doctor Conrad
Author: rmeggins
Update of /cvs/dirsec/ldapserver/ldap/servers/slapd
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv13543
Modified Files:
ssl.c
Log Message:
Resolves: bug 336881
Bug Description: qualify warning message when cert8.db is missing
Reviewed by: self
Fix Description: Only warn when both cert8.db and cert7.db are missing. If cert7.db is there, NSS will automatically create cert8.db from it.
Platforms tested: RHEL5 x86_64
Flag Day: no
Doc impact: no
QA impact: should be covered by regular nightly and manual testing
New Tests integrated into TET: none
Index: ssl.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/ssl.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- ssl.c 18 Oct 2007 00:08:34 -0000 1.15
+++ ssl.c 19 Oct 2007 03:19:07 -0000 1.16
@@ -364,10 +364,15 @@
char *filename = slapi_ch_smprintf("%s/cert8.db", dir);
PRStatus status = PR_Access(filename, PR_ACCESS_READ_OK);
if (PR_SUCCESS != status) {
- slapi_log_error(SLAPI_LOG_FATAL, "SSL Initialization",
- "Warning: certificate DB file %s does not exist - SSL initialization will likely fail\n",
- filename);
- }
+ slapi_ch_free_string(&filename);
+ filename = slapi_ch_smprintf("%s/cert7.db", dir);
+ status = PR_Access(filename, PR_ACCESS_READ_OK);
+ if (PR_SUCCESS != status) {
+ slapi_log_error(SLAPI_LOG_FATAL, "SSL Initialization",
+ "Warning: certificate DB file cert8.db nor cert7.db exists - SSL initialization will likely fail\n",
+ filename);
+ }
+ }
slapi_ch_free_string(&filename);
}
16 years, 6 months
[Fedora-directory-commits] ldapserver/ldap/ldif template-suffix-db.ldif.in, 1.1, 1.2
by Doctor Conrad
Author: rmeggins
Update of /cvs/dirsec/ldapserver/ldap/ldif
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv13517/ldapserver/ldap/ldif
Modified Files:
template-suffix-db.ldif.in
Log Message:
Resolves: bug 339041
Bug Description: migration : encryption key entries missing when source is 6.21
Reviewed by: self
Fix Description: Just always create those entries when creating the backend. The server does this at startup, but I guess for this case that occurs too late in the startup process.
Platforms tested: RHEL5 x86_64
Flag Day: no
Doc impact: no
QA impact: should be covered by regular nightly and manual testing
New Tests integrated into TET: none
Index: template-suffix-db.ldif.in
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/ldif/template-suffix-db.ldif.in,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- template-suffix-db.ldif.in 19 Jun 2007 18:24:57 -0000 1.1
+++ template-suffix-db.ldif.in 19 Oct 2007 03:17:56 -0000 1.2
@@ -7,6 +7,16 @@
nsslapd-suffix: %ds_suffix%
cn: %ds_bename%
+dn: cn=encrypted attribute keys,cn=%ds_bename%,cn=ldbm database,cn=plugins,cn=config
+objectClass: top
+objectClass: extensibleObject
+cn: encrypted attributes keys
+
+dn: cn=encrypted attributes,cn=%ds_bename%,cn=ldbm database,cn=plugins,cn=config
+objectClass: top
+objectClass: extensibleObject
+cn: encrypted attributes
+
dn: cn="%ds_suffix%",cn=mapping tree,cn=config
objectclass: top
objectclass: extensibleObject
16 years, 6 months
[Fedora-directory-commits] ldapserver/ldap/servers/slapd/back-ldbm back-ldbm.h, 1.11, 1.12 ldbm_attrcrypt.c, 1.10, 1.11
by Doctor Conrad
Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv4455/ldap/servers/slapd/back-ldbm
Modified Files:
back-ldbm.h ldbm_attrcrypt.c
Log Message:
Resolves: #339031
Summary: Solaris: warnings reported by the Solaris compiler
Index: back-ldbm.h
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/back-ldbm.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- back-ldbm.h 16 Oct 2007 17:30:58 -0000 1.11
+++ back-ldbm.h 19 Oct 2007 02:09:24 -0000 1.12
@@ -54,8 +54,10 @@
/* needed by at least HPUX and Solaris, to define off64_t */
#ifdef DB_USE_64LFS
+#if !defined(_LARGEFILE64_SOURCE)
#define _LARGEFILE64_SOURCE
#endif
+#endif
/* A bunch of random system headers taken from all the source files, no source file should #include
any system headers now */
Index: ldbm_attrcrypt.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/ldbm_attrcrypt.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- ldbm_attrcrypt.c 18 Oct 2007 00:08:34 -0000 1.10
+++ ldbm_attrcrypt.c 19 Oct 2007 02:09:24 -0000 1.11
@@ -588,7 +588,7 @@
output_buffer_length = in_size + 16;
output_buffer = (unsigned char *)slapi_ch_malloc(output_buffer_length);
/* Now call NSS to do the cipher op */
- iv_item.data = "aaaaaaaaaaaaaaaa"; /* ptr to an array of IV bytes */
+ iv_item.data = (unsigned char *)"aaaaaaaaaaaaaaaa"; /* ptr to an array of IV bytes */
iv_item.len = acs->ace->iv_length; /* length of the array of IV bytes */
security_parameter = slapd_pk11_ParamFromIV(acs->ace->cipher_mechanism, &iv_item);
if (NULL == security_parameter) {
16 years, 6 months
[Fedora-directory-commits] ldapserver/ldap/servers/plugins/replication cl5_api.c, 1.19, 1.20 windows_protocol_util.c, 1.37, 1.38
by Doctor Conrad
Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/replication
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv4455/ldap/servers/plugins/replication
Modified Files:
cl5_api.c windows_protocol_util.c
Log Message:
Resolves: #339031
Summary: Solaris: warnings reported by the Solaris compiler
Index: cl5_api.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/cl5_api.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- cl5_api.c 18 Oct 2007 00:08:31 -0000 1.19
+++ cl5_api.c 19 Oct 2007 02:09:24 -0000 1.20
@@ -43,6 +43,7 @@
/* cl5_api.c - implementation of 5.0 style changelog API */
+#include <unistd.h>
#include <errno.h>
#include <sys/stat.h>
#if defined( OS_solaris ) || defined( hpux )
@@ -6451,8 +6452,8 @@
if (rc != 0)
{
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5DBCloseFile: "
- "failed to remove (%s) file; libdb error - %d (%s)\n", file->name,
- rc, dblayer_strerror(rc));
+ "failed to remove (%s) file; libdb error - %d (%s)\n",
+ fullpathname, rc, db_strerror(rc));
}
}
Index: windows_protocol_util.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/windows_protocol_util.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- windows_protocol_util.c 18 Oct 2007 00:08:31 -0000 1.37
+++ windows_protocol_util.c 19 Oct 2007 02:09:24 -0000 1.38
@@ -2256,7 +2256,7 @@
* to trim the DN to only dc components. */
if (suffix = slapi_sdn_get_dn(windows_private_get_windows_subtree(prp->agmt))) {
/* If this isn't found, it is treated as an error below. */
- suffix = (const char *) strcasestr(suffix,"dc=");
+ suffix = (const char *) PL_strcasestr(suffix,"dc=");
}
if (cn && guid && suffix) {
16 years, 6 months
[Fedora-directory-commits] ldapserver configure.ac, 1.41, 1.42 config.h.in, 1.10, 1.11 configure, 1.72, 1.73
by Doctor Conrad
Author: nhosoi
Update of /cvs/dirsec/ldapserver
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv4455
Modified Files:
configure.ac config.h.in configure
Log Message:
Resolves: #339031
Summary: Solaris: warnings reported by the Solaris compiler
Index: configure.ac
===================================================================
RCS file: /cvs/dirsec/ldapserver/configure.ac,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- configure.ac 18 Oct 2007 00:08:26 -0000 1.41
+++ configure.ac 19 Oct 2007 02:09:23 -0000 1.42
@@ -310,6 +310,7 @@
AC_DEFINE([sunos5], [1], [SunOS5])
AC_DEFINE([OSVERSION], [509], [OS version])
AC_DEFINE([_REENTRANT], [1], [_REENTRANT])
+ AC_DEFINE([NO_DOMAINNAME], [1], [no getdomainname])
dnl socket nsl and dl are required to link several programs and libdb
LIBSOCKET=-lsocket
AC_SUBST([LIBSOCKET], [$LIBSOCKET])
Index: config.h.in
===================================================================
RCS file: /cvs/dirsec/ldapserver/config.h.in,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- config.h.in 18 Oct 2007 00:08:26 -0000 1.10
+++ config.h.in 19 Oct 2007 02:09:23 -0000 1.11
@@ -272,6 +272,9 @@
/* Linux */
#undef Linux
+/* no getdomainname */
+#undef NO_DOMAINNAME
+
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
#undef NO_MINUS_C_MINUS_O
Index: configure
===================================================================
RCS file: /cvs/dirsec/ldapserver/configure,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -r1.72 -r1.73
--- configure 18 Oct 2007 00:08:26 -0000 1.72
+++ configure 19 Oct 2007 02:09:23 -0000 1.73
@@ -23360,6 +23360,11 @@
#define _REENTRANT 1
_ACEOF
+
+cat >>confdefs.h <<\_ACEOF
+#define NO_DOMAINNAME 1
+_ACEOF
+
LIBSOCKET=-lsocket
LIBSOCKET=$LIBSOCKET
16 years, 6 months
[Fedora-directory-commits] ldapserver/ldap/admin/src/scripts DSMigration.pm.in, 1.19, 1.20
by Doctor Conrad
Author: rmeggins
Update of /cvs/dirsec/ldapserver/ldap/admin/src/scripts
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv29918/ldapserver/ldap/admin/src/scripts
Modified Files:
DSMigration.pm.in
Log Message:
Resolves: bug 338991
Bug Description: obsolete values migrated to target instance
Reviewed by: nhosoi (Thanks!)
Fix Description: When fixing the attributes in the old entry, remove any obsolete attributes.
Platforms tested: RHEL5 x86_64
Flag Day: no
Doc impact: no
QA impact: should be covered by regular nightly and manual testing
New Tests integrated into TET: none
Index: DSMigration.pm.in
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/scripts/DSMigration.pm.in,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- DSMigration.pm.in 17 Oct 2007 15:56:53 -0000 1.19
+++ DSMigration.pm.in 19 Oct 2007 01:50:15 -0000 1.20
@@ -549,7 +549,11 @@
my ($ent, $mig, $inst) = @_;
for my $attr (keys %{$ent}) {
my $lcattr = lc $attr;
- if ($transformAttr{$lcattr}) {
+ if ($ignoreOld{$lcattr}) {
+ debug(3, "fixAttrsInEntry: ignoring old invalid or obsolete attr $attr\n");
+ $ent->remove($attr);
+ next;
+ } elsif ($transformAttr{$lcattr}) {
my $newval = &{$transformAttr{$lcattr}}($ent, $attr, $mig, $inst);
if (!$newval) {
debug(2, "Removing attribute $attr from entry ", $ent->getDN(), "\n");
@@ -558,7 +562,7 @@
debug(2, "Setting new value $newval for attribute $attr in entry ", $ent->getDN(), "\n");
$ent->setValues($attr, $newval);
}
- }
+ } # else just keep as is
}
}
16 years, 6 months
[Fedora-directory-commits] ldapserver/ldap/servers/slapd/tools/rsearch infadd.c, 1.5, 1.6
by Doctor Conrad
Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/servers/slapd/tools/rsearch
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv13127
Modified Files:
infadd.c
Log Message:
Resolves: #336871
Summary: infadd tool won't start. Fails to load data file (comment #4)
Description: HP compiler does not like to have a function call in a constant
expression.
Index: infadd.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/tools/rsearch/infadd.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- infadd.c 18 Oct 2007 20:26:58 -0000 1.5
+++ infadd.c 18 Oct 2007 23:49:32 -0000 1.6
@@ -157,7 +157,7 @@
AddThread **threads;
PRUint32 total = 0, ntotal = 0;
int counter;
- char familynames[strlen(TEMPLATEDIR) + 19], givennames[strlen(TEMPLATEDIR) + 18];
+ char familynames[sizeof(TEMPLATEDIR) + 19], givennames[sizeof(TEMPLATEDIR) + 18];
srand(time(NULL));
if (argc < 2) {
16 years, 6 months
[Fedora-directory-commits] ldapserver/ldap/servers/slapd/back-ldbm ldbm_add.c, 1.7, 1.8 ldbm_delete.c, 1.7, 1.8 ldbm_modify.c, 1.5, 1.6 ldbm_modrdn.c, 1.6, 1.7
by Doctor Conrad
Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv4834/slapd/back-ldbm
Modified Files:
ldbm_add.c ldbm_delete.c ldbm_modify.c ldbm_modrdn.c
Log Message:
Resolves #329951
Summary: MMR: Supplier does not respond anymore after many operations (deletes)
Description: introduce OP_FLAG_REPL_RUV. It's set in repl5_replica.c if the
entry is RUV. The operation should not be blocked at the backend SERIAL lock
(this is achieved by having OP_FLAG_REPL_FIXUP set in the operation flag).
But updating RUV has nothing to do with VLV, thus if the flag is set, it skips
the VLV indexing.
Index: ldbm_add.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/ldbm_add.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ldbm_add.c 1 Oct 2007 18:52:35 -0000 1.7
+++ ldbm_add.c 18 Oct 2007 22:40:18 -0000 1.8
@@ -104,6 +104,7 @@
int is_resurect_operation= 0;
int is_tombstone_operation= 0;
int is_fixup_operation= 0;
+ int is_ruv = 0; /* True if the current entry is RUV */
CSN *opcsn = NULL;
entry_address addr;
@@ -118,12 +119,13 @@
is_resurect_operation= operation_is_flag_set(operation,OP_FLAG_RESURECT_ENTRY);
is_tombstone_operation= operation_is_flag_set(operation,OP_FLAG_TOMBSTONE_ENTRY);
- is_fixup_operation = operation_is_flag_set(operation,OP_FLAG_REPL_FIXUP);
+ is_fixup_operation = operation_is_flag_set(operation, OP_FLAG_REPL_FIXUP);
+ is_ruv = operation_is_flag_set(operation, OP_FLAG_REPL_RUV);
inst = (ldbm_instance *) be->be_instance_info;
-
- slapi_sdn_init(&sdn);
- slapi_sdn_init(&parentsdn);
+
+ slapi_sdn_init(&sdn);
+ slapi_sdn_init(&parentsdn);
/* Get rid of ldbm backend attributes that you are not allowed to specify yourself */
slapi_entry_delete_values( e, hassubordinates, NULL );
@@ -145,7 +147,7 @@
dblock_acquired= 1;
}
- rc= 0;
+ rc= 0;
/*
* We are about to pass the last abandon test, so from now on we are
@@ -166,8 +168,8 @@
rc= slapi_setbit_int(rc,SLAPI_RTN_BIT_FETCH_EXISTING_DN_ENTRY);
}
rc= slapi_setbit_int(rc,SLAPI_RTN_BIT_FETCH_EXISTING_UNIQUEID_ENTRY);
- rc= slapi_setbit_int(rc,SLAPI_RTN_BIT_FETCH_PARENT_ENTRY);
- while(rc!=0)
+ rc= slapi_setbit_int(rc,SLAPI_RTN_BIT_FETCH_PARENT_ENTRY);
+ while(rc!=0)
{
/* JCM - copying entries can be expensive... should optimize */
/*
@@ -175,20 +177,20 @@
* backend pre-op plugin. To ensure a consistent snapshot of this state
* we wrap the reading of the entry with the dblock.
*/
- if(slapi_isbitset_int(rc,SLAPI_RTN_BIT_FETCH_EXISTING_UNIQUEID_ENTRY))
+ if(slapi_isbitset_int(rc,SLAPI_RTN_BIT_FETCH_EXISTING_UNIQUEID_ENTRY))
{
- /* Check if an entry with the intended uniqueid already exists. */
+ /* Check if an entry with the intended uniqueid already exists. */
done_with_pblock_entry(pb,SLAPI_ADD_EXISTING_UNIQUEID_ENTRY); /* Could be through this multiple times */
addr.dn = NULL;
addr.uniqueid = (char*)slapi_entry_get_uniqueid(e); /* jcm - cast away const */
ldap_result_code= get_copy_of_entry(pb, &addr, &txn, SLAPI_ADD_EXISTING_UNIQUEID_ENTRY, !is_replicated_operation);
}
- if(slapi_isbitset_int(rc,SLAPI_RTN_BIT_FETCH_EXISTING_DN_ENTRY))
+ if(slapi_isbitset_int(rc,SLAPI_RTN_BIT_FETCH_EXISTING_DN_ENTRY))
{
slapi_pblock_get( pb, SLAPI_ADD_TARGET, &dn );
- slapi_sdn_set_dn_byref(&sdn, dn);
+ slapi_sdn_set_dn_byref(&sdn, dn);
slapi_sdn_get_backend_parent(&sdn,&parentsdn,pb->pb_backend);
- /* Check if an entry with the intended DN already exists. */
+ /* Check if an entry with the intended DN already exists. */
done_with_pblock_entry(pb,SLAPI_ADD_EXISTING_DN_ENTRY); /* Could be through this multiple times */
addr.dn = dn;
addr.uniqueid = NULL;
@@ -206,24 +208,24 @@
/* need to set parentsdn or parentuniqueid if either is not set? */
}
- /* Call the Backend Pre Add plugins */
+ /* Call the Backend Pre Add plugins */
slapi_pblock_set(pb, SLAPI_RESULT_CODE, &ldap_result_code);
- rc= plugin_call_plugins(pb, SLAPI_PLUGIN_BE_PRE_ADD_FN);
- if(rc==-1)
- {
+ rc= plugin_call_plugins(pb, SLAPI_PLUGIN_BE_PRE_ADD_FN);
+ if(rc==-1)
+ {
/*
* Plugin indicated some kind of failure,
* or that this Operation became a No-Op.
*/
slapi_pblock_get(pb, SLAPI_RESULT_CODE, &ldap_result_code);
- goto error_return;
- }
+ goto error_return;
+ }
/*
* (rc!=-1 && rc!= 0) means that the plugin changed things, so we go around
* the loop once again to get the new present state.
*/
/* JCMREPL - Warning: A Plugin could cause an infinite loop by always returning a result code that requires some action. */
- }
+ }
/*
* Originally (in the U-M LDAP 3.3 code), there was a comment near this
@@ -237,7 +239,7 @@
/*
* Fetch the parent entry and acquire the cache lock.
*/
- if(have_parent_address(&parentsdn, operation->o_params.p.p_add.parentuniqueid))
+ if(have_parent_address(&parentsdn, operation->o_params.p.p_add.parentuniqueid))
{
addr.dn = (char*)slapi_sdn_get_dn (&parentsdn);
addr.uniqueid = operation->o_params.p.p_add.parentuniqueid;
@@ -255,13 +257,13 @@
modify_init(&parent_modify_c,parententry);
}
- /* Check if the entry we have been asked to add already exists */
+ /* Check if the entry we have been asked to add already exists */
{
Slapi_Entry *entry;
slapi_pblock_get( pb, SLAPI_ADD_EXISTING_DN_ENTRY, &entry);
if ( entry != NULL )
{
- /* The entry already exists */
+ /* The entry already exists */
ldap_result_code= LDAP_ALREADY_EXISTS;
goto error_return;
}
@@ -283,7 +285,7 @@
if ( ancestorentry != NULL )
{
int sentreferral= check_entry_for_referral(pb, ancestorentry->ep_entry, backentry_get_ndn(ancestorentry), "ldbm_back_add");
- cache_return( &inst->inst_cache, &ancestorentry );
+ cache_return( &inst->inst_cache, &ancestorentry );
if(sentreferral)
{
ldap_result_code= -1; /* The result was sent by check_entry_for_referral */
@@ -316,7 +318,7 @@
tombstoneentry = find_entry2modify( pb, be, &addr, NULL );
if ( tombstoneentry==NULL )
{
- ldap_result_code= -1;
+ ldap_result_code= -1;
goto error_return; /* error result sent by find_entry2modify() */
}
tombstone_in_cache = 1;
@@ -324,7 +326,7 @@
addingentry = backentry_dup( tombstoneentry );
if ( addingentry==NULL )
{
- ldap_result_code= LDAP_OPERATIONS_ERROR;
+ ldap_result_code= LDAP_OPERATIONS_ERROR;
goto error_return;
}
/*
@@ -405,8 +407,8 @@
addingentry = backentry_init( e );
if ( ( addingentry->ep_id = next_id( be ) ) >= MAXID ) {
LDAPDebug( LDAP_DEBUG_ANY,
- "add: maximum ID reached, cannot add entry to "
- "backend '%s'", be->be_name, 0, 0 );
+ "add: maximum ID reached, cannot add entry to "
+ "backend '%s'", be->be_name, 0, 0 );
ldap_result_code = LDAP_OPERATIONS_ERROR;
goto error_return;
}
@@ -436,11 +438,11 @@
/* Directly add the entry as a tombstone */
/*
* 1) If the entry has an existing DN, change it to be
- * "nsuniqueid=<uniqueid>, <old dn>"
+ * "nsuniqueid=<uniqueid>, <old dn>"
* 2) Add the objectclass value "tombstone" and arrange for only
- * that value to be indexed.
+ * that value to be indexed.
* 3) If the parent entry was found, set the nsparentuniqueid
- * attribute to be the unique id of that parent.
+ * attribute to be the unique id of that parent.
*/
char *untombstoned_dn = slapi_entry_get_dn(e);
if (NULL == untombstoned_dn)
@@ -476,13 +478,13 @@
struct backentry *ancestorentry;
LDAPDebug( LDAP_DEBUG_TRACE,
- "parent does not exist, pdn = %s\n",
- slapi_sdn_get_dn(&parentsdn), 0, 0 );
+ "parent does not exist, pdn = %s\n",
+ slapi_sdn_get_dn(&parentsdn), 0, 0 );
ancestorentry = dn2ancestor(be, &parentsdn, &ancestordn, &txn, &err );
cache_return( &inst->inst_cache, &ancestorentry );
- ldap_result_code= LDAP_NO_SUCH_OBJECT;
+ ldap_result_code= LDAP_NO_SUCH_OBJECT;
ldap_result_matcheddn= slapi_ch_strdup((char *)slapi_sdn_get_dn(&ancestordn)); /* jcm - cast away const. */
slapi_sdn_done(&ancestordn);
goto error_return;
@@ -502,8 +504,8 @@
if ( !isroot && !is_replicated_operation)
{
LDAPDebug( LDAP_DEBUG_TRACE, "no parent & not root\n",
- 0, 0, 0 );
- ldap_result_code= LDAP_INSUFFICIENT_ACCESS;
+ 0, 0, 0 );
+ ldap_result_code= LDAP_INSUFFICIENT_ACCESS;
goto error_return;
}
parententry = NULL;
@@ -527,7 +529,7 @@
/*
* add the parentid, entryid and entrydn operational attributes
*/
- add_update_entry_operational_attributes(addingentry, pid);
+ add_update_entry_operational_attributes(addingentry, pid);
}
/* Tentatively add the entry to the cache. We do this after adding any
@@ -560,7 +562,7 @@
retval = parent_update_on_childchange(&parent_modify_c,1,NULL); /* 1==add */\
/* The modify context now contains info needed later */
if (0 != retval) {
- ldap_result_code= LDAP_OPERATIONS_ERROR;
+ ldap_result_code= LDAP_OPERATIONS_ERROR;
goto error_return;
}
parent_found = 1;
@@ -577,10 +579,10 @@
/* We're re-trying */
LDAPDebug( LDAP_DEBUG_TRACE, "Add Retrying Transaction\n", 0, 0, 0 );
#ifndef LDBM_NO_BACKOFF_DELAY
- {
- PRIntervalTime interval;
- interval = PR_MillisecondsToInterval(slapi_rand() % 100);
- DS_Sleep(interval);
+ {
+ PRIntervalTime interval;
+ interval = PR_MillisecondsToInterval(slapi_rand() % 100);
+ DS_Sleep(interval);
}
#endif
}
@@ -682,7 +684,7 @@
}
if (retval != 0) {
LDAPDebug( LDAP_DEBUG_ANY, "add: attempt to index %lu failed\n",
- (u_long)addingentry->ep_id, 0, 0 );
+ (u_long)addingentry->ep_id, 0, 0 );
if (LDBM_OS_ERR_IS_DISKFULL(retval)) {
disk_full = 1;
ldap_result_code= LDAP_OPERATIONS_ERROR;
@@ -705,38 +707,41 @@
retval, (msg = dblayer_strerror( retval )) ? msg : "", 0 );
if (LDBM_OS_ERR_IS_DISKFULL(retval)) {
disk_full = 1;
- ldap_result_code= LDAP_OPERATIONS_ERROR;
+ ldap_result_code= LDAP_OPERATIONS_ERROR;
goto diskfull_return;
}
- ldap_result_code= LDAP_OPERATIONS_ERROR;
+ ldap_result_code= LDAP_OPERATIONS_ERROR;
goto error_return;
}
}
- /*
- * Update the Virtual List View indexes
- */
- retval= vlv_update_all_indexes(&txn, be, pb, NULL, addingentry);
- if (DB_LOCK_DEADLOCK == retval)
+ /*
+ * Update the Virtual List View indexes
+ */
+ if (!is_ruv)
{
- LDAPDebug( LDAP_DEBUG_ARGS, "add DEADLOCK vlv_update_index\n", 0, 0, 0 );
- /* Retry txn */
- continue;
- }
- if (0 != retval) {
- LDAPDebug( LDAP_DEBUG_TRACE, "vlv_update_index failed, err=%d %s\n",
- retval, (msg = dblayer_strerror( retval )) ? msg : "", 0 );
- if (LDBM_OS_ERR_IS_DISKFULL(retval)) {
- disk_full = 1;
+ retval= vlv_update_all_indexes(&txn, be, pb, NULL, addingentry);
+ if (DB_LOCK_DEADLOCK == retval) {
+ LDAPDebug( LDAP_DEBUG_ARGS,
+ "add DEADLOCK vlv_update_index\n", 0, 0, 0 );
+ /* Retry txn */
+ continue;
+ }
+ if (0 != retval) {
+ LDAPDebug( LDAP_DEBUG_TRACE,
+ "vlv_update_index failed, err=%d %s\n",
+ retval, (msg = dblayer_strerror( retval )) ? msg : "", 0 );
+ if (LDBM_OS_ERR_IS_DISKFULL(retval)) {
+ disk_full = 1;
+ ldap_result_code= LDAP_OPERATIONS_ERROR;
+ goto diskfull_return;
+ }
ldap_result_code= LDAP_OPERATIONS_ERROR;
- goto diskfull_return;
+ goto error_return;
}
- ldap_result_code= LDAP_OPERATIONS_ERROR;
- goto error_return;
}
- if (retval == 0 ) {
+ if (retval == 0) {
break;
}
-
}
if (retry_count == RETRY_TIMES) {
/* Failed */
@@ -760,9 +765,9 @@
if (cache_replace( &inst->inst_cache, tombstoneentry, addingentry ) != 0 )
{
/* This happens if the dn of addingentry already exists */
- ldap_result_code= LDAP_ALREADY_EXISTS;
+ ldap_result_code= LDAP_ALREADY_EXISTS;
cache_unlock_entry( &inst->inst_cache, tombstoneentry );
- goto error_return;
+ goto error_return;
}
/*
* The tombstone was locked down in the cache... we can
@@ -844,9 +849,9 @@
{
dblayer_unlock_backend(be);
}
- if(ldap_result_code!=-1)
+ if(ldap_result_code!=-1)
{
- slapi_send_ldap_result( pb, ldap_result_code, ldap_result_matcheddn, ldap_result_message, 0, NULL );
+ slapi_send_ldap_result( pb, ldap_result_code, ldap_result_matcheddn, ldap_result_message, 0, NULL );
}
slapi_sdn_done(&sdn);
slapi_sdn_done(&parentsdn);
Index: ldbm_delete.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/ldbm_delete.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ldbm_delete.c 10 Nov 2006 23:45:39 -0000 1.7
+++ ldbm_delete.c 18 Oct 2007 22:40:18 -0000 1.8
@@ -73,6 +73,7 @@
Slapi_Operation *operation;
CSN *opcsn = NULL;
int is_fixup_operation = 0;
+ int is_ruv = 0; /* True if the current entry is RUV */
int is_replicated_operation= 0;
int is_tombstone_entry = 0; /* True if the current entry is alreday a tombstone */
int delete_tombstone_entry = 0; /* We must remove the given tombstone entry from the DB */
@@ -95,7 +96,8 @@
slapi_log_error (SLAPI_LOG_TRACE, "ldbm_back_delete", "enter conn=%d op=%d\n", pb->pb_conn->c_connid, operation->o_opid);
}
- is_fixup_operation = operation_is_flag_set(operation,OP_FLAG_REPL_FIXUP);
+ is_fixup_operation = operation_is_flag_set(operation, OP_FLAG_REPL_FIXUP);
+ is_ruv = operation_is_flag_set(operation, OP_FLAG_REPL_RUV);
delete_tombstone_entry = operation_is_flag_set(operation, OP_FLAG_TOMBSTONE_ENTRY);
inst = (ldbm_instance *) be->be_instance_info;
@@ -469,7 +471,8 @@
ldap_result_code= LDAP_OPERATIONS_ERROR;
goto error_return;
}
- } else if (delete_tombstone_entry)
+ } /* create_tombstone_entry */
+ else if (delete_tombstone_entry)
{
/*
* We need to remove the Tombstone entry from the remaining indexes:
@@ -521,7 +524,7 @@
goto error_return;
}
}
- }
+ } /* delete_tombstone_entry */
if (parent_found) {
/* Push out the db modifications from the parent entry */
@@ -536,32 +539,31 @@
LDAPDebug( LDAP_DEBUG_TRACE, "delete 3 BAD, err=%d %s\n",
retval, (msg = dblayer_strerror( retval )) ? msg : "", 0 );
if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1;
- ldap_result_code= LDAP_OPERATIONS_ERROR;
+ ldap_result_code= LDAP_OPERATIONS_ERROR;
goto error_return;
}
}
/*
* first check if searchentry needs to be removed
* Remove the entry from the Virtual List View indexes.
- *
*/
- if(!delete_tombstone_entry &&
- !vlv_delete_search_entry(pb,e->ep_entry,inst)) {
+ if (!delete_tombstone_entry && !is_ruv &&
+ !vlv_delete_search_entry(pb,e->ep_entry,inst)) {
retval = vlv_update_all_indexes(&txn, be, pb, e, NULL);
+
+ if (DB_LOCK_DEADLOCK == retval)
+ {
+ LDAPDebug( LDAP_DEBUG_ARGS, "delete DEADLOCK vlv_update_index\n", 0, 0, 0 );
+ /* Retry txn */
+ continue;
+ }
+ if (retval != 0 ) {
+ if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1;
+ ldap_result_code= LDAP_OPERATIONS_ERROR;
+ goto error_return;
+ }
}
-
- if (DB_LOCK_DEADLOCK == retval)
- {
- LDAPDebug( LDAP_DEBUG_ARGS, "delete DEADLOCK vlv_update_index\n", 0, 0, 0 );
- /* Retry txn */
- continue;
- }
- if (retval != 0 ) {
- if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1;
- ldap_result_code= LDAP_OPERATIONS_ERROR;
- goto error_return;
- }
- if (retval == 0 ) {
+ if (retval == 0 ) {
break;
}
}
Index: ldbm_modify.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/ldbm_modify.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ldbm_modify.c 10 Nov 2006 23:45:39 -0000 1.5
+++ ldbm_modify.c 18 Oct 2007 22:40:18 -0000 1.6
@@ -131,12 +131,18 @@
back_txn *txn)
{
static char *function_name = "modify_update_all";
+ Slapi_Operation *operation;
+ int is_ruv = 0; /* True if the current entry is RUV */
int retval = 0;
- /*
- * Update the ID to Entry index.
- * Note that id2entry_add replaces the entry, so the Entry ID stays the same.
- */
+ if (pb) { /* pb could be NULL if it's called from import */
+ slapi_pblock_get( pb, SLAPI_OPERATION, &operation );
+ is_ruv = operation_is_flag_set(operation, OP_FLAG_REPL_RUV);
+ }
+ /*
+ * Update the ID to Entry index.
+ * Note that id2entry_add replaces the entry, so the Entry ID stays the same.
+ */
retval = id2entry_add( be, mc->new_entry, txn );
if ( 0 != retval ) {
if (DB_LOCK_DEADLOCK != retval)
@@ -153,13 +159,13 @@
}
goto error;
}
- /*
- * Remove the old entry from the Virtual List View indexes.
- * Add the new entry to the Virtual List View indexes.
+ /*
+ * Remove the old entry from the Virtual List View indexes.
+ * Add the new entry to the Virtual List View indexes.
* Because the VLV code calls slapi_filter_test(), which requires a pb (why?),
* we allow the caller sans pb to get everything except vlv indexing.
- */
- if (NULL != pb) {
+ */
+ if (NULL != pb && !is_ruv) {
retval= vlv_update_all_indexes(txn, be, pb, mc->old_entry, mc->new_entry);
if ( 0 != retval ) {
if (DB_LOCK_DEADLOCK != retval)
@@ -189,7 +195,7 @@
char *errbuf = NULL;
int retry_count = 0;
int disk_full = 0;
- int ldap_result_code= LDAP_SUCCESS;
+ int ldap_result_code= LDAP_SUCCESS;
char *ldap_result_message= NULL;
int rc = 0;
Slapi_Operation *operation;
@@ -198,6 +204,7 @@
int change_entry = 0;
int ec_in_cache = 0;
int is_fixup_operation= 0;
+ int is_ruv = 0; /* True if the current entry is RUV */
CSN *opcsn = NULL;
int repl_op;
@@ -208,7 +215,8 @@
slapi_pblock_get( pb, SLAPI_PARENT_TXN, (void**)&parent_txn );
slapi_pblock_get( pb, SLAPI_OPERATION, &operation );
slapi_pblock_get (pb, SLAPI_IS_REPLICATED_OPERATION, &repl_op);
- is_fixup_operation = operation_is_flag_set(operation,OP_FLAG_REPL_FIXUP);
+ is_fixup_operation = operation_is_flag_set(operation, OP_FLAG_REPL_FIXUP);
+ is_ruv = operation_is_flag_set(operation, OP_FLAG_REPL_RUV);
inst = (ldbm_instance *) be->be_instance_info;
dblayer_txn_init(li,&txn);
@@ -221,15 +229,14 @@
* operations that the URP code in the Replication
* plugin generates.
*/
- if(SERIALLOCK(li) && !operation_is_flag_set(operation,OP_FLAG_REPL_FIXUP))
- {
+ if(SERIALLOCK(li) && !operation_is_flag_set(operation,OP_FLAG_REPL_FIXUP)) {
dblayer_lock_backend(be);
dblock_acquired= 1;
}
/* find and lock the entry we are about to modify */
if ( (e = find_entry2modify( pb, be, addr, NULL )) == NULL ) {
- ldap_result_code= -1;
+ ldap_result_code= -1;
goto error_return; /* error result sent by find_entry2modify() */
}
@@ -260,7 +267,7 @@
/* create a copy of the entry and apply the changes to it */
if ( (ec = backentry_dup( e )) == NULL ) {
- ldap_result_code= LDAP_OPERATIONS_ERROR;
+ ldap_result_code= LDAP_OPERATIONS_ERROR;
goto error_return;
}
@@ -276,10 +283,10 @@
{
Slapi_Mods smods;
- CSN *csn = operation_get_csn(operation);
+ CSN *csn = operation_get_csn(operation);
slapi_mods_init_byref(&smods,mods);
if ( (change_entry = mods_have_effect (ec->ep_entry, &smods)) ) {
- ldap_result_code = entry_apply_mods_wsi(ec->ep_entry, &smods, csn, operation_is_flag_set(operation,OP_FLAG_REPLICATED));
+ ldap_result_code = entry_apply_mods_wsi(ec->ep_entry, &smods, csn, operation_is_flag_set(operation,OP_FLAG_REPLICATED));
/*
* XXXmcs: it would be nice to get back an error message from
* the above call so we could pass it along to the client, e.g.,
@@ -356,8 +363,8 @@
dblayer_txn_abort(li,&txn);
LDAPDebug( LDAP_DEBUG_TRACE, "Modify Retrying Transaction\n", 0, 0, 0 );
#ifndef LDBM_NO_BACKOFF_DELAY
- {
- PRIntervalTime interval;
+ {
+ PRIntervalTime interval;
interval = PR_MillisecondsToInterval(slapi_rand() % 100);
DS_Sleep(interval);
}
@@ -373,10 +380,10 @@
goto error_return;
}
- /*
- * Update the ID to Entry index.
- * Note that id2entry_add replaces the entry, so the Entry ID stays the same.
- */
+ /*
+ * Update the ID to Entry index.
+ * Note that id2entry_add replaces the entry, so the Entry ID stays the same.
+ */
retval = id2entry_add( be, ec, &txn );
if (DB_LOCK_DEADLOCK == retval)
{
@@ -404,37 +411,41 @@
ldap_result_code= LDAP_OPERATIONS_ERROR;
goto error_return;
}
- /*
- * Remove the old entry from the Virtual List View indexes.
- * Add the new entry to the Virtual List View indexes.
- */
- retval= vlv_update_all_indexes(&txn, be, pb, e, ec);
- if (DB_LOCK_DEADLOCK == retval)
- {
- /* Abort and re-try */
- continue;
- }
- if (0 != retval) {
- LDAPDebug( LDAP_DEBUG_ANY, "vlv_update_index failed, err=%d %s\n",
- retval, (msg = dblayer_strerror( retval )) ? msg : "", 0 );
- if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1;
- ldap_result_code= LDAP_OPERATIONS_ERROR;
- goto error_return;
- }
+ /*
+ * Remove the old entry from the Virtual List View indexes.
+ * Add the new entry to the Virtual List View indexes.
+ * If the entry is ruv, no need to update vlv.
+ */
+ if (!is_ruv) {
+ retval= vlv_update_all_indexes(&txn, be, pb, e, ec);
+ if (DB_LOCK_DEADLOCK == retval)
+ {
+ /* Abort and re-try */
+ continue;
+ }
+ if (0 != retval) {
+ LDAPDebug( LDAP_DEBUG_ANY,
+ "vlv_update_index failed, err=%d %s\n",
+ retval, (msg = dblayer_strerror( retval )) ? msg : "", 0 );
+ if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1;
+ ldap_result_code= LDAP_OPERATIONS_ERROR;
+ goto error_return;
+ }
+ }
if (0 == retval) {
break;
}
}
if (retry_count == RETRY_TIMES) {
LDAPDebug( LDAP_DEBUG_ANY, "Retry count exceeded in modify\n", 0, 0, 0 );
- ldap_result_code= LDAP_OPERATIONS_ERROR;
+ ldap_result_code= LDAP_OPERATIONS_ERROR;
goto error_return;
}
if (cache_replace( &inst->inst_cache, e, ec ) != 0 ) {
- ldap_result_code= LDAP_OPERATIONS_ERROR;
- goto error_return;
+ ldap_result_code= LDAP_OPERATIONS_ERROR;
+ goto error_return;
}
postentry = slapi_entry_dup( ec->ep_entry );
@@ -473,7 +484,7 @@
}
else
{
- backentry_free(&ec);
+ backentry_free(&ec);
}
if ( postentry != NULL )
{
Index: ldbm_modrdn.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ldbm_modrdn.c 10 Nov 2006 23:45:39 -0000 1.6
+++ ldbm_modrdn.c 18 Oct 2007 22:40:18 -0000 1.7
@@ -113,7 +113,7 @@
slapi_pblock_get( pb, SLAPI_REQUESTOR_ISROOT, &isroot );
slapi_pblock_get( pb, SLAPI_OPERATION, &operation );
slapi_pblock_get( pb, SLAPI_IS_REPLICATED_OPERATION, &is_replicated_operation );
- is_fixup_operation = operation_is_flag_set(operation,OP_FLAG_REPL_FIXUP);
+ is_fixup_operation = operation_is_flag_set(operation, OP_FLAG_REPL_FIXUP);
if (pb->pb_conn)
{
@@ -1127,8 +1127,12 @@
ldbm_instance *inst;
int retval= 0;
char *msg;
+ Slapi_Operation *operation;
+ int is_ruv = 0; /* True if the current entry is RUV */
- slapi_pblock_get( pb, SLAPI_BACKEND, &be);
+ slapi_pblock_get( pb, SLAPI_BACKEND, &be );
+ slapi_pblock_get( pb, SLAPI_OPERATION, &operation );
+ is_ruv = operation_is_flag_set(operation, OP_FLAG_REPL_RUV);
inst = (ldbm_instance *) be->be_instance_info;
/*
@@ -1206,17 +1210,21 @@
/*
* Remove the old entry from the Virtual List View indexes.
* Add the new entry to the Virtual List View indexes.
+ * If ruv, we don't have to update vlv.
*/
- retval= vlv_update_all_indexes(ptxn, be, pb, e, ec);
- if (DB_LOCK_DEADLOCK == retval)
- {
- /* Abort and re-try */
- goto error_return;
- }
- if (retval != 0)
+ if (!is_ruv)
{
- LDAPDebug( LDAP_DEBUG_TRACE, "vlv_update_all_indexes failed, err=%d %s\n", retval, (msg = dblayer_strerror( retval )) ? msg : "", 0 );
- goto error_return;
+ retval= vlv_update_all_indexes(ptxn, be, pb, e, ec);
+ if (DB_LOCK_DEADLOCK == retval)
+ {
+ /* Abort and re-try */
+ goto error_return;
+ }
+ if (retval != 0)
+ {
+ LDAPDebug( LDAP_DEBUG_TRACE, "vlv_update_all_indexes failed, err=%d %s\n", retval, (msg = dblayer_strerror( retval )) ? msg : "", 0 );
+ goto error_return;
+ }
}
if (cache_replace( &inst->inst_cache, e, ec ) != 0 ) {
retval= -1;
16 years, 6 months