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

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

View File

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