}
}
- if ( ldap_result( ld, msgid, 1, NULL, &result ) == -1 ) {
+ if ( ldap_result( ld, msgid, LDAP_MSG_ALL, NULL, &result ) == -1 ) {
tool_perror( "ldap_result", -1, NULL, NULL, NULL, NULL );
exit( EXIT_FAILURE );
}
rc = ldap_result( ld, msgid,
#ifdef LDAP_GROUP_TRANSACTION
- txn ? 0 : 1,
+ txn ? LDAP_MSG_ONE : LDAP_MSG_ALL,
#else
- 1,
+ LDAP_MSG_ALL,
#endif
&tv, &res );
if ( tool_check_abandon( ld, msgid ) ) {
if ( rc != LDAP_SUCCESS )
return( rc );
- if ( ldap_result( ld, msgid, 1, (struct timeval *) NULL, &res ) == -1 )
+ if ( ldap_result( ld, msgid, LDAP_MSG_ALL, (struct timeval *) NULL, &res ) == -1 )
return( ld->ld_errno );
return( ldap_result2error( ld, res, 1 ) );
if ( rc != LDAP_SUCCESS )
return( rc );
- if ( ldap_result( ld, msgid, 1, (struct timeval *) NULL, &res ) == -1 )
+ if ( ldap_result( ld, msgid, LDAP_MSG_ALL, (struct timeval *) NULL, &res ) == -1 )
return( ld->ld_errno );
return( ldap_result2error( ld, res, 1 ) );
if( rc != LDAP_SUCCESS )
return( ld->ld_errno );
- if ( ldap_result( ld, msgid, 1, (struct timeval *) NULL, &res ) == -1 )
+ if ( ldap_result( ld, msgid, LDAP_MSG_ALL, (struct timeval *) NULL, &res ) == -1 )
return( ld->ld_errno );
return( ldap_result2error( ld, res, 1 ) );
return( rc );
}
- if ( ldap_result( ld, msgid, 1, (struct timeval *) NULL, &res ) == -1 ) {
+ if ( ldap_result( ld, msgid, LDAP_MSG_ALL, (struct timeval *) NULL, &res ) == -1 ) {
return( ld->ld_errno );
}
struct berval **retgrpcookiep,
struct berval **retgrpdatap )
{
- int rc;
- int msgid;
- LDAPMessage *res;
+ int rc;
+ int msgid;
+ LDAPMessage *res;
Debug( LDAP_DEBUG_TRACE, "ldap_grouping_create_s\n", 0, 0, 0 );
assert( LDAP_VALID( ld ) );
assert( grpoid != NULL || *grpoid == '\0' );
- rc = ldap_grouping_create( ld, grpoid, grpdata,
+ rc = ldap_grouping_create( ld, grpoid, grpdata,
sctrls, cctrls, &msgid );
- if ( rc != LDAP_SUCCESS ) {
- return rc;
+ if ( rc != LDAP_SUCCESS ) {
+ return rc;
}
- if ( ldap_result( ld, msgid, 1, (struct timeval *) NULL, &res ) == -1 ) {
- return ld->ld_errno;
+ if ( ldap_result( ld, msgid, LDAP_MSG_ALL, (struct timeval *) NULL, &res ) == -1 ) {
+ return ld->ld_errno;
}
if ( retgrpcookiep != NULL ) *retgrpcookiep = NULL;
return rc;
}
- return( ldap_result2error( ld, res, 1 ) );
+ return( ldap_result2error( ld, res, 1 ) );
}
int ldap_grouping_end(
return( ld->ld_errno );
/* wait for a result */
- if ( ldap_result( ld, msgid, 1, (struct timeval *) 0, &res )
+ if ( ldap_result( ld, msgid, LDAP_MSG_ALL, (struct timeval *) 0, &res )
== -1 ) {
return( ld->ld_errno ); /* ldap_result sets ld_errno */
}
return( ld->ld_errno );
/* wait for a result */
- if ( ldap_result( ld, msgid, 1, (struct timeval *) 0, &res )
+ if ( ldap_result( ld, msgid, LDAP_MSG_ALL, (struct timeval *) 0, &res )
== -1 ) {
return( ld->ld_errno ); /* ldap_result sets ld_errno */
}
if ( rc != LDAP_SUCCESS )
return( rc );
- if ( ldap_result( ld, msgid, 1, (struct timeval *) NULL, &res ) == -1 )
+ if ( ldap_result( ld, msgid, LDAP_MSG_ALL, (struct timeval *) NULL, &res ) == -1 )
return( ld->ld_errno );
return( ldap_result2error( ld, res, 1 ) );
return rc;
}
- rc = ldap_result( ld, msgid, 1, NULL, &res );
+ rc = ldap_result( ld, msgid, LDAP_MSG_ALL, NULL, &res );
if( rc == -1 ) {
return ld->ld_errno;
return rc;
}
- if ( ldap_result( ld, msgid, 1, (struct timeval *) NULL, &res ) == -1 ) {
+ if ( ldap_result( ld, msgid, LDAP_MSG_ALL, (struct timeval *) NULL, &res ) == -1 ) {
return ld->ld_errno;
}
}
#endif
- if ( ldap_result( ld, msgid, 1, NULL, &result ) == -1 ) {
+ if ( ldap_result( ld, msgid, LDAP_MSG_ALL, NULL, &result ) == -1 ) {
return( ld->ld_errno ); /* ldap_result sets ld_errno */
}
return( rc );
}
- rc = ldap_result( ld, msgid, 1, timeout, res );
+ rc = ldap_result( ld, msgid, LDAP_MSG_ALL, timeout, res );
if( rc <= 0 ) {
/* error(-1) or timeout(0) */
== -1 )
return( ld->ld_errno );
- if ( ldap_result( ld, msgid, 1, timeout, res ) == -1 )
+ if ( ldap_result( ld, msgid, LDAP_MSG_ALL, timeout, res ) == -1 )
return( ld->ld_errno );
if ( ld->ld_errno == LDAP_TIMEOUT ) {
== -1 )
return( ld->ld_errno );
- if ( ldap_result( ld, msgid, 1, (struct timeval *) NULL, res ) == -1 )
+ if ( ldap_result( ld, msgid, LDAP_MSG_ALL, (struct timeval *) NULL, res ) == -1 )
return( ld->ld_errno );
return( ldap_result2error( ld, *res, 0 ) );
rc = ldap_whoami( ld, sctrls, cctrls, &msgid );
if ( rc != LDAP_SUCCESS ) return rc;
- if ( ldap_result( ld, msgid, 1, (struct timeval *) NULL, &res ) == -1 ) {
+ if ( ldap_result( ld, msgid, LDAP_MSG_ALL, (struct timeval *) NULL, &res ) == -1 ) {
return ld->ld_errno;
}
retry:;
/* if result parsing fails, note the failure reason */
- rc = ldap_result( lc->lc_ld, msgid, 1, &tv, &res );
+ rc = ldap_result( lc->lc_ld, msgid, LDAP_MSG_ALL, &tv, &res );
switch ( rc ) {
case 0:
if ( timeout ) {
retry:
rs->sr_err = ldap_whoami( lc->lc_ld, ctrls, NULL, &msgid );
if ( rs->sr_err == LDAP_SUCCESS ) {
- if ( ldap_result( lc->lc_ld, msgid, 1, NULL, &res ) == -1 ) {
+ if ( ldap_result( lc->lc_ld, msgid, LDAP_MSG_ALL, NULL, &res ) == -1 ) {
ldap_get_option( lc->lc_ld, LDAP_OPT_ERROR_NUMBER,
&rs->sr_err );
if ( rs->sr_err == LDAP_SERVER_DOWN && doretry ) {
op->o_ctrls, NULL, &msgid );
if ( rc == LDAP_SUCCESS ) {
- if ( ldap_result( lc->lc_ld, msgid, 1, NULL, &res ) == -1 ) {
+ if ( ldap_result( lc->lc_ld, msgid, LDAP_MSG_ALL, NULL, &res ) == -1 ) {
ldap_get_option( lc->lc_ld, LDAP_OPT_ERROR_NUMBER, &rc );
ldap_back_freeconn( op, lc, 0 );
lc = NULL;
* but this is necessary for version matching, and for ACL processing.
*/
- for ( rc = 0; rc != -1; rc = ldap_result( lc->lc_ld, msgid, 0, &tv, &res ) )
+ for ( rc = 0; rc != -1; rc = ldap_result( lc->lc_ld, msgid, LDAP_MSG_ONE, &tv, &res ) )
{
/* check for abandon */
if ( op->o_abandon ) {
rs->sr_err = LDAP_OTHER;
rc = ldap_result( mc->mc_conns[ candidate ].msc_ld,
- msgid, LDAP_MSG_ONE, tvp, &res );
+ msgid, LDAP_MSG_ALL, tvp, &res );
switch ( rc ) {
case -1:
send_ldap_result( op, rs );
*/
retry:;
tv = mt->mt_bind_timeout;
- switch ( ldap_result( msc->msc_ld, msgid, 0, &tv, &res ) ) {
+ switch ( ldap_result( msc->msc_ld, msgid, LDAP_MSG_ALL, &tv, &res ) ) {
case 0:
snprintf( buf, sizeof( buf ),
"ldap_result=0 nretries=%d%s\n",
*/
retry:;
tv = mt->mt_bind_timeout;
- switch ( ldap_result( msc->msc_ld, msgid, 0, &tv, &res ) ) {
+ switch ( ldap_result( msc->msc_ld, msgid, LDAP_MSG_ALL, &tv, &res ) ) {
case 0:
snprintf( buf, sizeof( buf ),
"ldap_result=0 nretries=%d%s",
}
lrc = ldap_result( msc->msc_ld, msgid[ i ],
- 0, &tv, &res );
+ LDAP_MSG_ALL, &tv, &res );
if ( lrc == 0 ) {
assert( res == NULL );
rs->sr_err = LDAP_OTHER;
rc = ldap_result( mc->mc_conns[ candidate ].msc_ld,
- msgid, LDAP_MSG_ONE, tvp, &res );
+ msgid, LDAP_MSG_ALL, tvp, &res );
switch ( rc ) {
case -1:
rs->sr_err = LDAP_OTHER;
rs->sr_err = LDAP_OTHER;
rc = ldap_result( mc->mc_conns[ candidate ].msc_ld,
- msgid, LDAP_MSG_ONE, tvp, &res );
+ msgid, LDAP_MSG_ALL, tvp, &res );
switch ( rc ) {
case -1:
rc = -1;
rs->sr_err = LDAP_OTHER;
rc = ldap_result( mc->mc_conns[ candidate ].msc_ld,
- msgid, LDAP_MSG_ONE, tvp, &res );
+ msgid, LDAP_MSG_ALL, tvp, &res );
switch ( rc ) {
case -1:
break;
*/
get_result:;
rc = ldap_result( msc->msc_ld, candidates[ i ].sr_msgid,
- 0, &tv, &res );
+ LDAP_MSG_ONE, &tv, &res );
if ( rc == 0 ) {
/* FIXME: res should not need to be freed */
rc = ldap_bind_s( ld, manager, passwd, LDAP_AUTH_SIMPLE );
if ( rc != LDAP_SUCCESS ) {
ldap_perror( ld, "ldap_bind" );
+ ldap_unbind_ext( ld, NULL, NULL );
switch ( rc ) {
case LDAP_BUSY:
case LDAP_UNAVAILABLE:
filter, attrs, 0, &res );
if ( rc != LDAP_SUCCESS ) {
ldap_perror( ld, "ldap_search" );
+ ldap_unbind_ext( ld, NULL, NULL );
if ( rc == LDAP_BUSY && do_retry > 0 ) {
do_retry--;
goto retry;
fprintf( stderr, " PID=%ld - Search done (%d).\n", (long) pid, rc );
- ldap_unbind( ld );
+ ldap_unbind_ext( ld, NULL, NULL );
}