[Pkg-fedora-ds-maintainers] 389-ds-base: Changes to 'upstream-unstable'

Timo Aaltonen tjaalton-guest at alioth.debian.org
Wed Feb 6 11:19:39 UTC 2013


 Makefile.am                                               |    1 
 Makefile.in                                               |    1 
 VERSION.sh                                                |    2 
 configure                                                 |  142 +
 configure.ac                                              |    2 
 ldap/ldif/50posix-winsync-plugin.ldif                     |    1 
 ldap/schema/01core389.ldif                                |   32 
 ldap/schema/02common.ldif                                 |    5 
 ldap/schema/60posix-winsync-plugin.ldif                   |   44 
 ldap/servers/plugins/acl/acl.c                            |   77 -
 ldap/servers/plugins/acl/acl.h                            |    5 
 ldap/servers/plugins/acl/aclgroup.c                       |    2 
 ldap/servers/plugins/acl/acllist.c                        |   48 
 ldap/servers/plugins/automember/automember.c              |   44 
 ldap/servers/plugins/dna/dna.c                            |   53 
 ldap/servers/plugins/memberof/memberof.c                  |    7 
 ldap/servers/plugins/posix-winsync/posix-group-func.c     |  854 +++++++++--
 ldap/servers/plugins/posix-winsync/posix-group-func.h     |    2 
 ldap/servers/plugins/posix-winsync/posix-group-task.c     |  250 ++-
 ldap/servers/plugins/posix-winsync/posix-winsync-config.c |   16 
 ldap/servers/plugins/posix-winsync/posix-winsync.c        |  199 ++
 ldap/servers/plugins/posix-winsync/posix-wsp-ident.h      |    4 
 ldap/servers/plugins/replication/cl5_api.c                |   18 
 ldap/servers/plugins/replication/repl5.h                  |   29 
 ldap/servers/plugins/replication/repl5_agmt.c             |   99 -
 ldap/servers/plugins/replication/repl5_agmtlist.c         |   11 
 ldap/servers/plugins/replication/repl5_connection.c       |    6 
 ldap/servers/plugins/replication/repl5_init.c             |   69 
 ldap/servers/plugins/replication/repl5_replica.c          |  132 -
 ldap/servers/plugins/replication/repl5_replica_config.c   | 1057 +++++++++-----
 ldap/servers/plugins/replication/repl_extop.c             |  323 +++-
 ldap/servers/plugins/replication/replutil.c               |   47 
 ldap/servers/plugins/replication/windows_connection.c     |    2 
 ldap/servers/slapd/abandon.c                              |   10 
 ldap/servers/slapd/add.c                                  |   56 
 ldap/servers/slapd/back-ldbm/back-ldbm.h                  |    5 
 ldap/servers/slapd/back-ldbm/dblayer.c                    |    4 
 ldap/servers/slapd/back-ldbm/idl.c                        |    7 
 ldap/servers/slapd/back-ldbm/index.c                      |   39 
 ldap/servers/slapd/back-ldbm/ldbm_config.c                |   23 
 ldap/servers/slapd/back-ldbm/ldbm_config.h                |    1 
 ldap/servers/slapd/back-ldbm/ldbm_delete.c                |    7 
 ldap/servers/slapd/back-ldbm/ldbm_modify.c                |    7 
 ldap/servers/slapd/back-ldbm/ldbm_modrdn.c                |   11 
 ldap/servers/slapd/back-ldbm/misc.c                       |    2 
 ldap/servers/slapd/back-ldbm/proto-back-ldbm.h            |    2 
 ldap/servers/slapd/back-ldbm/start.c                      |    9 
 ldap/servers/slapd/back-ldbm/vlv.c                        |    8 
 ldap/servers/slapd/connection.c                           |    4 
 ldap/servers/slapd/daemon.c                               |    2 
 ldap/servers/slapd/dn.c                                   |    2 
 ldap/servers/slapd/entry.c                                |   10 
 ldap/servers/slapd/errormap.c                             |   10 
 ldap/servers/slapd/log.c                                  |   63 
 ldap/servers/slapd/mapping_tree.c                         |    2 
 ldap/servers/slapd/opshared.c                             |   25 
 ldap/servers/slapd/pagedresults.c                         |  167 +-
 ldap/servers/slapd/pblock.c                               |    6 
 ldap/servers/slapd/plugin_acl.c                           |   30 
 ldap/servers/slapd/proto-slap.h                           |    9 
 ldap/servers/slapd/pw.c                                   |    5 
 ldap/servers/slapd/slap.h                                 |   15 
 ldap/servers/slapd/slapi-plugin.h                         |   75 
 ldap/servers/slapd/slapi-private.h                        |   12 
 lib/libaccess/acltools.cpp                                |    1 
 65 files changed, 3001 insertions(+), 1212 deletions(-)

New commits:
commit 85261ef0161df156ea3991a77046aabda6c34cf4
Author: Mark Reynolds <mreynolds at redhat.com>
Date:   Thu Dec 6 14:52:40 2012 -0500

    Ticket 527 - ns-slapd segfaults if it cannot rename the logs
    
    Bug Description:  If we can not rename a log file, triggered by log rotation,
                      we try and log a message stating this error, but trying to
                      log this new message triggers log rotation again.  This leads
                      to an infinite loop and a stack overflow.
    
    Fix Description:  Created a new logging function that does not do a rotation check.
                      We use this new function for all emergency error logging.
    
    https://fedorahosted.org/389/ticket/527
    
    Reviewed by: richm(Thanks!)
    (cherry picked from commit 4e9aab8a172c8636ea78a9d1230c78c76268efd7)

