From 5934d696ebb47ec664235b4e2c9259b5b9b1347c Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Thu, 8 Jun 2006 11:54:10 +0000 Subject: [PATCH] ITS#4582 complain if no rootDN was set when configuring syncrepl --- servers/slapd/syncrepl.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index 929a62a8a8..a15f7e68dc 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -3222,8 +3222,14 @@ add_syncrepl( int rc = 0; if ( !( c->be->be_search && c->be->be_add && c->be->be_modify && c->be->be_delete ) ) { - Debug( LDAP_DEBUG_ANY, "%s: database %s does not support operations " - "required for syncrepl\n", c->log, c->be->be_type, 0 ); + snprintf( c->msg, sizeof(c->msg), "database %s does not support " + "operations required for syncrepl", c->be->be_type ); + Debug( LDAP_DEBUG_ANY, "%s: %s\n", c->log, c->msg, 0 ); + return 1; + } + if ( BER_BVISEMPTY( &c->be->be_rootdn )) { + strcpy( c->msg, "rootDN must be defined before syncrepl may be used" ); + Debug( LDAP_DEBUG_ANY, "%s: %s\n", c->log, c->msg, 0 ); return 1; } si = (syncinfo_t *) ch_calloc( 1, sizeof( syncinfo_t ) ); -- 2.39.2