mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-02-17 14:00:30 +08:00
Check for not LDAP_OPT_SUCCESS instead of LDAP_OPT_ERROR.
This commit is contained in:
parent
61c5f7a2ca
commit
4dfba74846
@ -120,10 +120,10 @@ main( int argc, char **argv )
|
||||
}
|
||||
|
||||
if ( debug ) {
|
||||
if( ber_set_option( NULL, LBER_OPT_DEBUG_LEVEL, &debug ) != LBER_OPT_ERROR ) {
|
||||
if( ber_set_option( NULL, LBER_OPT_DEBUG_LEVEL, &debug ) != LBER_OPT_SUCCESS ) {
|
||||
fprintf( stderr, "Could not set LBER_OPT_DEBUG_LEVEL %d\n", debug );
|
||||
}
|
||||
if( ldap_set_option( NULL, LDAP_OPT_DEBUG_LEVEL, &debug ) != LDAP_OPT_ERROR ) {
|
||||
if( ldap_set_option( NULL, LDAP_OPT_DEBUG_LEVEL, &debug ) != LDAP_OPT_SUCCESS ) {
|
||||
fprintf( stderr, "Could not set LDAP_OPT_DEBUG_LEVEL %d\n", debug );
|
||||
}
|
||||
}
|
||||
@ -147,7 +147,7 @@ main( int argc, char **argv )
|
||||
passwd = getpass("Enter LDAP Password: ");
|
||||
|
||||
if (version != -1 &&
|
||||
ldap_set_option( ld, LDAP_OPT_PROTOCOL_VERSION, &version ) == LDAP_OPT_ERROR)
|
||||
ldap_set_option( ld, LDAP_OPT_PROTOCOL_VERSION, &version ) != LDAP_OPT_SUCCESS)
|
||||
{
|
||||
fprintf( stderr, "Could not set LDAP_OPT_PROTOCOL_VERSION %d\n", version );
|
||||
}
|
||||
|
@ -210,10 +210,10 @@ main( int argc, char **argv )
|
||||
}
|
||||
|
||||
if ( debug ) {
|
||||
if( ber_set_option( NULL, LBER_OPT_DEBUG_LEVEL, &debug ) != LBER_OPT_ERROR ) {
|
||||
if( ber_set_option( NULL, LBER_OPT_DEBUG_LEVEL, &debug ) != LBER_OPT_SUCCESS ) {
|
||||
fprintf( stderr, "Could not set LBER_OPT_DEBUG_LEVEL %d\n", debug );
|
||||
}
|
||||
if( ldap_set_option( NULL, LDAP_OPT_DEBUG_LEVEL, &debug ) != LDAP_OPT_ERROR ) {
|
||||
if( ldap_set_option( NULL, LDAP_OPT_DEBUG_LEVEL, &debug ) != LDAP_OPT_SUCCESS ) {
|
||||
fprintf( stderr, "Could not set LDAP_OPT_DEBUG_LEVEL %d\n", debug );
|
||||
}
|
||||
ldif_debug = debug;
|
||||
@ -239,7 +239,7 @@ main( int argc, char **argv )
|
||||
passwd = getpass("Enter LDAP Password: ");
|
||||
|
||||
if (version != -1 &&
|
||||
ldap_set_option( ld, LDAP_OPT_PROTOCOL_VERSION, &version ) == LDAP_OPT_ERROR)
|
||||
ldap_set_option( ld, LDAP_OPT_PROTOCOL_VERSION, &version ) != LDAP_OPT_SUCCESS)
|
||||
{
|
||||
fprintf( stderr, "Could not set LDAP_OPT_PROTOCOL_VERSION %d\n", version );
|
||||
}
|
||||
|
@ -173,10 +173,10 @@ main(int argc, char **argv)
|
||||
}
|
||||
|
||||
if ( debug ) {
|
||||
if( ber_set_option( NULL, LBER_OPT_DEBUG_LEVEL, &debug ) != LBER_OPT_ERROR ) {
|
||||
if( ber_set_option( NULL, LBER_OPT_DEBUG_LEVEL, &debug ) != LBER_OPT_SUCCESS ) {
|
||||
fprintf( stderr, "Could not set LBER_OPT_DEBUG_LEVEL %d\n", debug );
|
||||
}
|
||||
if( ldap_set_option( NULL, LDAP_OPT_DEBUG_LEVEL, &debug ) != LDAP_OPT_ERROR ) {
|
||||
if( ldap_set_option( NULL, LDAP_OPT_DEBUG_LEVEL, &debug ) != LDAP_OPT_SUCCESS ) {
|
||||
fprintf( stderr, "Could not set LDAP_OPT_DEBUG_LEVEL %d\n", debug );
|
||||
}
|
||||
}
|
||||
@ -200,7 +200,7 @@ main(int argc, char **argv)
|
||||
passwd = getpass("Enter LDAP Password: ");
|
||||
|
||||
if (version != -1 &&
|
||||
ldap_set_option( ld, LDAP_OPT_PROTOCOL_VERSION, &version ) == LDAP_OPT_ERROR)
|
||||
ldap_set_option( ld, LDAP_OPT_PROTOCOL_VERSION, &version ) != LDAP_OPT_SUCCESS)
|
||||
{
|
||||
fprintf( stderr, "Could not set LDAP_OPT_PROTOCOL_VERSION %d\n", version );
|
||||
}
|
||||
|
@ -561,10 +561,10 @@ main (int argc, char *argv[])
|
||||
}
|
||||
|
||||
if ( debug ) {
|
||||
if( ber_set_option( NULL, LBER_OPT_DEBUG_LEVEL, &debug ) != LBER_OPT_ERROR ) {
|
||||
if( ber_set_option( NULL, LBER_OPT_DEBUG_LEVEL, &debug ) != LBER_OPT_SUCCESS ) {
|
||||
fprintf( stderr, "Could not set LBER_OPT_DEBUG_LEVEL %d\n", debug );
|
||||
}
|
||||
if( ldap_set_option( NULL, LDAP_OPT_DEBUG_LEVEL, &debug ) != LDAP_OPT_ERROR ) {
|
||||
if( ldap_set_option( NULL, LDAP_OPT_DEBUG_LEVEL, &debug ) != LDAP_OPT_SUCCESS ) {
|
||||
fprintf( stderr, "Could not set LDAP_OPT_DEBUG_LEVEL %d\n", debug );
|
||||
}
|
||||
}
|
||||
@ -597,12 +597,12 @@ main (int argc, char *argv[])
|
||||
|
||||
/* set options */
|
||||
if (timelimit != -1 &&
|
||||
ldap_set_option( ld, LDAP_OPT_TIMELIMIT, (void *) &timelimit ) == LDAP_OPT_ERROR )
|
||||
ldap_set_option( ld, LDAP_OPT_TIMELIMIT, (void *) &timelimit ) != LDAP_OPT_SUCCESS )
|
||||
{
|
||||
fprintf( stderr, "Could not set LDAP_OPT_TIMELIMIT %d\n", timelimit );
|
||||
}
|
||||
if (sizelimit != -1 &&
|
||||
ldap_set_option( ld, LDAP_OPT_SIZELIMIT, (void *) &sizelimit ) == LDAP_OPT_ERROR )
|
||||
ldap_set_option( ld, LDAP_OPT_SIZELIMIT, (void *) &sizelimit ) != LDAP_OPT_SUCCESS )
|
||||
{
|
||||
fprintf( stderr, "Could not set LDAP_OPT_SIZELIMIT %d\n", sizelimit );
|
||||
}
|
||||
@ -614,7 +614,7 @@ main (int argc, char *argv[])
|
||||
}
|
||||
|
||||
if (version != -1 &&
|
||||
ldap_set_option( ld, LDAP_OPT_PROTOCOL_VERSION, &version ) == LDAP_OPT_ERROR)
|
||||
ldap_set_option( ld, LDAP_OPT_PROTOCOL_VERSION, &version ) != LDAP_OPT_SUCCESS )
|
||||
{
|
||||
fprintf( stderr, "Could not set LDAP_OPT_PROTOCOL_VERSION %d\n", version );
|
||||
}
|
||||
|
@ -259,10 +259,10 @@ main( int argc, char **argv )
|
||||
}
|
||||
|
||||
if ( debug ) {
|
||||
if( ber_set_option( NULL, LBER_OPT_DEBUG_LEVEL, &debug ) != LBER_OPT_ERROR ) {
|
||||
if( ber_set_option( NULL, LBER_OPT_DEBUG_LEVEL, &debug ) != LBER_OPT_SUCCESS ) {
|
||||
fprintf( stderr, "Could not set LBER_OPT_DEBUG_LEVEL %d\n", debug );
|
||||
}
|
||||
if( ldap_set_option( NULL, LDAP_OPT_DEBUG_LEVEL, &debug ) != LDAP_OPT_ERROR ) {
|
||||
if( ldap_set_option( NULL, LDAP_OPT_DEBUG_LEVEL, &debug ) != LDAP_OPT_SUCCESS ) {
|
||||
fprintf( stderr, "Could not set LDAP_OPT_DEBUG_LEVEL %d\n", debug );
|
||||
}
|
||||
ldif_debug = debug;
|
||||
@ -284,30 +284,30 @@ main( int argc, char **argv )
|
||||
}
|
||||
|
||||
if (deref != -1 &&
|
||||
ldap_set_option( ld, LDAP_OPT_DEREF, (void *) &deref ) == LDAP_OPT_ERROR )
|
||||
ldap_set_option( ld, LDAP_OPT_DEREF, (void *) &deref ) != LDAP_OPT_SUCCESS )
|
||||
{
|
||||
fprintf( stderr, "Could not set LDAP_OPT_DEREF %d\n", deref );
|
||||
}
|
||||
if (timelimit != -1 &&
|
||||
ldap_set_option( ld, LDAP_OPT_TIMELIMIT, (void *) &timelimit ) == LDAP_OPT_ERROR )
|
||||
ldap_set_option( ld, LDAP_OPT_TIMELIMIT, (void *) &timelimit ) != LDAP_OPT_SUCCESS )
|
||||
{
|
||||
fprintf( stderr, "Could not set LDAP_OPT_TIMELIMIT %d\n", timelimit );
|
||||
}
|
||||
if (sizelimit != -1 &&
|
||||
ldap_set_option( ld, LDAP_OPT_SIZELIMIT, (void *) &sizelimit ) == LDAP_OPT_ERROR )
|
||||
ldap_set_option( ld, LDAP_OPT_SIZELIMIT, (void *) &sizelimit ) != LDAP_OPT_SUCCESS )
|
||||
{
|
||||
fprintf( stderr, "Could not set LDAP_OPT_SIZELIMIT %d\n", sizelimit );
|
||||
}
|
||||
if (referrals != -1 &&
|
||||
ldap_set_option( ld, LDAP_OPT_REFERRALS,
|
||||
(referrals ? LDAP_OPT_ON : LDAP_OPT_OFF) ) == LDAP_OPT_ERROR )
|
||||
(referrals ? LDAP_OPT_ON : LDAP_OPT_OFF) ) != LDAP_OPT_SUCCESS )
|
||||
{
|
||||
fprintf( stderr, "Could not set LDAP_OPT_REFERRALS %s\n",
|
||||
referrals ? "on" : "off" );
|
||||
}
|
||||
|
||||
if (version != -1 &&
|
||||
ldap_set_option( ld, LDAP_OPT_PROTOCOL_VERSION, &version ) == LDAP_OPT_ERROR)
|
||||
ldap_set_option( ld, LDAP_OPT_PROTOCOL_VERSION, &version ) != LDAP_OPT_SUCCESS )
|
||||
{
|
||||
fprintf( stderr, "Could not set LDAP_OPT_PROTOCOL_VERSION %d\n", version );
|
||||
}
|
||||
|
@ -556,8 +556,8 @@ initialize_client( void )
|
||||
#endif
|
||||
|
||||
if (ldebug) {
|
||||
ber_set_option(NULL, LBER_OPT_DEBUG_LEVEL, &ldebug);
|
||||
ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, &ldebug);
|
||||
ber_set_option( NULL, LBER_OPT_DEBUG_LEVEL, &ldebug );
|
||||
ldap_set_option( NULL, LDAP_OPT_DEBUG_LEVEL, &ldebug );
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user