Commit c58fc191 authored by Howard Chu's avatar Howard Chu
Browse files

ITS#6473 from HEAD

parent ed823cdc
...@@ -1202,10 +1202,11 @@ static slap_verbmasks modops[] = { ...@@ -1202,10 +1202,11 @@ static slap_verbmasks modops[] = {
{ BER_BVNULL, 0 } { BER_BVNULL, 0 }
}; };
static Modifications * static int
syncrepl_accesslog_mods( syncrepl_accesslog_mods(
syncinfo_t *si, syncinfo_t *si,
struct berval *vals struct berval *vals,
struct Modifications **modres
) )
{ {
char *colon; char *colon;
...@@ -1214,7 +1215,7 @@ syncrepl_accesslog_mods( ...@@ -1214,7 +1215,7 @@ syncrepl_accesslog_mods(
struct berval bv, bv2; struct berval bv, bv2;
short op; short op;
Modifications *mod = NULL, *modlist = NULL, **modtail; Modifications *mod = NULL, *modlist = NULL, **modtail;
int i; int i, rc = 0;
modtail = &modlist; modtail = &modlist;
...@@ -1228,7 +1229,13 @@ syncrepl_accesslog_mods( ...@@ -1228,7 +1229,13 @@ syncrepl_accesslog_mods(
bv.bv_len = colon - bv.bv_val; bv.bv_len = colon - bv.bv_val;
if ( slap_bv2ad( &bv, &ad, &text )) { if ( slap_bv2ad( &bv, &ad, &text )) {
/* Invalid */ /* Invalid */
continue; Debug( LDAP_DEBUG_ANY, "syncrepl_accesslog_mods: %s "
"Invalid attribute %s, %s\n",
si->si_ridtxt, bv.bv_val, text );
slap_mods_free( modlist, 1 );
modlist = NULL;
rc = -1;
break;
} }
/* Ignore dynamically generated attrs */ /* Ignore dynamically generated attrs */
if ( ad->ad_type->sat_flags & SLAP_AT_DYNAMIC ) if ( ad->ad_type->sat_flags & SLAP_AT_DYNAMIC )
...@@ -1266,16 +1273,18 @@ syncrepl_accesslog_mods( ...@@ -1266,16 +1273,18 @@ syncrepl_accesslog_mods(
ber_bvarray_add( &mod->sml_values, &bv2 ); ber_bvarray_add( &mod->sml_values, &bv2 );
} }
} }
return modlist; *modres = modlist;
return rc;
} }
static Modifications * static int
syncrepl_changelog_mods( syncrepl_changelog_mods(
syncinfo_t *si, syncinfo_t *si,
struct berval *vals struct berval *vals,
struct Modifications **modres
) )
{ {
return NULL; /* FIXME */ return -1; /* FIXME */
} }
static int static int
...@@ -1352,9 +1361,10 @@ syncrepl_message_to_op( ...@@ -1352,9 +1361,10 @@ syncrepl_message_to_op(
} else if ( !ber_bvstrcasecmp( &bv, &ls->ls_mod )) { } else if ( !ber_bvstrcasecmp( &bv, &ls->ls_mod )) {
/* Parse attribute into modlist */ /* Parse attribute into modlist */
if ( si->si_syncdata == SYNCDATA_ACCESSLOG ) if ( si->si_syncdata == SYNCDATA_ACCESSLOG )
modlist = syncrepl_accesslog_mods( si, bvals ); rc = syncrepl_accesslog_mods( si, bvals, &modlist );
else else
modlist = syncrepl_changelog_mods( si, bvals ); rc = syncrepl_changelog_mods( si, bvals, &modlist );
if ( rc ) goto done;
} else if ( !ber_bvstrcasecmp( &bv, &ls->ls_newRdn )) { } else if ( !ber_bvstrcasecmp( &bv, &ls->ls_newRdn )) {
rdn = bvals[0]; rdn = bvals[0];
} else if ( !ber_bvstrcasecmp( &bv, &ls->ls_delRdn )) { } else if ( !ber_bvstrcasecmp( &bv, &ls->ls_delRdn )) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment