X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=clients%2Ftools%2Fldapdelete.c;h=dba82d41cd9f316a41ddbed2bb4163d0ee9e0eb7;hb=f4d6b8570f4e0ddc5777b04f91d33fccd86ec62b;hp=24f297e6f2bf36fda25a1271e7bd7ed6a4196235;hpb=1adee08e8912c1f47c7b170fe62bebdd9797921f;p=openldap diff --git a/clients/tools/ldapdelete.c b/clients/tools/ldapdelete.c index 24f297e6f2..dba82d41cd 100644 --- a/clients/tools/ldapdelete.c +++ b/clients/tools/ldapdelete.c @@ -2,7 +2,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 1998-2010 The OpenLDAP Foundation. + * Copyright 1998-2012 The OpenLDAP Foundation. * Portions Copyright 1998-2003 Kurt D. Zeilenga. * All rights reserved. * @@ -184,24 +184,10 @@ main( int argc, char **argv ) if ( optind >= argc ) { fp = stdin; } - } + } ld = tool_conn_setup( 0, &private_conn_setup ); - if ( pw_file || want_bindpw ) { - if ( pw_file ) { - rc = lutil_get_filed_password( pw_file, &passwd ); - if( rc ) { - if ( fp && fp != stdin ) - fclose( fp ); - return EXIT_FAILURE; - } - } else { - passwd.bv_val = getpassphrase( _("Enter LDAP Password: ") ); - passwd.bv_len = passwd.bv_val ? strlen( passwd.bv_val ) : 0; - } - } - tool_bind( ld ); tool_server_controls( ld, NULL, 0 ); @@ -232,9 +218,7 @@ main( int argc, char **argv ) fclose( fp ); } - tool_unbind( ld ); - tool_destroy(); - return retval; + tool_exit( ld, retval ); }