]> git.sur5r.net Git - openldap/commitdiff
use slap_str2undef_ad for unknown attributes
authorPierangelo Masarati <ando@openldap.org>
Wed, 3 Oct 2001 18:17:08 +0000 (18:17 +0000)
committerPierangelo Masarati <ando@openldap.org>
Wed, 3 Oct 2001 18:17:08 +0000 (18:17 +0000)
servers/slapd/back-ldap/search.c
servers/slapd/back-meta/search.c

index 629155c45ade0dea7e0c57a17f992c443b3b910d..fa35d582e5e804d2e8e3997113def4bee34d44c2 100644 (file)
@@ -435,8 +435,21 @@ ldap_send_entry(
                attr->a_next = 0;
                attr->a_desc = NULL;
                if (slap_str2ad(mapped, &attr->a_desc, &text) != LDAP_SUCCESS) {
-                       ch_free(attr);
-                       continue;
+                       if (slap_str2undef_ad(mapped, &attr->a_desc, &text) 
+                                       != LDAP_SUCCESS) {
+#ifdef NEW_LOGGING
+                               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
+                                               "slap_str2undef_ad(%s): "
+                                               "%s\n", mapped, text ));
+#else /* !NEW_LOGGING */
+                               Debug( LDAP_DEBUG_ANY, 
+                                               "slap_str2undef_ad(%s): "
+                                               "%s\n%s", mapped, text, "" );
+#endif /* !NEW_LOGGING */
+                               
+                               ch_free(attr);
+                               continue;
+                       }
                }
                attr->a_vals = ldap_get_values_len(lc->ld, e, a);
                if (!attr->a_vals) {
index f861fb6499a6ca4a0a56d94e21a270bcf3aac1c2..c033f66d8bb51ea55ede8bd01906bc0b7926b02d 100644 (file)
@@ -652,8 +652,20 @@ meta_send_entry(
                attr->a_desc = NULL;
                if ( slap_str2ad( mapped, &attr->a_desc, &text )
                                != LDAP_SUCCESS) {
-                       ch_free( attr );
-                       continue;
+                       if (slap_str2undef_ad(mapped, &attr->a_desc, &text) 
+                                       != LDAP_SUCCESS) {
+#ifdef NEW_LOGGING
+                               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
+                                               "slap_str2undef_ad(%s): "
+                                               "%s\n", mapped, text ));
+#else /* !NEW_LOGGING */
+                               Debug( LDAP_DEBUG_ANY,
+                                               "slap_str2undef_ad(%s): "
+                                               "%s\n%s", mapped, text, "" );
+#endif /* !NEW_LOGGING */
+                               ch_free(attr);
+                               continue;
+                       }
                }
                attr->a_vals = ldap_get_values_len( lsc->ld, e, a );
                if ( !attr->a_vals ) {