LDAP_F( int )
ber_get_option LDAP_P((
- void *item,
+ LDAP_CONST void *item,
int option,
void *outvalue));
#define LDAP_MOD_ADD 0x0000
#define LDAP_MOD_DELETE 0x0001
#define LDAP_MOD_REPLACE 0x0002
-/* IMPORTANT: do not use code 0x04, it is used internally by the backends!
+#define LDAP_MOD_BVALUES 0x0080
+/* IMPORTANT: do not use code 0x1000 (or above),
+ * it is used internally by the backends!
* (see ldap/servers/slapd/slap.h)
* JCG 05/1999 (gomez@engr.sgi.com)
*/
-#define LDAP_MOD_BVALUES 0x0080
char *mod_type;
union mod_vals_u {
char **modv_strvals;
*/
LDAP_F( int )
ldap_get_option LDAP_P((
- LDAP *ld,
+ LDAP_CONST LDAP *ld,
int option,
void *outvalue));
LDAP_F( int )
ber_pvt_sb_destroy LDAP_P(( Sockbuf *sb ));
-#ifdef USE_SASL
+#ifdef USE_SASL
LDAP_F( int )
ber_pvt_sb_set_sec LDAP_P(( Sockbuf *sb, Sockbuf_Sec *sec, void *arg ));
int
ber_get_option(
- void *item,
+ LDAP_CONST void *item,
int option,
void *outvalue)
{
- BerElement *ber;
- Sockbuf *sb;
+ LDAP_CONST BerElement *ber;
+ LDAP_CONST Sockbuf *sb;
ber_int_options.lbo_valid = LBER_INITIALIZED;
return LBER_OPT_ERROR;
}
- ber = (BerElement *) item;
- sb = (Sockbuf *) item;
+ ber = item;
+ sb = item;
switch(option) {
case LBER_OPT_BER_OPTIONS:
return LBER_OPT_ERROR;
}
- ber = (BerElement *) item;
- sb = (Sockbuf *) item;
+ ber = item;
+ sb = item;
switch(option) {
case LBER_OPT_BER_OPTIONS:
for ( i = 0; mods[i] != NULL; i++ ) {
if ( mods[i]->mod_op & LDAP_MOD_BVALUES ) {
- ber_bvecfree( mods[i]->mod_bvalues );
- } else {
- ldap_value_free( mods[i]->mod_values );
+ if( mods[i]->mod_bvalues != NULL )
+ ber_bvecfree( mods[i]->mod_bvalues );
+
+ } else if( mods[i]->mod_values != NULL ) {
+ LDAP_VFREE( mods[i]->mod_values );
+ }
+
+ if ( mods[i]->mod_type != NULL ) {
+ LDAP_FREE( mods[i]->mod_type );
}
+
LDAP_FREE( (char *) mods[i] );
}
int
ldap_get_option(
- LDAP *ld,
+ LDAP_CONST LDAP *ld,
int option,
void *outvalue)
{
- struct ldapoptions *lo;
+ LDAP_CONST struct ldapoptions *lo;
if( ldap_int_global_options.ldo_valid != LDAP_INITIALIZED ) {
ldap_int_initialize();
* modrdn when the new rdn was already an attribute value itself.
* JCG 05/1999 (gomez@engr.sgi.com)
*/
-#define LDAP_MOD_SOFTADD 0x04
+#define LDAP_MOD_SOFTADD 0x1000
#define DN_DNS 0
#define DN_X500 1