]> git.sur5r.net Git - openldap/blobdiff - clients/tools/ldapdelete.c
Merge remote branch 'origin/mdb.master' into OPENLDAP_REL_ENG_2_4
[openldap] / clients / tools / ldapdelete.c
index 61c78408f7a5b47d2411a9bf5f5233dcd2b68ee2..dba82d41cd9f316a41ddbed2bb4163d0ee9e0eb7 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2009 The OpenLDAP Foundation.
+ * Copyright 1998-2012 The OpenLDAP Foundation.
  * Portions Copyright 1998-2003 Kurt D. Zeilenga.
  * All rights reserved.
  *
@@ -71,6 +71,10 @@ usage( void )
        fprintf( stderr, _("    dn: list of DNs to delete. If not given, it will be readed from stdin\n"));
        fprintf( stderr, _("        or from the file specified with \"-f file\".\n"));
        fprintf( stderr, _("Delete Options:\n"));
+       fprintf( stderr, _("  -c         continuous operation mode (do not stop on errors)\n"));
+       fprintf( stderr, _("  -f file    read operations from `file'\n"));
+       fprintf( stderr, _("  -M         enable Manage DSA IT control (-MM to make critical)\n"));
+       fprintf( stderr, _("  -P version protocol version (default: 3)\n"));
        fprintf( stderr, _("  -r         delete recursively\n"));
        tool_common_usage();
        exit( EXIT_FAILURE );
@@ -180,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 );
@@ -228,9 +218,7 @@ main( int argc, char **argv )
                        fclose( fp );
        }
 
-       tool_unbind( ld );
-       tool_destroy();
-    return retval;
+       tool_exit( ld, retval );
 }