]> git.sur5r.net Git - openldap/commitdiff
slight fixes and improvements to previous commit
authorPierangelo Masarati <ando@openldap.org>
Wed, 22 Oct 2008 23:01:20 +0000 (23:01 +0000)
committerPierangelo Masarati <ando@openldap.org>
Wed, 22 Oct 2008 23:01:20 +0000 (23:01 +0000)
clients/tools/ldapsearch.c
servers/slapd/overlays/deref.c

index 213f8c1f0f164d559db3118ea86eb08f1d1cf64c..8a60f7d80402d4fecb8f66cc40c44ec6320aaf4e 100644 (file)
@@ -133,6 +133,9 @@ usage( void )
        fprintf( stderr, _("             [!]subentries[=true|false]  (RFC 3672 subentries)\n"));
        fprintf( stderr, _("             [!]sync=ro[/<cookie>]       (RFC 4533 LDAP Sync refreshOnly)\n"));
        fprintf( stderr, _("                     rp[/<cookie>][/<slimit>] (refreshAndPersist)\n"));
+#ifdef LDAP_CONTROL_X_DEREF
+       fprintf( stderr, _("             [!]deref=derefAttr:attr[,...][;derefAttr:attr[,...][;...]]\n"));
+#endif
        fprintf( stderr, _("             [!]<oid>=:<value>           (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"));
index 96b210aa4f072b07b93bba9173f7718a3378fef9..44300ea8ee8c730a7fe32ffeda4579d89ef2679a 100644 (file)
@@ -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";