1 /* result.c - routines to send ldap results, errors, and referrals */
4 * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
5 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
12 #include <ac/socket.h>
14 #include <ac/signal.h>
15 #include <ac/string.h>
18 #include <ac/unistd.h>
22 static char *v2ref( struct berval **ref, const char *text )
24 size_t len = 0, i = 0;
30 return ch_strdup(text);
37 if (text[len-1] != '\n')
40 v2 = ch_malloc( len+i+sizeof("Referral:") );
46 strcpy( v2+len, "Referral:" );
47 len += sizeof("Referral:");
49 for( i=0; ref[i] != NULL; i++ ) {
50 v2 = ch_realloc( v2, len + ref[i]->bv_len + 1 );
52 memcpy(&v2[len], ref[i]->bv_val, ref[i]->bv_len );
53 len += ref[i]->bv_len;
54 if (ref[i]->bv_val[ref[i]->bv_len-1] != '/')
62 static ber_tag_t req2res( ber_tag_t tag )
67 case LDAP_REQ_COMPARE:
68 case LDAP_REQ_EXTENDED:
75 tag = LDAP_RES_DELETE;
78 case LDAP_REQ_ABANDON:
84 tag = LDAP_RES_SEARCH_RESULT;
94 static void trim_refs_urls(
95 struct berval **refs )
99 if( refs == NULL ) return;
101 for( i=0; refs[i] != NULL; i++ ) {
102 if( refs[i]->bv_len > sizeof("ldap://")-1 &&
103 strncasecmp( refs[i]->bv_val, "ldap://",
104 sizeof("ldap://")-1 ) == 0 )
107 for( j=sizeof("ldap://")-1; j<refs[i]->bv_len ; j++ ) {
108 if( refs[i]->bv_val[j] == '/' ) {
109 refs[i]->bv_val[j] = '\0';
118 struct berval **get_entry_referrals(
125 struct berval **refs;
128 #ifdef SLAPD_SCHEMA_NOT_COMPAT
129 AttributeDescription *ad_ref = slap_schema.si_ad_ref;
131 static const char *ad_ref = "ref";
134 attr = attr_find( e->e_attrs, ad_ref );
136 if( attr == NULL ) return NULL;
138 for( i=0; attr->a_vals[i] != NULL; i++ ) {
139 /* count references */
142 if( i < 1 ) return NULL;
144 refs = ch_malloc( (i + 1) * sizeof(struct berval *));
146 for( i=0, j=0; attr->a_vals[i] != NULL; i++ ) {
148 struct berval *ref = ber_bvdup( attr->a_vals[i] );
151 for( k=0; k<ref->bv_len; k++ ) {
152 if( isspace(ref->bv_val[k]) ) {
153 ref->bv_val[k] = '\0';
159 if( ref->bv_len > 0 ) {
170 ber_bvecfree( refs );
174 /* we should check that a referral value exists... */
179 static long send_ldap_ber(
185 ber_get_option( ber, LBER_OPT_BER_BYTES_TO_WRITE, &bytes );
187 /* write only one pdu at a time - wait til it's our turn */
188 ldap_pvt_thread_mutex_lock( &conn->c_write_mutex );
190 /* lock the connection */
191 ldap_pvt_thread_mutex_lock( &conn->c_mutex );
198 if ( connection_state_closing( conn ) ) {
199 ldap_pvt_thread_mutex_unlock( &conn->c_mutex );
200 ldap_pvt_thread_mutex_unlock( &conn->c_write_mutex );
205 if ( ber_flush( conn->c_sb, ber, 0 ) == 0 ) {
212 * we got an error. if it's ewouldblock, we need to
213 * wait on the socket being writable. otherwise, figure
214 * it's a hard error and return.
217 Debug( LDAP_DEBUG_CONNS, "ber_flush failed errno=%d reason=\"%s\"\n",
218 err, sock_errstr(err), 0 );
220 if ( err != EWOULDBLOCK && err != EAGAIN ) {
221 connection_closing( conn );
223 ldap_pvt_thread_mutex_unlock( &conn->c_mutex );
224 ldap_pvt_thread_mutex_unlock( &conn->c_write_mutex );
229 /* wait for socket to be write-ready */
230 conn->c_writewaiter = 1;
231 ber_sockbuf_ctrl( conn->c_sb, LBER_SB_OPT_GET_FD, &sd );
232 slapd_set_write( sd, 1 );
234 ldap_pvt_thread_cond_wait( &conn->c_write_cv, &conn->c_mutex );
235 conn->c_writewaiter = 0;
238 ldap_pvt_thread_mutex_unlock( &conn->c_mutex );
239 ldap_pvt_thread_mutex_unlock( &conn->c_write_mutex );
255 struct berval *resdata,
256 struct berval *sasldata,
264 assert( ctrls == NULL ); /* ctrls not implemented */
266 ber = ber_alloc_t( LBER_USE_DER );
268 Debug( LDAP_DEBUG_TRACE, "send_ldap_response: msgid=%ld tag=%ld err=%ld\n",
269 (long) msgid, (long) tag, (long) err );
271 Debug( LDAP_DEBUG_ARGS, "send_ldap_response: ref=%s\n",
272 ref[0] && ref[0]->bv_val ? ref[0]->bv_val : "NULL",
277 Debug( LDAP_DEBUG_ANY, "ber_alloc failed\n", 0, 0, 0 );
281 #ifdef LDAP_CONNECTIONLESS
283 rc = ber_printf( ber, "{is{t{ess}}}", msgid, "", tag,
284 err, matched ? matched : "", text ? text : "" );
288 rc = ber_printf( ber, "{it{ess",
290 matched == NULL ? "" : matched,
291 text == NULL ? "" : text );
295 assert( err == LDAP_REFERRAL );
296 rc = ber_printf( ber, "t{V}",
297 LDAP_TAG_REFERRAL, ref );
299 assert( err != LDAP_REFERRAL );
303 if( rc != -1 && sasldata != NULL ) {
304 rc = ber_printf( ber, "tO",
305 LDAP_TAG_SASL_RES_CREDS, sasldata );
308 if( rc != -1 && resoid != NULL ) {
309 rc = ber_printf( ber, "ts",
310 LDAP_TAG_EXOP_RES_OID, resoid );
313 if( rc != -1 && resdata != NULL ) {
314 rc = ber_printf( ber, "tO",
315 LDAP_TAG_EXOP_RES_VALUE, resdata );
319 rc = ber_printf( ber, "}}" );
324 Debug( LDAP_DEBUG_ANY, "ber_printf failed\n", 0, 0, 0 );
330 bytes = send_ldap_ber( conn, ber );
334 Debug( LDAP_DEBUG_ANY,
335 "send_ldap_response: ber write failed\n",
340 ldap_pvt_thread_mutex_lock( &num_sent_mutex );
341 num_bytes_sent += bytes;
343 ldap_pvt_thread_mutex_unlock( &num_sent_mutex );
349 send_ldap_disconnect(
360 #define LDAP_UNSOLICITED_ERROR(e) \
361 ( (e) == LDAP_PROTOCOL_ERROR \
362 || (e) == LDAP_STRONG_AUTH_REQUIRED \
363 || (e) == LDAP_UNAVAILABLE )
365 assert( LDAP_UNSOLICITED_ERROR( err ) );
367 Debug( LDAP_DEBUG_TRACE,
368 "send_ldap_disconnect %d:%s\n",
369 err, text ? text : "", NULL );
371 if ( op->o_protocol < LDAP_VERSION3 ) {
373 tag = req2res( op->o_tag );
374 msgid = (tag != LBER_SEQUENCE) ? op->o_msgid : 0;
377 reqoid = LDAP_NOTICE_DISCONNECT;
378 tag = LDAP_RES_EXTENDED;
382 #ifdef LDAP_CONNECTIONLESS
384 ber_sockbuf_ctrl( conn->c_sb, LBER_SB_OPT_UDP_SET_DST,
385 (void *)&op->o_clientaddr );
386 Debug( LDAP_DEBUG_TRACE, "UDP response to %s port %d\n",
387 inet_ntoa(((struct sockaddr_in *)
388 &op->o_clientaddr)->sin_addr ),
389 ((struct sockaddr_in *) &op->o_clientaddr)->sin_port,
394 send_ldap_response( conn, op, tag, msgid,
395 err, NULL, text, NULL,
396 reqoid, NULL, NULL, NULL );
398 Statslog( LDAP_DEBUG_STATS,
399 "conn=%ld op=%ld DISCONNECT err=%ld tag=%lu text=%s\n",
400 (long) op->o_connid, (long) op->o_opid,
401 (long) tag, (long) err, text ? text : "" );
419 assert( !LDAP_API_ERROR( err ) );
421 Debug( LDAP_DEBUG_TRACE, "send_ldap_result: conn=%ld op=%ld p=%d\n",
422 (long) op->o_connid, (long) op->o_opid, op->o_protocol );
423 Debug( LDAP_DEBUG_ARGS, "send_ldap_result: %d:%s:%s\n",
424 err, matched ? matched : "", text ? text : "" );
426 Debug( LDAP_DEBUG_ARGS, "send_ldap_result: referral: %s\n",
427 ref[0] && ref[0]->bv_val ? ref[0]->bv_val : "NULL",
431 assert( err != LDAP_PARTIAL_RESULTS );
433 if( op->o_tag != LDAP_REQ_SEARCH ) {
434 trim_refs_urls( ref );
437 if ( err == LDAP_REFERRAL ) {
439 err = LDAP_NO_SUCH_OBJECT;
440 } else if ( op->o_protocol < LDAP_VERSION3 ) {
441 err = LDAP_PARTIAL_RESULTS;
445 if ( op->o_protocol < LDAP_VERSION3 ) {
446 tmp = v2ref( ref, text );
451 tag = req2res( op->o_tag );
452 msgid = (tag != LBER_SEQUENCE) ? op->o_msgid : 0;
454 #ifdef LDAP_CONNECTIONLESS
456 ber_sockbuf_ctrl( conn->c_sb, LBER_SB_OPT_UDP_SET_DST,
457 (void *)&op->o_clientaddr );
458 Debug( LDAP_DEBUG_TRACE, "UDP response to %s port %d\n",
459 inet_ntoa(((struct sockaddr_in *)
460 &op->o_clientaddr)->sin_addr ),
461 ((struct sockaddr_in *) &op->o_clientaddr)->sin_port,
466 send_ldap_response( conn, op, tag, msgid,
467 err, matched, text, ref,
468 NULL, NULL, NULL, ctrls );
470 Statslog( LDAP_DEBUG_STATS,
471 "conn=%ld op=%ld RESULT tag=%lu err=%ld text=%s\n",
472 (long) op->o_connid, (long) op->o_opid,
473 (long) tag, (long) err, text ? text : "" );
495 Debug( LDAP_DEBUG_TRACE, "send_ldap_sasl %ld\n",
496 (long) err, NULL, NULL );
498 tag = req2res( op->o_tag );
499 msgid = (tag != LBER_SEQUENCE) ? op->o_msgid : 0;
501 #ifdef LDAP_CONNECTIONLESS
503 ber_sockbuf_ctrl( conn->c_sb, LBER_SB_OPT_UDP_SET_DST,
504 (void *)&op->o_clientaddr );
505 Debug( LDAP_DEBUG_TRACE, "UDP response to %s port %d\n",
506 inet_ntoa(((struct sockaddr_in *)
507 &op->o_clientaddr)->sin_addr ),
508 ((struct sockaddr_in *) &op->o_clientaddr)->sin_port,
513 send_ldap_response( conn, op, tag, msgid,
514 err, matched, text, ref,
515 NULL, NULL, cred, ctrls );
525 struct berval **refs,
527 struct berval *rspdata,
534 Debug( LDAP_DEBUG_TRACE,
535 "send_ldap_extended %ld:%s (%ld)\n",
537 rspoid ? rspoid : "",
538 rspdata != NULL ? (long) rspdata->bv_len : (long) 0 );
540 tag = req2res( op->o_tag );
541 msgid = (tag != LBER_SEQUENCE) ? op->o_msgid : 0;
543 #ifdef LDAP_CONNECTIONLESS
545 ber_sockbuf_ctrl( conn->c_sb, LBER_SB_OPT_UDP_SET_DST,
546 (void *)&op->o_clientaddr );
547 Debug( LDAP_DEBUG_TRACE, "UDP response to %s port %d\n",
548 inet_ntoa(((struct sockaddr_in *)
549 &op->o_clientaddr)->sin_addr ),
550 ((struct sockaddr_in *) &op->o_clientaddr)->sin_port,
555 send_ldap_response( conn, op, tag, msgid,
556 err, matched, text, refs,
557 rspoid, rspdata, NULL, ctrls );
568 struct berval **refs,
576 assert( !LDAP_API_ERROR( err ) );
578 Debug( LDAP_DEBUG_TRACE, "send_ldap_search_result %d:%s:%s\n",
579 err, matched ? matched : "", text ? text : "" );
581 assert( err != LDAP_PARTIAL_RESULTS );
583 trim_refs_urls( refs );
585 if( op->o_protocol < LDAP_VERSION3 ) {
586 /* send references in search results */
587 if( err == LDAP_REFERRAL ) {
588 err = LDAP_PARTIAL_RESULTS;
591 tmp = v2ref( refs, text );
595 /* don't send references in search results */
596 assert( refs == NULL );
599 if( err == LDAP_REFERRAL ) {
604 tag = req2res( op->o_tag );
605 msgid = (tag != LBER_SEQUENCE) ? op->o_msgid : 0;
607 #ifdef LDAP_CONNECTIONLESS
609 ber_sockbuf_ctrl( conn->c_sb, LBER_SB_OPT_UDP_SET_DST,
610 (void *)&op->o_clientaddr );
611 Debug( LDAP_DEBUG_TRACE, "UDP response to %s port %d\n",
612 inet_ntoa(((struct sockaddr_in *)
613 &op->o_clientaddr)->sin_addr ),
614 ((struct sockaddr_in *) &op->o_clientaddr)->sin_port,
619 send_ldap_response( conn, op, tag, msgid,
620 err, matched, text, refs,
621 NULL, NULL, NULL, ctrls );
623 Statslog( LDAP_DEBUG_STATS,
624 "conn=%ld op=%ld SEARCH RESULT tag=%lu err=%ld text=%s\n",
625 (long) op->o_connid, (long) op->o_opid,
626 (long) tag, (long) err, text ? text : "" );
651 #ifdef SLAPD_SCHEMA_NOT_COMPAT
652 AttributeDescription *ad_entry = slap_schema.si_ad_entry;
654 static const char *ad_entry = "entry";
657 Debug( LDAP_DEBUG_TRACE, "=> send_search_entry: \"%s\"\n", e->e_dn, 0, 0 );
659 if ( ! access_allowed( be, conn, op, e,
660 ad_entry, NULL, ACL_READ ) )
662 Debug( LDAP_DEBUG_ACL, "acl: access to entry not allowed\n",
669 ber = ber_alloc_t( LBER_USE_DER );
672 Debug( LDAP_DEBUG_ANY, "ber_alloc failed\n", 0, 0, 0 );
673 send_ldap_result( conn, op, LDAP_OTHER,
674 NULL, "BER allocation error", NULL, NULL );
678 rc = ber_printf( ber, "{it{s{" /*}}}*/, op->o_msgid,
679 LDAP_RES_SEARCH_ENTRY, e->e_dn );
682 Debug( LDAP_DEBUG_ANY, "ber_printf failed\n", 0, 0, 0 );
684 send_ldap_result( conn, op, LDAP_OTHER,
685 NULL, "encoding DN error", NULL, NULL );
689 /* check for special all user attributes ("*") type */
690 userattrs = ( attrs == NULL ) ? 1
691 : charray_inlist( attrs, LDAP_ALL_USER_ATTRIBUTES );
693 /* check for special all operational attributes ("+") type */
694 opattrs = ( attrs == NULL ) ? 0
695 : charray_inlist( attrs, LDAP_ALL_OPERATIONAL_ATTRIBUTES );
697 for ( a = e->e_attrs; a != NULL; a = a->a_next ) {
698 #ifdef SLAPD_SCHEMA_NOT_COMPAT
699 AttributeDescription *desc = a->a_desc;
700 char *type = desc->ad_cname->bv_val;
702 char *desc = a->a_type;
703 char *type = a->a_type;
706 if ( attrs == NULL ) {
707 /* all addrs request, skip operational attributes */
708 #ifdef SLAPD_SCHEMA_NOT_COMPAT
709 if( is_at_operational( desc->ad_type ) )
711 if( oc_check_op_attr( desc ) )
718 /* specific addrs requested */
719 #ifdef SLAPD_SCHEMA_NOT_COMPAT
720 if ( is_at_operational( desc->ad_type ) )
722 if ( oc_check_op_attr( desc ) )
725 if( !opattrs && !ad_inlist( desc, attrs ) ) {
729 if (!userattrs && !ad_inlist( desc, attrs ) ) {
735 if ( ! access_allowed( be, conn, op, e, desc, NULL, ACL_READ ) ) {
736 Debug( LDAP_DEBUG_ACL, "acl: access to attribute %s not allowed\n",
741 if (( rc = ber_printf( ber, "{s[" /*]}*/ , type )) == -1 ) {
742 Debug( LDAP_DEBUG_ANY, "ber_printf failed\n", 0, 0, 0 );
744 send_ldap_result( conn, op, LDAP_OTHER,
745 NULL, "encoding description error", NULL, NULL );
750 for ( i = 0; a->a_vals[i] != NULL; i++ ) {
751 if ( ! access_allowed( be, conn, op, e,
752 desc, a->a_vals[i], ACL_READ ) )
754 Debug( LDAP_DEBUG_ACL,
755 "acl: access to attribute %s, value %d not allowed\n",
760 if (( rc = ber_printf( ber, "O", a->a_vals[i] )) == -1 ) {
761 Debug( LDAP_DEBUG_ANY,
762 "ber_printf failed\n", 0, 0, 0 );
764 send_ldap_result( conn, op, LDAP_OTHER,
765 NULL, "encoding values error", NULL, NULL );
771 if (( rc = ber_printf( ber, /*{[*/ "]}" )) == -1 ) {
772 Debug( LDAP_DEBUG_ANY, "ber_printf failed\n", 0, 0, 0 );
774 send_ldap_result( conn, op, LDAP_OTHER,
775 NULL, "encode end error", NULL, NULL );
780 /* eventually will loop through generated operational attributes */
781 /* only have subschemaSubentry implemented */
782 aa = backend_operational( be, e );
784 for (a = aa ; a == NULL; a = a->a_next ) {
785 #ifdef SLAPD_SCHEMA_NOT_COMPAT
786 AttributeDescription *desc = a->a_desc;
788 char *desc = a->a_type;
791 if ( attrs == NULL ) {
792 /* all addrs request, skip operational attributes */
793 #ifdef SLAPD_SCHEMA_NOT_COMPAT
794 if( is_at_operational( desc->ad_type ) )
796 if( oc_check_op_attr( desc ) )
803 /* specific addrs requested */
804 #ifdef SLAPD_SCHEMA_NOT_COMPAT
805 if( is_at_operational( desc->ad_type ) )
807 if( oc_check_op_attr( desc ) )
810 if( !opattrs && !ad_inlist( desc, attrs ) )
815 if (!userattrs && !ad_inlist( desc, attrs ) )
822 if ( ! access_allowed( be, conn, op, e, desc, NULL, ACL_READ ) ) {
823 Debug( LDAP_DEBUG_ACL, "acl: access to attribute %s not allowed\n",
828 if (( rc = ber_printf( ber, "{s[" /*]}*/ , desc )) == -1 ) {
829 Debug( LDAP_DEBUG_ANY, "ber_printf failed\n", 0, 0, 0 );
831 send_ldap_result( conn, op, LDAP_OTHER,
832 NULL, "encoding description error", NULL, NULL );
837 for ( i = 0; a->a_vals[i] != NULL; i++ ) {
838 if ( ! access_allowed( be, conn, op, e,
839 desc, a->a_vals[i], ACL_READ ) )
841 Debug( LDAP_DEBUG_ACL,
842 "acl: access to attribute %s, value %d not allowed\n",
848 if (( rc = ber_printf( ber, "O", a->a_vals[i] )) == -1 ) {
849 Debug( LDAP_DEBUG_ANY,
850 "ber_printf failed\n", 0, 0, 0 );
852 send_ldap_result( conn, op, LDAP_OTHER,
853 NULL, "encoding values error", NULL, NULL );
859 if (( rc = ber_printf( ber, /*{[*/ "]}" )) == -1 ) {
860 Debug( LDAP_DEBUG_ANY, "ber_printf failed\n", 0, 0, 0 );
862 send_ldap_result( conn, op, LDAP_OTHER,
863 NULL, "encode end error", NULL, NULL );
870 rc = ber_printf( ber, /*{{{*/ "}}}" );
873 Debug( LDAP_DEBUG_ANY, "ber_printf failed\n", 0, 0, 0 );
875 send_ldap_result( conn, op, LDAP_OTHER,
876 NULL, "encode entry end error", NULL, NULL );
880 bytes = send_ldap_ber( conn, ber );
884 Debug( LDAP_DEBUG_ANY,
885 "send_ldap_response: ber write failed\n",
890 ldap_pvt_thread_mutex_lock( &num_sent_mutex );
891 num_bytes_sent += bytes;
894 ldap_pvt_thread_mutex_unlock( &num_sent_mutex );
896 Statslog( LDAP_DEBUG_STATS2, "conn=%ld op=%ld ENTRY dn=\"%s\"\n",
897 (long) conn->c_connid, (long) op->o_opid, e->e_dn, 0, 0 );
899 Debug( LDAP_DEBUG_TRACE, "<= send_search_entry\n", 0, 0, 0 );
908 send_search_reference(
913 struct berval **refs,
916 struct berval ***v2refs
923 #ifdef SLAPD_SCHEMA_NOT_COMPAT
924 AttributeDescription *ad_ref = slap_schema.si_ad_ref;
925 AttributeDescription *ad_entry = slap_schema.si_ad_entry;
927 static const char *ad_ref = "ref";
928 static const char *ad_entry = "entry";
931 Debug( LDAP_DEBUG_TRACE, "=> send_search_reference (%s)\n", e->e_dn, 0, 0 );
933 if ( ! access_allowed( be, conn, op, e,
934 ad_entry, NULL, ACL_READ ) )
936 Debug( LDAP_DEBUG_ACL,
937 "send_search_reference: access to entry not allowed\n",
942 if ( ! access_allowed( be, conn, op, e,
943 ad_ref, NULL, ACL_READ ) )
945 Debug( LDAP_DEBUG_ACL,
946 "send_search_reference: access to reference not allowed\n",
952 Debug( LDAP_DEBUG_ANY,
953 "send_search_reference: null ref in (%s)\n",
958 if( op->o_protocol < LDAP_VERSION3 ) {
959 /* save the references for the result */
960 if( *refs != NULL ) {
961 value_add( v2refs, refs );
966 ber = ber_alloc_t( LBER_USE_DER );
969 Debug( LDAP_DEBUG_ANY,
970 "send_search_reference: ber_alloc failed\n", 0, 0, 0 );
971 send_ldap_result( conn, op, LDAP_OTHER,
972 NULL, "alloc BER error", NULL, NULL );
976 rc = ber_printf( ber, "{it{V}}", op->o_msgid,
977 LDAP_RES_SEARCH_REFERENCE, refs );
980 Debug( LDAP_DEBUG_ANY,
981 "send_search_reference: ber_printf failed\n", 0, 0, 0 );
983 send_ldap_result( conn, op, LDAP_OTHER,
984 NULL, "encode DN error", NULL, NULL );
988 bytes = send_ldap_ber( conn, ber );
991 ldap_pvt_thread_mutex_lock( &num_sent_mutex );
992 num_bytes_sent += bytes;
995 ldap_pvt_thread_mutex_unlock( &num_sent_mutex );
997 Statslog( LDAP_DEBUG_STATS2, "conn=%ld op=%ld ENTRY dn=\"%s\"\n",
998 (long) conn->c_connid, (long) op->o_opid, e->e_dn, 0, 0 );
1000 Debug( LDAP_DEBUG_TRACE, "<= send_search_reference\n", 0, 0, 0 );
1017 *code = LDAP_SUCCESS;
1021 if ( strncasecmp( s, "RESULT", 6 ) != 0 ) {
1022 Debug( LDAP_DEBUG_ANY, "str2result (%s) expecting \"RESULT\"\n",
1029 while ( (s = strchr( s, '\n' )) != NULL ) {
1034 if ( (c = strchr( s, ':' )) != NULL ) {
1038 if ( strncasecmp( s, "code", 4 ) == 0 ) {
1042 } else if ( strncasecmp( s, "matched", 7 ) == 0 ) {
1046 } else if ( strncasecmp( s, "info", 4 ) == 0 ) {
1051 Debug( LDAP_DEBUG_ANY, "str2result (%s) unknown\n",