diff --git a/ldap/servers/slapd/log.c b/ldap/servers/slapd/log.c
index e622485..e65b247 100644
--- a/ldap/servers/slapd/log.c
+++ b/ldap/servers/slapd/log.c
@@ -138,6 +138,7 @@ static void	log_append_buffer2(time_t tnl, LogBufferInfo *lbi, char *msg1, size_
 static void	log_flush_buffer(LogBufferInfo *lbi, int type, int sync_now);
 static void	log_write_title(LOGFD fp);
 static void log__error_emergency(const char *errstr, int reopen, int locked);
+static void vslapd_log_emergency_error(LOGFD fp, const char *msg, int locked);
 
 static int
 slapd_log_error_proc_internal(
@@ -1834,6 +1835,57 @@ slapd_log_error_proc_internal(
 	return( rc );
 }
 
+/*
+ *  Directly write the already formatted message to the error log
+ */
+static void
+vslapd_log_emergency_error(LOGFD fp, const char *msg, int locked)
+{
+    time_t    tnl;
+    long      tz;
+    struct tm *tmsp, tms;
+    char      tbuf[ TBUFSIZE ];
+    char      buffer[SLAPI_LOG_BUFSIZ];
+    char      sign;
+    int       size;
+
+    tnl = current_time();
+#ifdef _WIN32
+    {
+        struct tm *pt = localtime( &tnl );
+        tmsp = &tms;
+        memcpy(&tms, pt, sizeof(struct tm) );
+    }
+#else
+    (void)localtime_r( &tnl, &tms );
+    tmsp = &tms;
+#endif
+#ifdef BSD_TIME
+    tz = tmsp->tm_gmtoff;
+#else /* BSD_TIME */
+    tz = - timezone;
+    if ( tmsp->tm_isdst ) {
+        tz += 3600;
+    }
+#endif /* BSD_TIME */
+    sign = ( tz >= 0 ? '+' : '-' );
+    if ( tz < 0 ) {
+        tz = -tz;
+    }
+    (void)strftime( tbuf, (size_t)TBUFSIZE, "%d/%b/%Y:%H:%M:%S", tmsp);
+    sprintf( buffer, "[%s %c%02d%02d] - %s", tbuf, sign, (int)( tz / 3600 ), (int)( tz % 3600 ), msg);
+    size = strlen(buffer);
+
+    if(!locked)
+        LOG_ERROR_LOCK_WRITE();
+
+    slapi_write_buffer((fp), (buffer), (size));
+    PR_Sync(fp);
+
+    if(!locked)
+        LOG_ERROR_UNLOCK_WRITE();
+}
+
 static int
 vslapd_log_error(
     LOGFD	fp,
@@ -3102,9 +3154,6 @@ char rootpath[4];
 		PR_snprintf(buffer, sizeof(buffer),
 			  		"log__enough_freespace: Unable to get the free space (errno:%d)\n",
 					errno);
-		/* This function could be called in the ERROR WRITE LOCK,
-		 * which causes the self deadlock if you call LDAPDebug for logging.
-		 * Thus, instead of LDAPDebug, call log__error_emergency with locked == 1. */
 		log__error_emergency(buffer, 0, 1);
 		return 1;
 	} else {
@@ -3351,9 +3400,6 @@ delete_logfile:
 	PR_snprintf (buffer, sizeof(buffer), "%s.%s", loginfo.log_error_file, tbuf);
 	if (PR_Delete(buffer) != PR_SUCCESS) {
 		PRErrorCode prerr = PR_GetError();
-		/* This function could be called in the ERROR WRITE LOCK,
-		 * which causes the self deadlock if you call LDAPDebug for logging.
-		 * Thus, instead of LDAPDebug, call log__error_emergency with locked == 1. */
 		PR_snprintf(buffer, sizeof(buffer),
 				"LOGINFO:Unable to remove file:%s.%s error %d (%s)\n",
 				loginfo.log_error_file, tbuf, prerr, slapd_pr_strerror(prerr));
@@ -3713,10 +3759,7 @@ log__error_emergency(const char *errstr, int reopen, int locked)
 		PRErrorCode prerr = PR_GetError();
 		syslog(LOG_ERR, "Failed to reopen errors log file, " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n", prerr, slapd_pr_strerror(prerr));
 	} else {
-		/* LDAPDebug locks ERROR_LOCK_WRITE internally */
-		if (locked) LOG_ERROR_UNLOCK_WRITE();
-		LDAPDebug(LDAP_DEBUG_ANY, "%s\n", errstr, 0, 0);
-		if (locked) LOG_ERROR_LOCK_WRITE( );
+		vslapd_log_emergency_error(loginfo.log_error_fdes, errstr, locked);
 	}
 	return;
 }

commit 39b0938b43a5dbfdc566b343e504585bad7de859
Author: Mark Reynolds <mreynolds at redhat.com>
Date:   Thu Dec 6 11:41:29 2012 -0500

    Coverity Issues for 1.2.11
    
    Reviewed by: richm(Thanks!)

diff --git a/ldap/servers/plugins/memberof/memberof.c b/ldap/servers/plugins/memberof/memberof.c
index 598f4d9..a3f875d 100644
--- a/ldap/servers/plugins/memberof/memberof.c
+++ b/ldap/servers/plugins/memberof/memberof.c
@@ -1105,6 +1105,13 @@ memberof_modop_one_replace_r(Slapi_PBlock *pb, MemberOfConfig *config,
 	const char *op_this = slapi_sdn_get_ndn(op_this_sdn);
 	Slapi_Value *to_dn_val = slapi_value_new_string(op_to);
 	Slapi_Value *this_dn_val = slapi_value_new_string(op_this);
+
+	if(this_dn_val == NULL || to_dn_val == NULL){
+		slapi_log_error( SLAPI_LOG_FATAL, MEMBEROF_PLUGIN_SUBSYSTEM,
+				"memberof_modop_one_replace_r: failed to get DN values (NULL)\n");
+		goto bail;
+	}
+
 	/* op_this and op_to are both case-normalized */
 	slapi_value_set_flags(this_dn_val, SLAPI_ATTR_FLAG_NORMALIZED_CIS);
 	slapi_value_set_flags(to_dn_val, SLAPI_ATTR_FLAG_NORMALIZED_CIS);
diff --git a/ldap/servers/slapd/back-ldbm/dblayer.c b/ldap/servers/slapd/back-ldbm/dblayer.c
index 02cb3fd..804543b 100644
--- a/ldap/servers/slapd/back-ldbm/dblayer.c
+++ b/ldap/servers/slapd/back-ldbm/dblayer.c
@@ -1910,6 +1910,8 @@ dblayer_get_id2entry_size(ldbm_instance *inst)
                                       ID2ENTRY LDBM_FILENAME_SUFFIX);
     rc = PR_GetFileInfo(id2entry_file, &info);
     slapi_ch_free_string(&id2entry_file);
+    if (inst_dirp != inst_dir)
+        slapi_ch_free_string(&inst_dirp);
     if (rc) {
         return 0;
     }
diff --git a/lib/libaccess/acltools.cpp b/lib/libaccess/acltools.cpp
index 69d0c2e..df08658 100644
--- a/lib/libaccess/acltools.cpp
+++ b/lib/libaccess/acltools.cpp
@@ -1415,6 +1415,7 @@ char			*errmsg;
             eid = ACLERR1500;
             errmsg = system_errmsg();
             nserrGenerate(errp, rv, eid, ACL_Program, 2, "buffer", errmsg);
+            PERM_FREE(errmsg);
         }
 
     }

commit 77f126b85db760f0ad8e56575a8bac135b15fe49
Author: Mark Reynolds <mreynolds at redhat.com>
Date:   Thu Nov 29 10:49:33 2012 -0500

    Ticket 216 - disable replication agreements
    
    Bug Description:  Objectclass violation when trying to add "nsds5ReplicaEnabled"
                      to a winSync agmt.
    
    Fix Description:  Add this attribute to the "MAY" list for objectclass: nsDSWindowsReplicationAgreement
    
    https://fedorahosted.org/389/ticket/216
    
    Reviewed by: richm(Thanks)
    (cherry picked from commit b3a2f4010d4eae7bd62a0c09576b1a643eca3901)

diff --git a/ldap/schema/02common.ldif b/ldap/schema/02common.ldif
index c6cc6b8..ffec7ce 100644
--- a/ldap/schema/02common.ldif
+++ b/ldap/schema/02common.ldif
@@ -180,7 +180,7 @@ objectClasses: ( 2.16.840.1.113730.3.2.99 NAME 'cosSuperDefinition' DESC 'Netsca
 objectClasses: ( 2.16.840.1.113730.3.2.100 NAME 'cosClassicDefinition' DESC 'Netscape defined objectclass' SUP cosSuperDefinition MAY ( cosTemplateDn $ cosspecifier ) X-ORIGIN 'Netscape Directory Server' )
 objectClasses: ( 2.16.840.1.113730.3.2.101 NAME 'cosPointerDefinition' DESC 'Netscape defined objectclass' SUP cosSuperDefinition MAY ( cosTemplateDn ) X-ORIGIN 'Netscape Directory Server' )
 objectClasses: ( 2.16.840.1.113730.3.2.102 NAME 'cosIndirectDefinition' DESC 'Netscape defined objectclass' SUP cosSuperDefinition MAY ( cosIndirectSpecifier ) X-ORIGIN 'Netscape Directory Server' )
-objectClasses: ( 2.16.840.1.113730.3.2.503 NAME 'nsDSWindowsReplicationAgreement' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( nsDS5ReplicaHost $ nsDS5ReplicaPort $ nsDS5ReplicaTransportInfo $ nsDS5ReplicaBindDN $ nsDS5ReplicaCredentials $ nsDS5ReplicaBindMethod $ nsDS5ReplicaRoot $ nsDS5ReplicatedAttributeList $ nsDS5ReplicaUpdateSchedule $ nsds5BeginReplicaRefresh $ description $ nsds50ruv $ nsruvReplicaLastModified $ nsds5ReplicaTimeout $ nsds5replicaChangesSentSinceStartup $ nsds5replicaLastUpdateEnd $ nsds5replicaLastUpdateStart $ nsds5replicaLastUpdateStatus $ nsds5replicaUpdateInProgress $ nsds5replicaLastInitEnd $ nsds5replicaLastInitStart $ nsds5replicaLastInitStatus $ nsds5debugreplicatimeout $ nsds5replicaBusyWaitTime $ nsds5replicaSessionPauseTime $ nsds7WindowsReplicaSubtree $ nsds7DirectoryReplicaSubtree $ nsds7NewWinUserSyncEnabled $ nsds7NewWinGroupSyncEnabled $ nsds7WindowsDomain $ nsds7DirsyncCookie $ winSyncInterval $ oneWaySync $ winSyncMoveAction) X-ORIGIN 'Netscape Directory Server' )
+objectClasses: ( 2.16.840.1.113730.3.2.503 NAME 'nsDSWindowsReplicationAgreement' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( nsDS5ReplicaHost $ nsDS5ReplicaPort $ nsDS5ReplicaTransportInfo $ nsDS5ReplicaBindDN $ nsDS5ReplicaCredentials $ nsDS5ReplicaBindMethod $ nsDS5ReplicaRoot $ nsDS5ReplicatedAttributeList $ nsDS5ReplicaUpdateSchedule $ nsds5BeginReplicaRefresh $ description $ nsds50ruv $ nsruvReplicaLastModified $ nsds5ReplicaTimeout $ nsds5replicaChangesSentSinceStartup $ nsds5replicaLastUpdateEnd $ nsds5replicaLastUpdateStart $ nsds5replicaLastUpdateStatus $ nsds5replicaUpdateInProgress $ nsds5replicaLastInitEnd $ nsds5replicaLastInitStart $ nsds5replicaLastInitStatus $ nsds5debugreplicatimeout $ nsds5replicaBusyWaitTime $ nsds5replicaSessionPauseTime $ nsds7WindowsReplicaSubtree $ nsds7DirectoryReplicaSubtree $ nsds7NewWinUserSyncEnabled $ nsds7NewWinGroupSyncEnabled $ nsds7WindowsDomain $ nsds7DirsyncCookie $ winSyncInterval $ oneWaySync $ winSyncMoveAction $ nsds5ReplicaEnabled ) X-ORIGIN 'Netscape Directory Server' )
 objectClasses: ( 2.16.840.1.113730.3.2.128 NAME 'costemplate' DESC 'Netscape defined objectclass' SUP top MAY ( cn $ cospriority ) X-ORIGIN 'Netscape Directory Server' )
 objectClasses: ( 2.16.840.1.113730.3.2.304 NAME 'nsView' DESC 'Netscape defined objectclass' SUP top AUXILIARY MAY ( nsViewFilter $ description ) X-ORIGIN 'Netscape Directory Server' )
 objectClasses: ( 2.16.840.1.113730.3.2.316 NAME 'nsAttributeEncryption' DESC 'Netscape defined objectclass' SUP top MUST ( cn $ nsEncryptionAlgorithm ) X-ORIGIN 'Netscape Directory Server' )

commit bf2bfaab8e61f335442e4341ff33521a822bd830
Author: Mark Reynolds <mreynolds at redhat.com>
Date:   Tue Nov 27 10:24:02 2012 -0500

    Ticket 20 - Allow automember to work on entries that have already been added
    
    Bug Description:  If the server can not open a ldif for reading(mapping task), an
                      incorrect error and file name is returned.
    
    Fix Description:  Report the correct file name, and correctly grab the OS error/string.
                      Also made slapd_pr_strerr() and slapd_system_strerr() public, so I
                      refactored the function names to be "slapi_" - so a lot of files are
                      touched but the main change for this ticket is still in automember.c
    
    https://fedorahosted.org/389/ticket/20
    
    Reviewed by: richm(Thanks)

diff --git a/ldap/servers/plugins/automember/automember.c b/ldap/servers/plugins/automember/automember.c
index a11909f..424b507 100644
--- a/ldap/servers/plugins/automember/automember.c
+++ b/ldap/servers/plugins/automember/automember.c
@@ -2333,6 +2333,7 @@ void automember_export_task_thread(void *arg){
     task_data *td = NULL;
     PRFileDesc *ldif_fd;
     int i = 0;
+    int rc = 0;
 
     td = (task_data *)slapi_task_get_data(task);
     slapi_task_begin(task, 1);
@@ -2341,13 +2342,14 @@ void automember_export_task_thread(void *arg){
 
     /* make sure we can open the ldif file */
     if (( ldif_fd = PR_Open( td->ldif_out, PR_CREATE_FILE | PR_WRONLY, DEFAULT_FILE_MODE )) == NULL ){
-        slapi_task_log_notice(task, "Automember export task could not open ldif file \"%s\" for writing %d\n",
-                              td->ldif_out, PR_GetError() );
-        slapi_task_log_status(task, "Automember export task could not open ldif file \"%s\" for writing %d\n",
-                              td->ldif_out, PR_GetError() );
+        rc = PR_GetOSError();
+        slapi_task_log_notice(task, "Automember export task could not open ldif file \"%s\" for writing, error %d (%s)\n",
+                              td->ldif_out, rc, slapi_system_strerror(rc));
+        slapi_task_log_status(task, "Automember export task could not open ldif file \"%s\" for writing, error %d (%s)\n",
+                              td->ldif_out, rc, slapi_system_strerror(rc) );
         slapi_log_error( SLAPI_LOG_FATAL, AUTOMEMBER_PLUGIN_SUBSYSTEM,
-                        "Could not open ldif file \"%s\" for writing %d\n",
-                        td->ldif_out, PR_GetError() );
+                        "Could not open ldif file \"%s\" for writing, error %d (%s)\n",
+                        td->ldif_out, rc, slapi_system_strerror(rc) );
         result = SLAPI_DSE_CALLBACK_ERROR;
         goto out;
     }
@@ -2516,6 +2518,7 @@ void automember_map_task_thread(void *arg){
     task_data *td = NULL;
     PRFileDesc *ldif_fd_out = NULL;
     char *entrystr = NULL;
+    char *errstr = NULL;
 #if defined(USE_OPENLDAP)
     int buflen = 0;
     LDIFFP *ldif_fd_in = NULL;
@@ -2534,29 +2537,34 @@ void automember_map_task_thread(void *arg){
 
     /* make sure we can open the ldif files */
     if(( ldif_fd_out = PR_Open( td->ldif_out, PR_CREATE_FILE | PR_WRONLY, DEFAULT_FILE_MODE  )) == NULL ){
-        slapi_task_log_notice(task, "The ldif file %s could not be accessed, error %d.  Aborting task.\n",
-                              td->ldif_out, rc);
-        slapi_task_log_status(task, "The ldif file %s could not be accessed, error %d.  Aborting task.\n",
-    	                      td->ldif_out, rc);
+        rc = PR_GetOSError();
+        slapi_task_log_notice(task, "The ldif file %s could not be accessed, error %d (%s).  Aborting task.\n",
+                              td->ldif_out, rc, slapi_system_strerror(rc));
+        slapi_task_log_status(task, "The ldif file %s could not be accessed, error %d (%s).  Aborting task.\n",
+                              td->ldif_out, rc, slapi_system_strerror(rc));
         slapi_log_error( SLAPI_LOG_FATAL, AUTOMEMBER_PLUGIN_SUBSYSTEM,
-                        "Could not open ldif file \"%s\" for writing %d\n",
-                        td->ldif_out, PR_GetError() );
+                        "Could not open ldif file \"%s\" for writing, error %d (%s)\n",
+                        td->ldif_out, rc, slapi_system_strerror(rc) );
         result = SLAPI_DSE_CALLBACK_ERROR;
         goto out;
     }
 
 #if defined(USE_OPENLDAP)
     if(( ldif_fd_in = ldif_open(td->ldif_in, "r")) == NULL ){
+        rc = errno;
+        errstr = strerror(rc);
 #else
     if(( ldif_fd_in = PR_Open( td->ldif_in, PR_RDONLY, DEFAULT_FILE_MODE  )) == NULL ){
+        rc = PR_GetOSError();
+        errstr = slapi_system_strerror(rc);
 #endif
-        slapi_task_log_notice(task, "The ldif file %s could not be accessed, error %d.  Aborting task.\n",
-                              td->ldif_in, rc);
-        slapi_task_log_status(task, "The ldif file %s could not be accessed, error %d.  Aborting task.\n",
-                              td->ldif_in, rc);
+        slapi_task_log_notice(task, "The ldif file %s could not be accessed, error %d (%s).  Aborting task.\n",
+                              td->ldif_in, rc, errstr);
+        slapi_task_log_status(task, "The ldif file %s could not be accessed, error %d (%s).  Aborting task.\n",
+                              td->ldif_in, rc, errstr);
         slapi_log_error( SLAPI_LOG_FATAL, AUTOMEMBER_PLUGIN_SUBSYSTEM,
-                        "Could not open ldif file \"%s\" for reading %d\n",
-                        td->ldif_out, PR_GetError() );
+                        "Could not open ldif file \"%s\" for reading, error %d (%s)\n",
+                        td->ldif_in, rc, errstr );
         result = SLAPI_DSE_CALLBACK_ERROR;
         goto out;
     }
diff --git a/ldap/servers/slapd/errormap.c b/ldap/servers/slapd/errormap.c
index d05e495..c585d25 100644
--- a/ldap/servers/slapd/errormap.c
+++ b/ldap/servers/slapd/errormap.c
@@ -73,6 +73,11 @@ slapd_pr_strerror( const int prerrno )
     return( s );
 }
 
+char *
+slapi_pr_strerror( const int prerrno )
+{
+    return slapd_pr_strerror(prerrno);
+}
 
 /*
  * return the string equivalent of a system error
@@ -92,6 +97,11 @@ slapd_system_strerror( const int syserrno )
     return( s );
 }
 
+const char *
+slapi_system_strerror( const int syserrno )
+{
+    return slapd_system_strerror(syserrno);
+}
 
 /*
  * return the string equivalent of an NSPR error.  If "prerrno" is not
diff --git a/ldap/servers/slapd/slapi-plugin.h b/ldap/servers/slapd/slapi-plugin.h
index 4316833..4962b2a 100644
--- a/ldap/servers/slapd/slapi-plugin.h
+++ b/ldap/servers/slapd/slapi-plugin.h
@@ -65,6 +65,7 @@ extern "C" {
 #include "prtypes.h"
 #include "ldap.h"
 #include "prprf.h"
+#include "nspr.h"
 NSPR_API(PRUint32) PR_snprintf(char *out, PRUint32 outlen, const char *fmt, ...)
 #ifdef __GNUC__ 
         __attribute__ ((format (printf, 3, 4)));
@@ -7156,6 +7157,80 @@ uint64_t slapi_str_to_u64(const char *s);
 
 void slapi_set_plugin_open_rootdn_bind(Slapi_PBlock *pb);
 
+/* 
+ * Public entry extension getter/setter functions
+ *
+ * Currently, only slapi_pw_get/set_entry_ext is implemented.
+ * The functions are in pw.c.  Detailed usage of the factory 
+ * is found in the comments at the top of factory.c.
+ *
+ * When you plan to add other entry extension code AND
+ * the type-value pair is managed via ordinary mod,
+ * setter, getter and copy function having the same API
+ * are supposed to be implemented, then add the set to
+ * attrs_in_extension list in entry.c.  The set is called
+ * in slapi_entry_apply_mod_extension.
+ *
+ * Note: setter and getter are public, but copy function
+ * is not. (for the copy function, see pw_copy_entry_ext in pw.c)
+ */
+/* operation used in the entry extension setter */
+#define SLAPI_EXT_SET_ADD     0
+#define SLAPI_EXT_SET_REPLACE 1
+
+/**
+ * Get entry extension
+ *
+ * \param entry is the entry to retrieve the extension from
+ * \param vals is the array of (Slapi_Value *), which directly refers the extension.  Caller must duplicate it to use it for other than referring.
+ *
+ * \return LDAP_SUCCESS if successful.
+ * \return non-zero otherwise.
+ */
+int slapi_pw_get_entry_ext(Slapi_Entry *entry, Slapi_Value ***vals);
+
+/**
+ * Set entry extension
+ *
+ * \param entry is the entry to set the extension to
+ * \param vals is the array of (Slapi_Value *), which is consumed in slapi_pw_set_ext if the call is successful. 
+ * \param flags: SLAPI_EXT_SET_ADD -- add vals to the existing extension if any.
+ *               SLAPI_EXT_SET_REPLACE -- replace vals with the existing extension if any.
+ * No difference if there is no extension in the entry.
+ *
+ * \return LDAP_SUCCESS if successful.
+ * \return non-zero otherwise.
+ */
+int slapi_pw_set_entry_ext(Slapi_Entry *entry, Slapi_Value **vals, int flags);
+
+/**
+ * Get stashed clear password.
+ * If multiple of them are in the extension, the first one is returned.
+ *
+ * \param entry is the entry to retrieve the extension from
+ *
+ * \return a pointer to the clear password string.  Caller is responsible to free the string.
+ */
+char *slapi_get_first_clear_text_pw(Slapi_Entry *entry);
+
+/**
+ * Return the string equivalent of an NSPR error
+ *  *
+ * \param a NSPR error code
+ *
+ * \return a pointer to the error code string.
+ */
+char *slapi_pr_strerror( const PRErrorCode prerrno );
+
+/**
+ * Return the string equivalent of an OS error
+ *
+ * \param a OS error code
+ *
+ * \return a pointer to the system error code string.
+ */
+const char *slapi_system_strerror( const int syserrno );
+
 #ifdef __cplusplus
 }
 #endif

commit 7d22bc2eca8d71ac212879fb28d39c8a31a7be58
Author: Mark Reynolds <mreynolds at redhat.com>
Date:   Mon Nov 26 11:04:36 2012 -0500

    Coverity Fixes
    
    12626
    13030
    13114
    13115
    13116
    
    Reviewed by: richm (Thanks Rich!)
    (cherry picked from commit 4850b2720a6d2a1cf65b2cbfa296e37f04f85c5d)

diff --git a/ldap/servers/plugins/replication/cl5_api.c b/ldap/servers/plugins/replication/cl5_api.c
index 6c94b3d..175eb80 100644
--- a/ldap/servers/plugins/replication/cl5_api.c
+++ b/ldap/servers/plugins/replication/cl5_api.c
@@ -6554,9 +6554,6 @@ cl5CleanRUV(ReplicaId rid){
         ruv_delete_replica(file->maxRUV, rid);
         obj = objset_next_obj(s_cl5Desc.dbFiles, obj);
     }
-    if(obj){
-        object_release (obj);
-    }
 
     slapi_rwlock_unlock (s_cl5Desc.stLock);
 }
diff --git a/ldap/servers/plugins/replication/repl5_replica_config.c b/ldap/servers/plugins/replication/repl5_replica_config.c
index 0fd785b..e234c15 100644
--- a/ldap/servers/plugins/replication/repl5_replica_config.c
+++ b/ldap/servers/plugins/replication/repl5_replica_config.c
@@ -1743,7 +1743,7 @@ check_replicas_are_done_cleaning(cleanruv_data *data )
 {
     Object *agmt_obj;
     Repl_Agmt *agmt;
-    char csnstr[CSN_STRSIZE];
+    char *csnstr = NULL;
     char *filter = NULL;
     int not_all_cleaned = 1;
     int interval = 10;
@@ -1786,6 +1786,7 @@ check_replicas_are_done_cleaning(cleanruv_data *data )
             interval = 14400;
         }
     }
