slight fixes and improvements to previous commit

This commit is contained in:
Pierangelo Masarati 2008-10-22 23:01:20 +00:00
parent 91e14ca638
commit 543a75355c
2 changed files with 5 additions and 31 deletions

View File

@ -133,6 +133,9 @@ usage( void )
fprintf( stderr, _(" [!]subentries[=true|false] (RFC 3672 subentries)\n")); fprintf( stderr, _(" [!]subentries[=true|false] (RFC 3672 subentries)\n"));
fprintf( stderr, _(" [!]sync=ro[/<cookie>] (RFC 4533 LDAP Sync refreshOnly)\n")); fprintf( stderr, _(" [!]sync=ro[/<cookie>] (RFC 4533 LDAP Sync refreshOnly)\n"));
fprintf( stderr, _(" rp[/<cookie>][/<slimit>] (refreshAndPersist)\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, _(" [!]<oid>=:<value> (generic control; no response handling)\n"));
fprintf( stderr, _(" -F prefix URL prefix for files (default: %s)\n"), def_urlpre); 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")); fprintf( stderr, _(" -l limit time limit (in seconds, or \"none\" or \"max\") for search\n"));

View File

@ -342,35 +342,6 @@ deref_response( Operation *op, SlapReply *rs )
ber_init2( ber, &bv, LBER_USE_DER ); ber_init2( ber, &bv, LBER_USE_DER );
ber_set_option( ber, LBER_OPT_BER_MEMCTX, &op->o_tmpmemctx ); 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, "{" /*}*/ ); rc = ber_printf( ber, "{" /*}*/ );
for ( dr = drhead; dr != NULL; dr = dr->dr_next ) { for ( dr = drhead; dr != NULL; dr = dr->dr_next ) {
for ( i = 0; !BER_BVISNULL( &dr->dr_vals[ i ].dv_derefSpecVal ); i++ ) { for ( i = 0; !BER_BVISNULL( &dr->dr_vals[ i ].dv_derefSpecVal ); i++ ) {
@ -486,7 +457,7 @@ deref_op_search( Operation *op, SlapReply *rs )
} }
int int
deref_initialize() deref_initialize(void)
{ {
int rc; int rc;
@ -497,7 +468,7 @@ deref_initialize()
Debug( LDAP_DEBUG_ANY, Debug( LDAP_DEBUG_ANY,
"deref_init: Failed to register control (%d)\n", "deref_init: Failed to register control (%d)\n",
rc, 0, 0 ); rc, 0, 0 );
return rc; return -1;
} }
deref.on_bi.bi_type = "deref"; deref.on_bi.bi_type = "deref";