From: Kurt Zeilenga Date: Wed, 13 Sep 2000 22:19:44 +0000 (+0000) Subject: Import changes from devel including: X-Git-Tag: OPENLDAP_REL_ENG_2_0_2~3 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0cec5419077794043379fdab841c77abe553bfba;p=openldap Import changes from devel including: + Fixed -lldap SASL got_max_ssf bug + Fixed -lldap TCP_NODELAY bug + Fixed -llutil sa_flags never set bug + Removed lint plus clients/tools ldap_init() fixes -lldap SASL fixes binary syntax ";binary" transfer change --- diff --git a/CHANGES b/CHANGES index 089cf2af4c..45f0fd9c69 100644 --- a/CHANGES +++ b/CHANGES @@ -3,8 +3,11 @@ OpenLDAP 2.0 Change Log OpenLDAP 2.0.X Engineering Fixed KBIND (ITS#717) Fixed clients/tools -R handling (ITS#726) + Fixed -lldap SASL got_max_ssf bug + Fixed -lldap TCP_NODELAY bug Fixed -lldap TLS issues (ITS#733) Fixed -lldap_r NT threads (ITS#732) + Fixed -llutil sa_flags never set bug Fixed ldappasswd -A -S crash (ITS#714) Fixed ldappasswd user argument usage Fixed slapd disallow bind_anon (ITS#721) @@ -19,6 +22,7 @@ OpenLDAP 2.0.X Engineering Added slapd syntax/mr routines Added slapd allow/disallow options Added slapd defaultSearchBase and DN verify (ITS#723) + Removed lint Build Environment Added test000-rootdse Added Corba & Java Schema diff --git a/clients/tools/ldapdelete.c b/clients/tools/ldapdelete.c index 80e15939b3..7be56175c1 100644 --- a/clients/tools/ldapdelete.c +++ b/clients/tools/ldapdelete.c @@ -501,20 +501,25 @@ main( int argc, char **argv ) ldaphost != NULL ? ldaphost : "", ldapport ); } + ld = ldap_init( ldaphost, ldapport ); + if( ld == NULL ) { + perror("ldapsearch: ldap_init"); + return EXIT_FAILURE; + } } else { if ( verbose ) { fprintf( stderr, "ldap_initialize( %s )\n", ldapuri != NULL ? ldapuri : "" ); } - (void) ldap_initialize( &ld, ldapuri ); - } - if( ld == NULL ) { - fprintf( stderr, "Could not create LDAP session handle (%d): %s\n", - rc, ldap_err2string(rc) ); - return EXIT_FAILURE; + rc = ldap_initialize( &ld, ldapuri ); + if( rc != LDAP_SUCCESS ) { + fprintf( stderr, "Could not create LDAP session handle (%d): %s\n", + rc, ldap_err2string(rc) ); + return EXIT_FAILURE; + } } { diff --git a/clients/tools/ldapmodify.c b/clients/tools/ldapmodify.c index 690bff7e40..ab484c7bfd 100644 --- a/clients/tools/ldapmodify.c +++ b/clients/tools/ldapmodify.c @@ -568,20 +568,25 @@ main( int argc, char **argv ) ldaphost != NULL ? ldaphost : "", ldapport ); } + ld = ldap_init( ldaphost, ldapport ); + if( ld == NULL ) { + perror("ldapsearch: ldap_init"); + return EXIT_FAILURE; + } } else { if ( verbose ) { fprintf( stderr, "ldap_initialize( %s )\n", ldapuri != NULL ? ldapuri : "" ); } - (void) ldap_initialize( &ld, ldapuri ); - } - if( ld == NULL ) { - fprintf( stderr, "Could not create LDAP session handle (%d): %s\n", - rc, ldap_err2string(rc) ); - return EXIT_FAILURE; + rc = ldap_initialize( &ld, ldapuri ); + if( rc != LDAP_SUCCESS ) { + fprintf( stderr, "Could not create LDAP session handle (%d): %s\n", + rc, ldap_err2string(rc) ); + return EXIT_FAILURE; + } } /* referrals */ diff --git a/clients/tools/ldapmodrdn.c b/clients/tools/ldapmodrdn.c index 32ac8e0553..16da3786c0 100644 --- a/clients/tools/ldapmodrdn.c +++ b/clients/tools/ldapmodrdn.c @@ -544,20 +544,25 @@ main(int argc, char **argv) ldaphost != NULL ? ldaphost : "", ldapport ); } + ld = ldap_init( ldaphost, ldapport ); + if( ld == NULL ) { + perror("ldapsearch: ldap_init"); + return EXIT_FAILURE; + } } else { if ( verbose ) { fprintf( stderr, "ldap_initialize( %s )\n", ldapuri != NULL ? ldapuri : "" ); } - (void) ldap_initialize( &ld, ldapuri ); - } - if( ld == NULL ) { - fprintf( stderr, "Could not create LDAP session handle (%d): %s\n", - rc, ldap_err2string(rc) ); - return EXIT_FAILURE; + rc = ldap_initialize( &ld, ldapuri ); + if( rc != LDAP_SUCCESS ) { + fprintf( stderr, "Could not create LDAP session handle (%d): %s\n", + rc, ldap_err2string(rc) ); + return EXIT_FAILURE; + } } /* referrals */ diff --git a/clients/tools/ldappasswd.c b/clients/tools/ldappasswd.c index 7928d4c05c..cf49fa678a 100644 --- a/clients/tools/ldappasswd.c +++ b/clients/tools/ldappasswd.c @@ -558,20 +558,25 @@ main( int argc, char *argv[] ) ldaphost != NULL ? ldaphost : "", ldapport ); } + ld = ldap_init( ldaphost, ldapport ); + if( ld == NULL ) { + perror("ldapsearch: ldap_init"); + return EXIT_FAILURE; + } } else { if ( verbose ) { fprintf( stderr, "ldap_initialize( %s )\n", ldapuri != NULL ? ldapuri : "" ); } - (void) ldap_initialize( &ld, ldapuri ); - } - if( ld == NULL ) { - fprintf( stderr, "Could not create LDAP session handle (%d): %s\n", - rc, ldap_err2string(rc) ); - return EXIT_FAILURE; + rc = ldap_initialize( &ld, ldapuri ); + if( rc != LDAP_SUCCESS ) { + fprintf( stderr, "Could not create LDAP session handle (%d): %s\n", + rc, ldap_err2string(rc) ); + return EXIT_FAILURE; + } } /* referrals */ diff --git a/clients/tools/ldapsearch.c b/clients/tools/ldapsearch.c index 21d15ec528..0cbe940464 100644 --- a/clients/tools/ldapsearch.c +++ b/clients/tools/ldapsearch.c @@ -663,27 +663,31 @@ main( int argc, char **argv ) (void) SIGNAL( SIGPIPE, SIG_IGN ); #endif - if( ( ldaphost != NULL || ldapport ) && ( ldapuri == NULL ) ) { if ( verbose ) { fprintf( stderr, "ldap_init( %s, %d )\n", ldaphost != NULL ? ldaphost : "", ldapport ); } + ld = ldap_init( ldaphost, ldapport ); + if( ld == NULL ) { + perror("ldapsearch: ldap_init"); + return EXIT_FAILURE; + } } else { if ( verbose ) { fprintf( stderr, "ldap_initialize( %s )\n", ldapuri != NULL ? ldapuri : "" ); } - (void) ldap_initialize( &ld, ldapuri ); - } - if( ld == NULL ) { - fprintf( stderr, "Could not create LDAP session handle (%d): %s\n", - rc, ldap_err2string(rc) ); - return EXIT_FAILURE; + rc = ldap_initialize( &ld, ldapuri ); + if( rc != LDAP_SUCCESS ) { + fprintf( stderr, "Could not create LDAP session handle (%d): %s\n", + rc, ldap_err2string(rc) ); + return EXIT_FAILURE; + } } if (deref != -1 && diff --git a/clients/ud/main.c b/clients/ud/main.c index aebf89c4dc..4e2dac8adb 100644 --- a/clients/ud/main.c +++ b/clients/ud/main.c @@ -331,7 +331,7 @@ change_base( int type, char **base, char *s ) { register char *cp; /* utility pointers */ char **rdns; /* for parsing */ - char *output_string; /* for nice output */ + char *output_string = NULL; /* for nice output */ int num_picked; /* # of selected base */ int j; /* used with num_picked */ int i = 1; /* index into choices array */ diff --git a/clients/ud/util.c b/clients/ud/util.c index 16253263a4..6505f52ecc 100644 --- a/clients/ud/util.c +++ b/clients/ud/util.c @@ -44,6 +44,10 @@ printbase( char *lead, char *s ) if (debug & D_TRACE) printf("->printbase(%s, %s)\n", lead, s); #endif + if (lead == NULL) { + printf("root"); + return; + } if (s == NULL) { printf("%sroot\n", lead); return; diff --git a/libraries/libldap/cyrus.c b/libraries/libldap/cyrus.c index c63bc37da7..058523f42e 100644 --- a/libraries/libldap/cyrus.c +++ b/libraries/libldap/cyrus.c @@ -697,7 +697,7 @@ int ldap_pvt_sasl_secprops( "minssf=", sizeof("minssf")) ) { if( isdigit( props[i][sizeof("minssf")] ) ) { - got_max_ssf++; + got_min_ssf++; min_ssf = atoi( &props[i][sizeof("minssf")] ); } else { return LDAP_NOT_SUPPORTED; diff --git a/libraries/libldap/os-ip.c b/libraries/libldap/os-ip.c index 01c6d62f56..371d8610dc 100644 --- a/libraries/libldap/os-ip.c +++ b/libraries/libldap/os-ip.c @@ -115,7 +115,7 @@ ldap_int_prepare_socket(LDAP *ld, int s, int proto ) osip_debug(ld, "ldap_prepare_socket: %d\n", s,0,0); #ifdef TCP_NODELAY - if( proto = LDAP_PROTO_TCP ) { + if( proto == LDAP_PROTO_TCP ) { int dummy = 1; if ( setsockopt( s, IPPROTO_TCP, TCP_NODELAY, (char*) &dummy, sizeof(dummy) ) == AC_SOCKET_ERROR ) diff --git a/libraries/libldap_r/tpool.c b/libraries/libldap_r/tpool.c index c99450c320..224cf695aa 100644 --- a/libraries/libldap_r/tpool.c +++ b/libraries/libldap_r/tpool.c @@ -120,7 +120,7 @@ ldap_pvt_thread_pool_init ( * but ltp_open_count == 1, so two things happen: * 1) the first client connection fails, and 2) when * slapd is kill'ed, it never terminates since it waits - * for all worker threads to exit. + * for all worker threads to exit. */ /* start up one thread, just so there is one. no need to * lock the mutex right now, since no threads are running. @@ -315,8 +315,8 @@ ldap_pvt_thread_pool_destroy ( ldap_pvt_thread_pool_t *tpool, int run_pending ) ldap_pvt_thread_mutex_unlock(&pool->ltp_mutex); } while (waiting > 0); - while (ctx = (ldap_int_thread_ctx_t *)ldap_int_thread_delist( - &pool->ltp_pending_list, NULL)) + while ((ctx = (ldap_int_thread_ctx_t *)ldap_int_thread_delist( + &pool->ltp_pending_list, NULL)) != NULL) { free(ctx); } diff --git a/libraries/liblutil/signal.c b/libraries/liblutil/signal.c index 64084c7eda..4c2b513fd1 100644 --- a/libraries/liblutil/signal.c +++ b/libraries/liblutil/signal.c @@ -22,7 +22,7 @@ lutil_sigaction(int sig, lutil_sig_t func) action.sa_handler = func; sigemptyset( &action.sa_mask ); #ifdef SA_RESTART - action.sa_flags != SA_RESTART; + action.sa_flags |= SA_RESTART; #endif if( sigaction( sig, &action, &oaction ) != 0 ) { diff --git a/servers/slapd/acl.c b/servers/slapd/acl.c index b22ec970cf..8079bdd15e 100644 --- a/servers/slapd/acl.c +++ b/servers/slapd/acl.c @@ -154,7 +154,7 @@ access_allowed( a = NULL; count = 0; - while( a = acl_get( a, &count, be, op, e, desc, MAXREMATCHES, matches ) ) + while((a = acl_get( a, &count, be, op, e, desc, MAXREMATCHES, matches )) != NULL) { int i; diff --git a/servers/slapd/back-ldbm/index.c b/servers/slapd/back-ldbm/index.c index 010ca61c6c..fda0e68612 100644 --- a/servers/slapd/back-ldbm/index.c +++ b/servers/slapd/back-ldbm/index.c @@ -15,7 +15,7 @@ #include "slap.h" #include "back-ldbm.h" -static index_mask( +static slap_mask_t index_mask( Backend *be, AttributeDescription *desc, char **dbname, @@ -325,7 +325,7 @@ index_entry( /* add each attribute to the indexes */ - for ( ap; ap != NULL; ap = ap->a_next ) { + for ( ; ap != NULL; ap = ap->a_next ) { index_values( be, ap->a_desc, ap->a_vals, e->e_id, op ); } diff --git a/servers/slapd/back-ldbm/modify.c b/servers/slapd/back-ldbm/modify.c index 114dbb0c62..07a5747b61 100644 --- a/servers/slapd/back-ldbm/modify.c +++ b/servers/slapd/back-ldbm/modify.c @@ -61,7 +61,7 @@ int ldbm_modify_internal( if( err != LDAP_SUCCESS ) { Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: %d %s\n", - err, text, 0); + err, *text, 0); *text = "modify: add values failed"; } break; @@ -72,7 +72,7 @@ int ldbm_modify_internal( assert( err != LDAP_TYPE_OR_VALUE_EXISTS ); if( err != LDAP_SUCCESS ) { Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: %d %s\n", - err, text, 0); + err, *text, 0); *text = "modify: delete values failed"; } break; @@ -83,7 +83,7 @@ int ldbm_modify_internal( assert( err != LDAP_TYPE_OR_VALUE_EXISTS ); if( err != LDAP_SUCCESS ) { Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: %d %s\n", - err, text, 0); + err, *text, 0); *text = "modify: replace values failed"; } break; @@ -102,7 +102,7 @@ int ldbm_modify_internal( if( err != LDAP_SUCCESS ) { Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: %d %s\n", - err, text, 0); + err, *text, 0); *text = "modify: (soft)add values failed"; } break; @@ -113,7 +113,7 @@ int ldbm_modify_internal( *text = "Invalid modify operation"; err = LDAP_OTHER; Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: %d %s\n", - err, text, 0); + err, *text, 0); } if ( err != LDAP_SUCCESS ) { diff --git a/servers/slapd/schema_init.c b/servers/slapd/schema_init.c index ba74c3716f..76ccab5c91 100644 --- a/servers/slapd/schema_init.c +++ b/servers/slapd/schema_init.c @@ -25,9 +25,6 @@ #define phoneNumberNormalize numericStringNormalize #define telexNumberNormalize numericStringNormalize -/* unimplemented normalizers */ -#define bitStringNormalize NULL - /* unimplemented pretters */ #define dnPretty NULL #define integerPretty NULL @@ -3649,7 +3646,7 @@ struct syntax_defs_rec syntax_defs[] = { {"( 1.3.6.1.4.1.1466.115.121.1.4 DESC 'Audio' " X_NOT_H_R ")", SLAP_SYNTAX_BLOB, blobValidate, NULL, NULL}, {"( 1.3.6.1.4.1.1466.115.121.1.5 DESC 'Binary' " X_BINARY X_NOT_H_R ")", - SLAP_SYNTAX_BER, berValidate, NULL, NULL}, + SLAP_SYNTAX_BINARY|SLAP_SYNTAX_BER, berValidate, NULL, NULL}, {"( 1.3.6.1.4.1.1466.115.121.1.6 DESC 'Bit String' )", 0, bitStringValidate, NULL, NULL }, {"( 1.3.6.1.4.1.1466.115.121.1.7 DESC 'Boolean' )",