+    slapi_ch_free_string(&csnstr);
     slapi_ch_free_string(&filter);
 }
 
@@ -2356,7 +2357,7 @@ delete_cleaned_rid_config(cleanruv_data *clean_data)
     struct berval *vals[2];
     struct berval val;
     char data[CSN_STRSIZE + 15];
-    char csnstr[CSN_STRSIZE];
+    char *csnstr = NULL;
     char *dn;
     int rc;
 
@@ -2399,6 +2400,7 @@ delete_cleaned_rid_config(cleanruv_data *clean_data)
      }
      slapi_pblock_destroy (pb);
      slapi_ch_free_string(&dn);
+     slapi_ch_free_string(&csnstr);
  }
 
 /*

commit 7a3014c0746134403f1fe9a25eac9581750aef0b
Author: Mark Reynolds <mreynolds at redhat.com>
Date:   Tue Nov 20 16:14:42 2012 -0500

    Ticket 337 - improve CLEANRUV functionality
    
    Bug Description:  Without anonymous access allowed, then task could not
                      contact other servers and retrieve data(ruv, maxcsns, etc).
    
    Fix Description:  Changed all communication to use extended operations, and improved
                      sychronization between the replicas.
    
    https://fedorahosted.org/389/ticket/337
    
    Reviewed by: richm(Thanks Rich!)
    (cherry picked from commit ecbd8b7513d05dab5876a88ca56b102c08a7a67c)

diff --git a/ldap/servers/plugins/replication/cl5_api.c b/ldap/servers/plugins/replication/cl5_api.c
index a347c57..6c94b3d 100644
--- a/ldap/servers/plugins/replication/cl5_api.c
+++ b/ldap/servers/plugins/replication/cl5_api.c
@@ -1474,13 +1474,13 @@ int cl5WriteOperation(const char *replName, const char *replGen,
 }
 
 /* Name:		cl5CreateReplayIterator
-   Description:	creates an iterator that allows to retireve changes that should
-				to be sent to the consumer identified by ruv. The iteration is peformed by 
+   Description:	creates an iterator that allows to retrieve changes that should
+				to be sent to the consumer identified by ruv. The iteration is performed by
                 repeated calls to cl5GetNextOperationToReplay.
    Parameters:  replica - replica whose data we wish to iterate;
 				ruv - consumer ruv;
 				iterator - iterator to be passed to cl5GetNextOperationToReplay call
-   Return:		CL5_SUCCESS, if function is successfull;
+   Return:		CL5_SUCCESS, if function is successful;
                 CL5_MISSING_DATA, if data that should be in the changelog is missing
                 CL5_PURGED_DATA, if some data that consumer needs has been purged.
                 Note that the iterator can be non null if the supplier contains
@@ -1488,14 +1488,14 @@ int cl5WriteOperation(const char *replName, const char *replGen,
                 CL5_NOTFOUND if the consumer is up to data with respect to the supplier
 				CL5_BAD_DATA if invalid parameter is passed;
 				CL5_BAD_STATE  if db has not been open;
-				CL5_DB_ERROR if any other db error occured;
+				CL5_DB_ERROR if any other db error occurred;
 				CL5_MEMORY_ERROR if memory allocation fails.
    Algorithm:   Build a list of csns from consumer's and supplier's ruv. For each element
                 of the consumer's ruv put max csn into the csn list. For each element
                 of the supplier's ruv not in the consumer's ruv put min csn from the
                 supplier's ruv into the list. The list contains, for each known replica,
                 the starting point for changes to be sent to the consumer.
-                Sort the list in accending order.
+                Sort the list in ascending order.
                 Build a hash which contains, for each known replica, whether the
                 supplier can bring the consumer up to data with respect to that replica.
                 The hash is used to decide whether a change can be sent to the consumer 
@@ -1503,7 +1503,7 @@ int cl5WriteOperation(const char *replName, const char *replGen,
                 we can bring the consumer up to date.
                 Position the db cursor on the change entry that corresponds to this csn.
                 Hash entries are created for each replica traversed so far. sendChanges
-                flag is set to FALSE for all repolicas except the last traversed.
+                flag is set to FALSE for all replicas except the last traversed.
                 
  */
 int cl5CreateReplayIteratorEx (Private_Repl_Protocol *prp, const RUV *consumerRuv, 
@@ -6543,7 +6543,9 @@ bail:
 void
 cl5CleanRUV(ReplicaId rid){
     CL5DBFile *file;
-    Object *obj;
+    Object *obj = NULL;
+
+    slapi_rwlock_wrlock (s_cl5Desc.stLock);
 
     obj = objset_first_obj(s_cl5Desc.dbFiles);
     while (obj){
@@ -6552,6 +6554,11 @@ cl5CleanRUV(ReplicaId rid){
         ruv_delete_replica(file->maxRUV, rid);
         obj = objset_next_obj(s_cl5Desc.dbFiles, obj);
     }
+    if(obj){
+        object_release (obj);
+    }
+
+    slapi_rwlock_unlock (s_cl5Desc.stLock);
 }
 
 void trigger_cl_trimming(ReplicaId rid){
diff --git a/ldap/servers/plugins/replication/repl5.h b/ldap/servers/plugins/replication/repl5.h
index 61b51b0..bd582bc 100644
--- a/ldap/servers/plugins/replication/repl5.h
+++ b/ldap/servers/plugins/replication/repl5.h
@@ -97,8 +97,14 @@
 /* cleanallruv extended ops */
 #define REPL_CLEANRUV_OID "2.16.840.1.113730.3.6.5"
 #define REPL_ABORT_CLEANRUV_OID "2.16.840.1.113730.3.6.6"
-#define CLEANRUV_NOTIFIED 0
-#define CLEANRUV_RELEASED 1
+#define REPL_CLEANRUV_GET_MAXCSN_OID "2.16.840.1.113730.3.6.7"
+#define REPL_CLEANRUV_CHECK_STATUS_OID "2.16.840.1.113730.3.6.8"
+
+#define CLEANRUV_ACCEPTED "accepted"
+#define CLEANRUV_REJECTED "rejected"
+#define CLEANRUV_FINISHED "finished"
+#define CLEANRUV_CLEANING "cleaning"
+#define CLEANRUV_NO_MAXCSN "no maxcsn"
 
 /* DS 5.0 replication protocol error codes */
 #define NSDS50_REPL_REPLICA_READY 0x00 /* Replica ready, go ahead */
@@ -230,6 +236,8 @@ int multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb);
 int multimaster_extop_EndNSDS50ReplicationRequest(Slapi_PBlock *pb);
 int multimaster_extop_cleanruv(Slapi_PBlock *pb);
 int multimaster_extop_abort_cleanruv(Slapi_PBlock *pb);
+int multimaster_extop_cleanruv_get_maxcsn(Slapi_PBlock *pb);
+int multimaster_extop_cleanruv_check_status(Slapi_PBlock *pb);
 int extop_noop(Slapi_PBlock *pb);
 struct berval *NSDS50StartReplicationRequest_new(const char *protocol_oid,
 	const char *repl_root, char **extra_referrals, CSN *csn);
@@ -365,9 +373,6 @@ PRBool agmt_is_enabled(Repl_Agmt *ra);
 int agmt_set_enabled_from_entry(Repl_Agmt *ra, Slapi_Entry *e, char *returntext);
 char **agmt_get_attrs_to_strip(Repl_Agmt *ra);
 int agmt_set_attrs_to_strip(Repl_Agmt *ra, Slapi_Entry *e);
-void agmt_set_cleanruv_notified_from_entry(Repl_Agmt *ra, Slapi_Entry *e);
-int agmt_set_cleanruv_data(Repl_Agmt *ra, ReplicaId rid, int op);
-int agmt_is_cleanruv_notified(Repl_Agmt *ra, ReplicaId rid);
 int agmt_set_timeout(Repl_Agmt *ra, long timeout);
 void agmt_update_done(Repl_Agmt *ra, int is_total);
 
@@ -454,6 +459,7 @@ LDAP * conn_get_ldap(Repl_Connection *conn);
 void conn_lock(Repl_Connection *conn);
 void conn_unlock(Repl_Connection *conn);
 void conn_delete_internal_ext(Repl_Connection *conn);
+const char* conn_get_bindmethod(Repl_Connection *conn);
 
 /* In repl5_protocol.c */
 typedef struct repl_protocol Repl_Protocol;
@@ -608,7 +614,7 @@ int replica_config_init();
 void replica_config_destroy ();
 int get_replica_type(Replica *r);
 int replica_execute_cleanruv_task_ext(Object *r, ReplicaId rid);
-void add_cleaned_rid(ReplicaId rid, Replica *r, char *maxcsn);
+void add_cleaned_rid(ReplicaId rid, Replica *r, char *maxcsn, char *forcing);
 int is_cleaned_rid(ReplicaId rid);
 int replica_cleanall_ruv_abort(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter,
                                int *returncode, char *returntext, void *arg);
@@ -616,17 +622,15 @@ void replica_cleanallruv_thread_ext(void *arg);
 void stop_ruv_cleaning();
 int task_aborted();
 void replica_abort_task_thread(void *arg);
-void delete_cleaned_rid(Replica *r, ReplicaId rid, CSN *maxcsn);
+void remove_cleaned_rid(ReplicaId rid);
 int process_repl_agmts(Replica *replica, int *agmt_info, char *oid, Slapi_Task *task, struct berval *payload, int op);
 int decode_cleanruv_payload(struct berval *extop_value, char **payload);
-struct berval *create_ruv_payload(char *value);
-void replica_add_cleanruv_data(Replica *r, char *val);
-void replica_remove_cleanruv_data(Replica *r, char *val);
-CSN *replica_get_cleanruv_maxcsn(Replica *r, ReplicaId rid);
+struct berval *create_cleanruv_payload(char *value);
 void ruv_get_cleaned_rids(RUV *ruv, ReplicaId *rids);
 void add_aborted_rid(ReplicaId rid, Replica *r, char *repl_root);
 int is_task_aborted(ReplicaId rid);
-void delete_aborted_rid(Replica *replica, ReplicaId rid, char *repl_root);
+void delete_aborted_rid(Replica *replica, ReplicaId rid, char *repl_root, int skip);
+int is_pre_cleaned_rid(ReplicaId rid);
 void set_cleaned_rid(ReplicaId rid);
 void cleanruv_log(Slapi_Task *task, char *task_type, char *fmt, ...);
 
@@ -643,6 +647,7 @@ typedef struct _cleanruv_data
 	char *repl_root;
 	Slapi_DN *sdn;
 	char *certify;
+	char *force;
 } cleanruv_data;
 
 /* replutil.c */
diff --git a/ldap/servers/plugins/replication/repl5_agmt.c b/ldap/servers/plugins/replication/repl5_agmt.c
index d25f54b..935fb37 100644
--- a/ldap/servers/plugins/replication/repl5_agmt.c
+++ b/ldap/servers/plugins/replication/repl5_agmt.c
@@ -141,7 +141,6 @@ typedef struct repl5agmt {
 	char **attrs_to_strip; /* for fractional replication, if a "mod" is empty, strip out these attributes:
 	                        * modifiersname, modifytimestamp, internalModifiersname, internalModifyTimestamp, etc */
 	int agreement_type;
-	int cleanruv_notified[CLEANRIDSIZ + 1]; /* specifies if the replica has been notified of a CLEANALLRUV task */
 } repl5agmt;
 
 /* Forward declarations */
@@ -252,7 +251,6 @@ agmt_new_from_entry(Slapi_Entry *e)
 	Repl_Agmt *ra;
 	Slapi_Attr *sattr;
 	char *tmpstr;
-	char **clean_vals = NULL;
 	char **denied_attrs = NULL;
 	char *auto_initialize = NULL;
 	char *val_nsds5BeginReplicaRefresh = "start";
@@ -431,20 +429,6 @@ agmt_new_from_entry(Slapi_Entry *e)
 	ra->last_init_start_time = 0UL;
 	ra->last_init_status[0] = '\0';
 	
-	/* cleanruv notification */
-	clean_vals = slapi_entry_attr_get_charray(e, type_nsds5ReplicaCleanRUVnotified);
-	if(clean_vals){
-		int i;
-		for (i = 0; i < CLEANRIDSIZ && clean_vals[i]; i++){
-			ra->cleanruv_notified[i] = atoi(clean_vals[i]);
-		}
-		if(i < CLEANRIDSIZ)
-		    ra->cleanruv_notified[i + 1] = 0;
-		slapi_ch_array_free(clean_vals);
-	} else {
-		ra->cleanruv_notified[0] = 0;
-	}
-
 	/* Fractional attributes */
 	slapi_entry_attr_find(e, type_nsds5ReplicatedAttributeList, &sattr);
 
@@ -2623,89 +2607,6 @@ agmt_set_attrs_to_strip(Repl_Agmt *ra, Slapi_Entry *e)
     return -1;
 }
 
