fix attribute delete (ITS#2158) patch provided by Timofey B. Nickonov <ntb@mts.ru>

This commit is contained in:
Pierangelo Masarati 2002-11-02 16:00:21 +00:00
parent 2d98b19bf7
commit a777c53564
2 changed files with 24 additions and 13 deletions

View File

@ -140,12 +140,17 @@ ldap_back_modify(
} }
#endif /* ENABLE_REWRITE */ #endif /* ENABLE_REWRITE */
if ( ml->sml_bvalues != NULL ) {
for (j = 0; ml->sml_bvalues[j].bv_val; j++); for (j = 0; ml->sml_bvalues[j].bv_val; j++);
mods[i].mod_bvalues = (struct berval **)ch_malloc((j+1) * mods[i].mod_bvalues = (struct berval **)ch_malloc((j+1) *
sizeof(struct berval *)); sizeof(struct berval *));
for (j = 0; ml->sml_bvalues[j].bv_val; j++) for (j = 0; ml->sml_bvalues[j].bv_val; j++)
mods[i].mod_bvalues[j] = &ml->sml_bvalues[j]; mods[i].mod_bvalues[j] = &ml->sml_bvalues[j];
mods[i].mod_bvalues[j] = NULL; mods[i].mod_bvalues[j] = NULL;
} else {
mods[i].mod_bvalues = NULL;
}
i++; i++;
} }
modv[i] = 0; modv[i] = 0;

View File

@ -179,12 +179,18 @@ meta_back_modify(
ml->sml_bvalues, conn ); ml->sml_bvalues, conn );
} }
if ( ml->sml_bvalues != NULL ){
for (j = 0; ml->sml_bvalues[ j ].bv_val; j++); for (j = 0; ml->sml_bvalues[ j ].bv_val; j++);
mods[ i ].mod_bvalues = (struct berval **)ch_malloc((j+1) * mods[ i ].mod_bvalues = (struct berval **)ch_malloc((j+1) *
sizeof(struct berval *)); sizeof(struct berval *));
for (j = 0; ml->sml_bvalues[ j ].bv_val; j++) for (j = 0; ml->sml_bvalues[ j ].bv_val; j++)
mods[ i ].mod_bvalues[ j ] = &ml->sml_bvalues[j]; mods[ i ].mod_bvalues[ j ] = &ml->sml_bvalues[j];
mods[ i ].mod_bvalues[ j ] = NULL; mods[ i ].mod_bvalues[ j ] = NULL;
} else {
mods[ i ].mod_bvalues = NULL;
}
i++; i++;
} }
modv[ i ] = 0; modv[ i ] = 0;