]> git.sur5r.net Git - openldap/commitdiff
Pth support, +oc, modules, and value find init
authorKurt Zeilenga <kurt@openldap.org>
Sun, 22 Sep 2002 18:34:53 +0000 (18:34 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Sun, 22 Sep 2002 18:34:53 +0000 (18:34 +0000)
servers/slapd/ad.c
servers/slapd/daemon.c
servers/slapd/tools/slapcommon.c
servers/slapd/value.c

index 89cf5ab1eac9682fcc67050e9539fb9024e7e5e1..f7fa76241b870f1b1597dbf05010459935852814 100644 (file)
@@ -434,27 +434,38 @@ int ad_inlist(
                int rc;
                
                if ( attrs->an_desc ) {
-                       if ( is_ad_subtype( desc, attrs->an_desc ))
+                       if ( desc == attrs->an_desc ) {
                                return 1;
+                       }
+
+                       /*
+                        * EXTENSION: if requested description is preceeded by an
+                        * a '-' character, do not match on subtypes.
+                        */
+                       if ( attrs->an_name.bv_val[0] != '-' &&
+                               is_ad_subtype( desc, attrs->an_desc ))
+                       {
+                               return 1;
+                       }
+
                        continue;
                }
 
                /*
-                * EXTENSION: see if requested description is an object class
+                * EXTENSION: see if requested description is +objectClass
                 * if so, return attributes which the class requires/allows
                 */
                oc = attrs->an_oc;
                if( oc == NULL && attrs->an_name.bv_val ) {
                        switch( attrs->an_name.bv_val[0] ) {
-                               case '+':
-                               case '-': {
+                       case '+': { /* new way */
                                        struct berval ocname;
                                        ocname.bv_len = attrs->an_name.bv_len - 1;
                                        ocname.bv_val = &attrs->an_name.bv_val[1];
                                        oc = oc_bvfind( &ocname );
                                } break;
-                               default:
-                                       oc = oc_bvfind( &attrs->an_name );
+                       default: /* old (deprecated) way */
+                               oc = oc_bvfind( &attrs->an_name );
                        }
                        attrs->an_oc = oc;
                }
@@ -628,18 +639,46 @@ str2anlist( AttributeName *an, char *in, const char *brkstr )
                ber_str2bv(s, 0, 1, &anew->an_name);
                slap_bv2ad(&anew->an_name, &anew->an_desc, &text);
                if ( !anew->an_desc ) {
-                       anew->an_oc = oc_bvfind( &anew->an_name );
-                       if ( !anew->an_oc ) {
-                               free( an );
-                               /* overwrites input string on error! */
-                               strcpy( in, s );
-                               return NULL;
+                       switch( anew->an_name.bv_val[0] ) {
+                       case '-': {
+                                       struct berval adname;
+                                       adname.bv_len = anew->an_name.bv_len - 1;
+                                       adname.bv_val = &anew->an_name.bv_val[1];
+                                       slap_bv2ad(&adname, &anew->an_desc, &text);
+                                       if ( !anew->an_desc ) {
+                                               free( an );
+                                               /* overwrites input string on error! */
+                                               strcpy( in, s );
+                                               return NULL;
+                                       }
+                               } break;
+                       case '+': {
+                                       struct berval ocname;
+                                       ocname.bv_len = anew->an_name.bv_len - 1;
+                                       ocname.bv_val = &anew->an_name.bv_val[1];
+                                       anew->an_oc = oc_bvfind( &ocname );
+                                       if ( !anew->an_oc ) {
+                                               free( an );
+                                               /* overwrites input string on error! */
+                                               strcpy( in, s );
+                                               return NULL;
+                                       }
+                               } break;
+                       default:
+                               /* old (deprecated) way */
+                               anew->an_oc = oc_bvfind( &anew->an_name );
+                               if ( !anew->an_oc ) {
+                                       free( an );
+                                       /* overwrites input string on error! */
+                                       strcpy( in, s );
+                                       return NULL;
+                               }
                        }
                }
                anew++;
        }
-       anew->an_name.bv_val = NULL;
 
+       anew->an_name.bv_val = NULL;
        free( str );
        return( an );
 }
index 151b6d395bf7e0d37125859d9d238c7899f71cc8..94de3b729be2005a2f551732437bbecf899d152e 100644 (file)
@@ -49,7 +49,7 @@ Listener **slap_listeners = NULL;
 
 static ber_socket_t wake_sds[2];
 
-#ifdef NO_THREADS
+#if defined(NO_THREADS) || defined(HAVE_GNU_PTH)
 static int waking;
 #define WAKE_LISTENER(w) \
 ((w && !waking) ? tcp_write( wake_sds[1], "0", 1 ), waking=1 : 0)
@@ -1315,7 +1315,7 @@ slapd_daemon_task(
                if( FD_ISSET( wake_sds[0], &readfds ) ) {
                        char c[BUFSIZ];
                        tcp_read( wake_sds[0], c, sizeof(c) );
-#ifdef NO_THREADS
+#if defined(NO_THREADS) || defined(HAVE_GNU_PTH)
                        waking = 0;
 #endif
                        continue;
index 91f971106de7564da8ad0a5eeac0e94399ab1345..2004511a678686ba3d65a24c851042bde913aa5a 100644 (file)
@@ -286,6 +286,10 @@ void slap_tool_destroy( void )
        slap_shutdown( be );
        slap_destroy();
 #ifdef SLAPD_MODULES
+       if ( slapMode == SLAP_SERVER_MODE ) {
+       /* always false. just pulls in necessary symbol references. */
+               lutil_uuidstr(NULL, 0);
+       }
        module_kill();
 #endif
        schema_destroy();
index c53da1e9eba7f9a924d95b101d4bbadfe482cd92..b1288d07369ce3e7b24aaf0afc99196d40379cd0 100644 (file)
@@ -350,7 +350,7 @@ int value_find_ex(
        }
 
        if( mr->smr_syntax->ssyn_normalize ) {
-               struct berval nval_tmp;
+               struct berval nval_tmp = { 0, NULL };
 
                rc = mr->smr_syntax->ssyn_normalize(
                        mr->smr_syntax,