}
op->o_protocol = LDAP_VERSION3;
- ldap_set_option( si->si_ld, LDAP_OPT_PROTOCOL_VERSION, &op->o_protocol );
+ ldap_set_option( si->si_ld, LDAP_OPT_PROTOCOL_VERSION,
+ (const void *)&op->o_protocol );
+
+#ifdef HAVE_TLS
+ if ( si->si_bindconf.sb_tls_do_init ) {
+ rc = bindconf_tls_set( &si->si_bindconf, si->si_ld );
+ } else if ( si->si_bindconf.sb_tls_ctx ) {
+ rc = ldap_set_option( si->si_ld, LDAP_OPT_X_TLS_CTX,
+ si->si_bindconf.sb_tls_ctx );
+ }
+ if ( rc ) {
+ Debug( LDAP_DEBUG_ANY,
+ "do_syncrep1: TLS context initialization failed\n", 0, 0, 0 );
+ return rc;
+ }
+#endif
/* Bind to master */
f.f_choice = LDAP_FILTER_EQUALITY;
f.f_ava = &ava;
ava.aa_desc = slap_schema.si_ad_entryUUID;
- (void)slap_uuidstr_from_normalized( &syncUUID_strrep, syncUUID, op->o_tmpmemctx );
ava.aa_value = *syncUUID;
+
+ (void)slap_uuidstr_from_normalized( &syncUUID_strrep, syncUUID, op->o_tmpmemctx );
+ if ( syncuuid_bv ) {
+ Debug( LDAP_DEBUG_SYNC, "syncrepl_entry: inserted UUID %s\n",
+ syncUUID_strrep.bv_val, 0, 0 );
+ }
op->ors_filter = &f;
op->ors_filterstr.bv_len = STRLENOF( "(entryUUID=)" ) + syncUUID_strrep.bv_len;
if ( !(si->si_refreshDelete & NP_DELETE_ONE )) {
a = attr_find( rs->sr_entry->e_attrs, slap_schema.si_ad_entryUUID );
- if ( a == NULL ) return 0;
+ if ( a )
+ present_uuid = avl_find( si->si_presentlist, &a->a_nvals[0],
+ syncuuid_cmp );
- present_uuid = avl_find( si->si_presentlist, &a->a_nvals[0],
- syncuuid_cmp );
+ Debug( LDAP_DEBUG_SYNC, "nonpresent_callback: UUID %s, dn %s, %sfound\n",
+ a ? a->a_vals[0].bv_val : "<missing>", rs->sr_entry->e_name.bv_val, present_uuid ? "" : "not " );
+
+ if ( a == NULL ) return 0;
}
if ( present_uuid == NULL ) {
/* mandatory */
#define GOT_ID 0x0001
-#define GOT_PROVIDER 0x0002
+#define GOT_PROVIDER 0x0002
+#define GOT_BASE 0x0004
/* check */
-#define GOT_ALL (GOT_ID|GOT_PROVIDER)
+#define GOT_ALL (GOT_ID|GOT_PROVIDER|GOT_BASE)
static struct {
struct berval key;
{ BER_BVC("one"), LDAP_SCOPE_ONELEVEL },
{ BER_BVC("onelevel"), LDAP_SCOPE_ONELEVEL }, /* OpenLDAP extension */
{ BER_BVC("children"), LDAP_SCOPE_SUBORDINATE },
+ { BER_BVC("subord"), LDAP_SCOPE_SUBORDINATE },
{ BER_BVC("subordinate"), LDAP_SCOPE_SUBORDINATE },
{ BER_BVC("sub"), LDAP_SCOPE_SUBTREE },
{ BER_BVC("subtree"), LDAP_SCOPE_SUBTREE }, /* OpenLDAP extension */
Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 );
return -1;
}
+ gots |= GOT_BASE;
} else if ( !strncasecmp( c->argv[ i ], LOGBASESTR "=",
STRLENOF( LOGBASESTR "=" ) ) )
{
} else if ( strchr( val, ':' ) != NULL ) {
char *next, *ptr = val;
unsigned dd, hh, mm, ss;
+
+ /* NOTE: the test for ptr[ 0 ] == '-'
+ * should go before the call to strtoul() */
dd = strtoul( ptr, &next, 10 );
- if ( next == ptr || next[0] != ':' ) {
+ if ( ptr[ 0 ] == '-' || next == ptr || next[0] != ':' ) {
snprintf( c->msg, sizeof( c->msg ),
"Error: parse_syncrepl_line: "
"invalid interval \"%s\", unable to parse days", val );
}
ptr = next + 1;
hh = strtoul( ptr, &next, 10 );
- if ( next == ptr || next[0] != ':' || hh > 24 ) {
+ if ( ptr[ 0 ] == '-' || next == ptr || next[0] != ':' || hh > 24 ) {
snprintf( c->msg, sizeof( c->msg ),
"Error: parse_syncrepl_line: "
"invalid interval \"%s\", unable to parse hours", val );
}
ptr = next + 1;
mm = strtoul( ptr, &next, 10 );
- if ( next == ptr || next[0] != ':' || mm > 60 ) {
+ if ( ptr[ 0 ] == '-' || next == ptr || next[0] != ':' || mm > 60 ) {
snprintf( c->msg, sizeof( c->msg ),
"Error: parse_syncrepl_line: "
"invalid interval \"%s\", unable to parse minutes", val );
}
ptr = next + 1;
ss = strtoul( ptr, &next, 10 );
- if ( next == ptr || next[0] != '\0' || ss > 60 ) {
+ if ( ptr[ 0 ] == '-' || next == ptr || next[0] != '\0' || ss > 60 ) {
snprintf( c->msg, sizeof( c->msg ),
"Error: parse_syncrepl_line: "
"invalid interval \"%s\", unable to parse seconds", val );
if ( gots != GOT_ALL ) {
snprintf( c->msg, sizeof( c->msg ),
- "Error: Malformed \"syncrepl\" line in slapd config file" );
+ "Error: Malformed \"syncrepl\" line in slapd config file, missing%s%s%s",
+ gots & GOT_ID ? "" : " "IDSTR,
+ gots & GOT_PROVIDER ? "" : " "PROVIDERSTR,
+ gots & GOT_BASE ? "" : " "SEARCHBASESTR );
Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 );
return -1;
}
}
return 1;
} else if ( c->op == LDAP_MOD_DELETE ) {
- struct re_s *re;
-
if ( c->be->be_syncinfo ) {
syncinfo_free( c->be->be_syncinfo );
c->be->be_syncinfo = NULL;