Align with code changes in liblber/libldap:

Replace LDAPMod with a new struct LDAPModList.
Rename lber_debug to lber_int_debug.
This commit is contained in:
Hallvard Furuseth 1999-03-08 00:39:46 +00:00
parent 23b3217b66
commit b6c16f861e
4 changed files with 27 additions and 17 deletions

View file

@ -31,6 +31,15 @@ struct conn {
struct conn *c_next;
};
/*
* This structure represents a sequence of LDAPMod elements.
*/
typedef struct LDAPModList {
LDAPMod m;
struct LDAPModList *mod_next;
} LDAPModList;
/*
* This structure represents an outstanding request. There is one of
* these for each client request for which we have not yet received a
@ -41,7 +50,7 @@ struct msg {
int m_msgid; /* the message id */
int m_uniqid; /* unique id for this message */
int m_msgtype; /* the ldap operation type */
LDAPMod *m_mods; /* for modify operations only */
LDAPModList *m_mods; /* for modify operations only */
BerElement *m_ber; /* the unparsed ber for the op */
struct conn *m_conn; /* connection structure */
#ifdef LDAP_CONNECTIONLESS

View file

@ -154,7 +154,7 @@ main( int argc, char **argv )
#ifdef LDAP_DEBUG
ldap_debug = atoi( optarg );
if ( ldap_debug & LDAP_DEBUG_PACKETS )
lber_debug = ldap_debug;
lber_int_debug = ldap_debug;
#else
fprintf( stderr, "Not compiled with -DLDAP_DEBUG!\n" );
#endif

View file

@ -51,7 +51,7 @@ do_modify(
char *last;
int rc;
unsigned long tag, len;
LDAPMod *mods, *modtail;
LDAPModList *mods, *modtail;
struct ds_read_arg ra;
Debug( LDAP_DEBUG_TRACE, "do_modify\n", 0, 0, 0 );
@ -108,17 +108,17 @@ do_modify(
mods = modtail = NULL;
for ( tag = ber_first_element( ber, &len, &last ); tag != LBER_DEFAULT;
tag = ber_next_element( ber, &len, last ) ) {
LDAPMod *tmp;
LDAPModList *tmp;
if ( (tmp = (LDAPMod *) calloc( 1, sizeof(LDAPMod) ))
if ( (tmp = (LDAPModList *) calloc( 1, sizeof(LDAPModList) ))
== NULL ) {
send_ldap_msgresult( clientsb, MODTAG, m,
LDAP_OPERATIONS_ERROR, NULL, "Malloc error" );
return( 0 );
}
if ( ber_scanf( ber, "{i{a[V]}}", &tmp->mod_op, &tmp->mod_type,
&tmp->mod_bvalues ) == LBER_ERROR ) {
if ( ber_scanf( ber, "{i{a[V]}}", &tmp->m.mod_op,
&tmp->m.mod_type, &tmp->m.mod_bvalues ) == LBER_ERROR ) {
send_ldap_msgresult( clientsb, MODTAG, m,
LDAP_PROTOCOL_ERROR, NULL, "" );
return( 0 );
@ -157,7 +157,7 @@ do_modify2(
struct ds_modifyentry_arg ma;
struct entrymod *changetail = NULLMOD;
int rc;
LDAPMod *mods;
LDAPModList *mods;
Debug( LDAP_DEBUG_TRACE, "do_modify2\n", 0, 0, 0 );
@ -181,7 +181,7 @@ do_modify2(
em->em_next = NULLMOD;
if ( (new = get_as( clientsb, MODTAG, m,
mods->mod_type, mods->mod_bvalues )) == NULLATTR )
mods->m.mod_type, mods->m.mod_bvalues )) == NULLATTR )
return( 0 );
em->em_what = new;
@ -192,13 +192,13 @@ do_modify2(
}
if ( new->attr_value == NULLAV &&
mods->mod_op != LDAP_MOD_DELETE ) {
mods->m.mod_op != LDAP_MOD_DELETE ) {
send_ldap_msgresult( clientsb, MODTAG, m,
LDAP_INVALID_SYNTAX, NULL, "No values specified" );
return( 0 );
}
switch ( mods->mod_op ) {
switch ( mods->m.mod_op ) {
case LDAP_MOD_ADD:
Debug( LDAP_DEBUG_ARGS, "ADD:\n", 0, 0, 0 );
@ -490,14 +490,15 @@ modify_result( Sockbuf *sb, struct msg *m )
}
void
modlist_free( LDAPMod *mods )
modlist_free( LDAPModList *mods )
{
LDAPMod *next = NULL;
LDAPModList *next;
for ( ; mods != NULL; mods = next ) {
free( mods->mod_type );
if ( mods->mod_bvalues != NULL )
ber_bvecfree( mods->mod_bvalues );
free( mods->m.mod_type );
if ( mods->m.mod_bvalues != NULL )
ber_bvecfree( mods->m.mod_bvalues );
next = mods->mod_next;
free( mods );
}
}

View file

@ -109,7 +109,7 @@ int do_modify2 LDAP_P((Sockbuf *sb, struct msg *m, struct ds_read_result *rr));
Attr_Sequence get_as LDAP_P(( Sockbuf *clientsb, unsigned long op, struct msg *m,
char *type, struct berval **bvals ));
void modify_result LDAP_P(( Sockbuf *sb, struct msg *m ));
void modlist_free LDAP_P(( LDAPMod *mods ));
void modlist_free LDAP_P(( LDAPModList *mods ));
/*
* modrdn.c