]> git.sur5r.net Git - openldap/commitdiff
Sync with HEAD
authorKurt Zeilenga <kurt@openldap.org>
Mon, 12 Aug 2002 17:09:39 +0000 (17:09 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Mon, 12 Aug 2002 17:09:39 +0000 (17:09 +0000)
servers/slapd/back-ldap/search.c
servers/slapd/back-meta/search.c

index 146abc336bd360be1d38de6c77609d16f897ea8f..45c5bd43df769e5a8e8009198d42e093eeabe27e 100644 (file)
@@ -406,7 +406,17 @@ ldap_send_entry(
        ldap_back_dn_massage( li, &bdn, &ent.e_name, 0, 0 );
 #endif /* !ENABLE_REWRITE */
 
-       dnNormalize2( NULL, &ent.e_name, &ent.e_nname );
+       /*
+        * Note: this may fail if the target host(s) schema differs
+        * from the one known to the meta, and a DN with unknown
+        * attributes is returned.
+        * 
+        * FIXME: should we log anything, or delegate to dnNormalize2?
+        */
+       if ( dnNormalize2( NULL, &ent.e_name, &ent.e_nname ) != LDAP_SUCCESS ) {
+               return;
+       }
+       
        ent.e_id = 0;
        ent.e_attrs = 0;
        ent.e_private = 0;
index 7d8fc6b7f806136ccd7c24da28b66d95d350cd7e..a670ef415cf8720605cbd65761c7cc7684b7ad97 100644 (file)
@@ -117,7 +117,7 @@ meta_back_search(
        struct metainfo *li = ( struct metainfo * )be->be_private;
        struct metaconn *lc;
        struct metasingleconn *lsc;
-       struct timeval  tv;
+       struct timeval  tv = { 0, 0 };
        LDAPMessage     *res, *e;
        int     count, rc = 0, *msgid, sres = LDAP_NO_SUCH_OBJECT;
        char *match = NULL, *err = NULL;
@@ -467,11 +467,13 @@ meta_back_search(
 
 #ifdef NEW_LOGGING
                                LDAP_LOG( BACK_META, ERR,
-                                       "meta_back_search [%d] match=\"%s\" err=\"%s\"\n",
+                                       "meta_back_search [%d] "
+                                       "match=\"%s\" err=\"%s\"\n",
                                        i, match, err );
 #else /* !NEW_LOGGING */
                                Debug( LDAP_DEBUG_ANY,
-       "=>meta_back_search [%d] match=\"%s\" err=\"%s\"\n",
+                                       "=>meta_back_search [%d] "
+                                       "match=\"%s\" err=\"%s\"\n",
                                        i, match, err );        
 #endif /* !NEW_LOGGING */
                                
@@ -561,9 +563,9 @@ finish:;
        }
        
        if ( msgid ) {
-               free( msgid );
+               ch_free( msgid );
        }
-       
+
        return rc;
 }
 
@@ -618,7 +620,16 @@ meta_send_entry(
                return;
        }
 
-       dnNormalize2( NULL, &ent.e_name, &ent.e_nname );
+       /*
+        * Note: this may fail if the target host(s) schema differs
+        * from the one known to the meta, and a DN with unknown
+        * attributes is returned.
+        * 
+        * FIXME: should we log anything, or delegate to dnNormalize2?
+        */
+       if ( dnNormalize2( NULL, &ent.e_name, &ent.e_nname ) != LDAP_SUCCESS ) {
+               return;
+       }
 
        /*
         * cache dn