From 543a75355cbaedba649cfb21eab75210d53ca72b Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Wed, 22 Oct 2008 23:01:20 +0000 Subject: [PATCH] slight fixes and improvements to previous commit --- clients/tools/ldapsearch.c | 3 +++ servers/slapd/overlays/deref.c | 33 ++------------------------------- 2 files changed, 5 insertions(+), 31 deletions(-) diff --git a/clients/tools/ldapsearch.c b/clients/tools/ldapsearch.c index 213f8c1f0f..8a60f7d804 100644 --- a/clients/tools/ldapsearch.c +++ b/clients/tools/ldapsearch.c @@ -133,6 +133,9 @@ usage( void ) fprintf( stderr, _(" [!]subentries[=true|false] (RFC 3672 subentries)\n")); fprintf( stderr, _(" [!]sync=ro[/] (RFC 4533 LDAP Sync refreshOnly)\n")); fprintf( stderr, _(" rp[/][/] (refreshAndPersist)\n")); +#ifdef LDAP_CONTROL_X_DEREF + fprintf( stderr, _(" [!]deref=derefAttr:attr[,...][;derefAttr:attr[,...][;...]]\n")); +#endif fprintf( stderr, _(" [!]=: (generic control; no response handling)\n")); fprintf( stderr, _(" -F prefix URL prefix for files (default: %s)\n"), def_urlpre); fprintf( stderr, _(" -l limit time limit (in seconds, or \"none\" or \"max\") for search\n")); diff --git a/servers/slapd/overlays/deref.c b/servers/slapd/overlays/deref.c index 96b210aa4f..44300ea8ee 100644 --- a/servers/slapd/overlays/deref.c +++ b/servers/slapd/overlays/deref.c @@ -342,35 +342,6 @@ deref_response( Operation *op, SlapReply *rs ) ber_init2( ber, &bv, LBER_USE_DER ); ber_set_option( ber, LBER_OPT_BER_MEMCTX, &op->o_tmpmemctx ); -#if 0 - rc = ber_printf( ber, "{" /*}*/ ); - for ( dr = drhead; dr != NULL; dr = dr->dr_next ) { - rc = ber_printf( ber, "{{O{" /*}}}*/, - &dr->dr_spec.ds_derefAttr->ad_cname ); - for ( i = 0; i < dr->dr_spec.ds_nattrs; i++ ) { - rc = ber_printf( ber, "O", - &dr->dr_spec.ds_attributes[ i ]->ad_cname ); - } - rc = ber_printf( ber, /*{{*/ "}}{" /*}*/ ); - for ( i = 0; !BER_BVISNULL( &dr->dr_vals[ i ].dv_derefSpecVal ); i++ ) { - int j; - - rc = ber_printf( ber, "{O{" /*}}*/ , - &dr->dr_vals[ i ].dv_derefSpecVal ); - for ( j = 0; j < dr->dr_spec.ds_nattrs; j++ ) { - if ( dr->dr_vals[ i ].dv_attrVals[ j ] != NULL ) { - rc = ber_printf( ber, "[W]", dr->dr_vals[ i ].dv_attrVals[ j ] ); - } else { - rc = ber_printf( ber, "b", 0 ); - } - } - rc = ber_printf( ber, /*{{*/ "}}" ); - } - rc = ber_printf( ber, /*{{*/ "}}" ); - } - rc = ber_printf( ber, /*{*/ "}" ); -#endif - rc = ber_printf( ber, "{" /*}*/ ); for ( dr = drhead; dr != NULL; dr = dr->dr_next ) { for ( i = 0; !BER_BVISNULL( &dr->dr_vals[ i ].dv_derefSpecVal ); i++ ) { @@ -486,7 +457,7 @@ deref_op_search( Operation *op, SlapReply *rs ) } int -deref_initialize() +deref_initialize(void) { int rc; @@ -497,7 +468,7 @@ deref_initialize() Debug( LDAP_DEBUG_ANY, "deref_init: Failed to register control (%d)\n", rc, 0, 0 ); - return rc; + return -1; } deref.on_bi.bi_type = "deref"; -- 2.39.5