-int
-agmt_is_cleanruv_notified(Repl_Agmt *ra, ReplicaId rid){
-    int notified = 0;
-    int i;
-
-    PR_Lock(ra->lock);
-    for(i = 0; i < CLEANRIDSIZ && ra->cleanruv_notified[i]; i++){
-        if(ra->cleanruv_notified[i] == rid){
-            notified = 1;
-            break;
-        }
-    }
-    PR_Unlock(ra->lock);
-
-    return notified;
-}
-
-/*
- *  This will trigger agmt_set_cleanruv_notified_from_entry() to be called,
- *  which will update the in memory agmt.
- *
- *  op can be:  CLEANRUV_NOTIFIED or CLEANRUV_RELEASED
- */
-int
-agmt_set_cleanruv_data(Repl_Agmt *ra, ReplicaId rid, int op){
-    Slapi_PBlock *pb;
-    LDAPMod *mods[2];
-    LDAPMod mod;
-    struct berval *vals[2];
-    struct berval val;
-    char data[6];
-    int rc = 0;
-
-    if(ra == NULL){
-        return -1;
-    }
-
-    if(op == CLEANRUV_NOTIFIED){
-        /* add the cleanruv data */
-    	mod.mod_op  = LDAP_MOD_ADD|LDAP_MOD_BVALUES;
-    } else {
-        /* remove the cleanruv data */
-    	mod.mod_op  = LDAP_MOD_DELETE|LDAP_MOD_BVALUES;
-    }
-
-    pb = slapi_pblock_new();
-    val.bv_len = PR_snprintf(data, sizeof(data), "%d", (int)rid);
-    mod.mod_type = (char *)type_nsds5ReplicaCleanRUVnotified;
-    mod.mod_bvalues = vals;
-    vals [0] = &val;
-    vals [1] = NULL;
-    val.bv_val = data;
-    mods[0] = &mod;
-    mods[1] = NULL;
-
-    slapi_modify_internal_set_pb_ext (pb, ra->dn, mods, NULL, NULL,
-        repl_get_plugin_identity (PLUGIN_MULTIMASTER_REPLICATION), 0);
-    slapi_modify_internal_pb (pb);
-    slapi_pblock_destroy(pb);
-
-    return rc;
-}
-
-void
-agmt_set_cleanruv_notified_from_entry(Repl_Agmt *ra, Slapi_Entry *e){
-    char **attr_vals = NULL;
-    int i;
-
-    PR_Lock(ra->lock);
-    attr_vals = slapi_entry_attr_get_charray(e, type_nsds5ReplicaCleanRUVnotified);
-    if(attr_vals){
-        for (i = 0; i < CLEANRIDSIZ && attr_vals[i]; i++){
-            ra->cleanruv_notified[i] = atoi(attr_vals[i]);
-        }
-        if( i < CLEANRIDSIZ )
-            ra->cleanruv_notified[i + 1] = 0;
-        slapi_ch_array_free(attr_vals);
-    } else {
-        ra->cleanruv_notified[0] = 0;
-    }
-    PR_Unlock(ra->lock);
-}
-
 /* this is called whenever an update (total/incremental)
    is completed */
 void 
