]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
Import changes from devel including:
authorKurt Zeilenga <kurt@openldap.org>
Wed, 13 Sep 2000 22:19:44 +0000 (22:19 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Wed, 13 Sep 2000 22:19:44 +0000 (22:19 +0000)
+       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

16 files changed:
CHANGES
clients/tools/ldapdelete.c
clients/tools/ldapmodify.c
clients/tools/ldapmodrdn.c
clients/tools/ldappasswd.c
clients/tools/ldapsearch.c
clients/ud/main.c
clients/ud/util.c
libraries/libldap/cyrus.c
libraries/libldap/os-ip.c
libraries/libldap_r/tpool.c
libraries/liblutil/signal.c
servers/slapd/acl.c
servers/slapd/back-ldbm/index.c
servers/slapd/back-ldbm/modify.c
servers/slapd/schema_init.c

diff --git a/CHANGES b/CHANGES
index 089cf2af4c78c62d20d2b2239969ff08131efc67..45f0fd9c698771d3b487af2833fc0707fa0f51af 100644 (file)
--- 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
index 80e15939b31b2f79ca892a2edc20f1b6274d5f48..7be56175c141577b5151736b21a20e31e4df005f 100644 (file)
@@ -501,20 +501,25 @@ main( int argc, char **argv )
                                ldaphost != NULL ? ldaphost : "<DEFAULT>",
                                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 : "<DEFAULT>" );
                }
-               (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;
+               }
        }
 
        {
index 690bff7e40d2bd1741517ed60becdd46647ec09f..ab484c7bfd37e28751e69cd000711a614c71b425 100644 (file)
@@ -568,20 +568,25 @@ main( int argc, char **argv )
                                ldaphost != NULL ? ldaphost : "<DEFAULT>",
                                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 : "<DEFAULT>" );
                }
-               (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 */
index 32ac8e05533c9c46c9e2ace84cb1bd9fa22845f8..16da3786c0f2577e1793b552aff335bb3e04613c 100644 (file)
@@ -544,20 +544,25 @@ main(int argc, char **argv)
                                ldaphost != NULL ? ldaphost : "<DEFAULT>",
                                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 : "<DEFAULT>" );
                }
-               (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 */
index 7928d4c05ce14c7911c750c52a216cb08b6613e7..cf49fa678a53c3bb4bb70f72df277f16c919d4d9 100644 (file)
@@ -558,20 +558,25 @@ main( int argc, char *argv[] )
                                ldaphost != NULL ? ldaphost : "<DEFAULT>",
                                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 : "<DEFAULT>" );
                }
-               (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 */
index 21d15ec528662ee16c7d9673e5754eae976978b0..0cbe9404644838f18fce3285450b6c06c8b3cb0f 100644 (file)
@@ -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 : "<DEFAULT>",
                                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 : "<DEFAULT>" );
                }
-               (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 &&
index aebf89c4dc83e8919d70e27f696cdd5fbe48b4be..4e2dac8adbbefb58fa8741e24e6b335256bb8333 100644 (file)
@@ -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 */
index 16253263a49f0f76b044808894363f169fe5e497..6505f52eccbefbab049ed94cb462b20518589690 100644 (file)
@@ -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;
index c63bc37da76f049480611d1ff6b3c7516aadf07b..058523f42e15a954a6222407c999b9850d7740c7 100644 (file)
@@ -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;
index 01c6d62f5615b98687c25baa6467f3aca477f7fd..371d8610dc53c072ed2a1cba606a672af9704abf 100644 (file)
@@ -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 )
index c99450c3207c9672dfa0189b358489e051a08cce..224cf695aa5acfbe3b20f9cebf3e8f1eea2cef4e 100644 (file)
@@ -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);
        }
index 64084c7edadc72bb6d912dc376b68ee7cf1f7048..4c2b513fd19285642f9e41a25482a9119b6eb6dc 100644 (file)
@@ -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 ) {
index b22ec970cf662dd24b9db1de21bcbabc748519ef..8079bdd15eddbf015d86a8c5fe23bf7b23d5f4f6 100644 (file)
@@ -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;
 
index 010ca61c6c69014444bf47ccd83aba200679f6eb..fda0e6861259927e32652efb7690fb520aa64d02 100644 (file)
@@ -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 );
        }
 
index 114dbb0c626f849137d27100f2097a70b19e60ef..07a5747b612e4aefabc09517c18f6d717a1e0dd6 100644 (file)
@@ -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 ) {
index ba74c3716f5d25a91df4296a4dfa5c1306f8050e..76ccab5c913e0fa90cfadfa4d3a7be2062794777 100644 (file)
@@ -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' )",