diff --git a/ldap/servers/plugins/replication/repl5_agmtlist.c b/ldap/servers/plugins/replication/repl5_agmtlist.c
index 537cfd8..70f71a8 100644
--- a/ldap/servers/plugins/replication/repl5_agmtlist.c
+++ b/ldap/servers/plugins/replication/repl5_agmtlist.c
@@ -248,7 +248,12 @@ agmtlist_modify_callback(Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry
             /* we don't allow delete attribute operations unless it was issued by
                the replication plugin - handled above */
             if (mods[i]->mod_op & LDAP_MOD_DELETE)
-            {                
+            {
+                if(strcasecmp (mods[i]->mod_type, type_nsds5ReplicaCleanRUVnotified) == 0){
+                    /* allow the deletion of cleanallruv agmt attr */
+                    continue;
+                }
+
                 slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "agmtlist_modify_callback: " 
                                 "deletion of %s attribute is not allowed\n", type_nsds5ReplicaInitialize);	
                 *returncode = LDAP_UNWILLING_TO_PERFORM;
@@ -508,10 +513,6 @@ agmtlist_modify_callback(Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry
                 rc = SLAPI_DSE_CALLBACK_ERROR;
             }
         }
-        else if (slapi_attr_types_equivalent(mods[i]->mod_type, type_nsds5ReplicaCleanRUVnotified))
-        {
-            agmt_set_cleanruv_notified_from_entry(agmt, e);
-        }
         else if (0 == windows_handle_modify_agreement(agmt, mods[i]->mod_type, e))
         {
             slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "agmtlist_modify_callback: " 
diff --git a/ldap/servers/plugins/replication/repl5_connection.c b/ldap/servers/plugins/replication/repl5_connection.c
index 51a2bc5..5efd0e6 100644
--- a/ldap/servers/plugins/replication/repl5_connection.c
+++ b/ldap/servers/plugins/replication/repl5_connection.c
@@ -1760,6 +1760,12 @@ bind_method_to_mech(int bindmethod)
 	return LDAP_SASL_SIMPLE;
 }
 
+const char*
+conn_get_bindmethod(Repl_Connection *conn)
+{
+    return (bind_method_to_mech(conn->bindmethod));
+}
+
 /*
  * Check the result of an ldap BIND operation to see we it
  * contains the expiration controls
diff --git a/ldap/servers/plugins/replication/repl5_init.c b/ldap/servers/plugins/replication/repl5_init.c
index 7a80c6f..a0f02fe 100644
--- a/ldap/servers/plugins/replication/repl5_init.c
+++ b/ldap/servers/plugins/replication/repl5_init.c
@@ -123,7 +123,7 @@ static char *cleanruv_oid_list[] = {
 		NULL
 };
 static char *cleanruv_name_list[] = {
-		NSDS_REPL_NAME_PREFIX " Cleanruv",
+		NSDS_REPL_NAME_PREFIX " CleanAllRUV",
 		NULL
 };
 static char *cleanruv_abort_oid_list[] = {
@@ -131,9 +131,26 @@ static char *cleanruv_abort_oid_list[] = {
 		NULL
 };
 static char *cleanruv_abort_name_list[] = {
-		NSDS_REPL_NAME_PREFIX " Cleanruv Abort",
+		NSDS_REPL_NAME_PREFIX " CleanAllRUV Abort",
 		NULL
 };
+static char *cleanruv_maxcsn_oid_list[] = {
+               REPL_CLEANRUV_GET_MAXCSN_OID,
+               NULL
+};
+static char *cleanruv_maxcsn_name_list[] = {
+               NSDS_REPL_NAME_PREFIX " CleanAllRUV Retrieve MaxCSN",
+               NULL
+};
+static char *cleanruv_status_oid_list[] = {
+               REPL_CLEANRUV_CHECK_STATUS_OID,
+               NULL
+};
+static char *cleanruv_status_name_list[] = {
+               NSDS_REPL_NAME_PREFIX " CleanAllRUV Check Status",
+               NULL
+};
+
 
 /* List of plugin identities for every plugin registered. Plugin identity
    is passed by the server in the plugin init function and must be supplied 
@@ -403,6 +420,52 @@ multimaster_end_extop_init( Slapi_PBlock *pb )
     return rc;
 }
 
+int
+multimaster_cleanruv_maxcsn_extop_init( Slapi_PBlock *pb )
+{
+	int rc= 0; /* OK */
+	void *identity = NULL;
+
+	/* get plugin identity and store it to pass to internal operations */
+	slapi_pblock_get (pb, SLAPI_PLUGIN_IDENTITY, &identity);
+	PR_ASSERT (identity);
+
+	if (slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION, SLAPI_PLUGIN_VERSION_01 ) != 0 ||
+			  slapi_pblock_set( pb, SLAPI_PLUGIN_DESCRIPTION, (void *)&multimasterextopdesc ) != 0 ||
+			  slapi_pblock_set( pb, SLAPI_PLUGIN_EXT_OP_OIDLIST, (void *)cleanruv_maxcsn_oid_list ) != 0  ||
+			  slapi_pblock_set( pb, SLAPI_PLUGIN_EXT_OP_NAMELIST, (void *)cleanruv_maxcsn_name_list ) != 0  ||
+			  slapi_pblock_set( pb, SLAPI_PLUGIN_EXT_OP_FN, (void *)multimaster_extop_cleanruv_get_maxcsn ))
+	{
+		slapi_log_error( SLAPI_LOG_PLUGIN, repl_plugin_name, "multimaster_cleanruv_extop_init failed\n" );
+		rc= -1;
+	}
+
+	return rc;
+}
+
+int
+multimaster_cleanruv_status_extop_init( Slapi_PBlock *pb )
+{
+	int rc= 0; /* OK */
+	void *identity = NULL;
+
+	/* get plugin identity and store it to pass to internal operations */
+	slapi_pblock_get (pb, SLAPI_PLUGIN_IDENTITY, &identity);
+	PR_ASSERT (identity);
+
+	if (slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION, SLAPI_PLUGIN_VERSION_01 ) != 0 ||
+			  slapi_pblock_set( pb, SLAPI_PLUGIN_DESCRIPTION, (void *)&multimasterextopdesc ) != 0 ||
+			  slapi_pblock_set( pb, SLAPI_PLUGIN_EXT_OP_OIDLIST, (void *)cleanruv_status_oid_list ) != 0  ||



More information about the Pkg-fedora-ds-maintainers mailing list