/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* The contents of this file are subject to the Netscape Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
/* ldapdelete.c - simple program to delete an entry using LDAP */
#include "ldaptool.h"
#ifdef SOLARIS_LDAP_CMD
#include <locale.h>
#endif /* SOLARIS_LDAP_CMD */
static int contoper;
#ifdef later
#endif
#ifndef SOLARIS_LDAP_CMD
#define gettext(s) s
#endif
static void
usage( void )
{
ldaptool_common_usage( 0 );
exit( LDAP_PARAM_ERROR );
}
int
{
#ifdef notdef
#ifdef HPUX11
#ifndef __LP64__
#endif /* __LP64_ */
#endif /* HPUX11 */
#endif
#ifdef SOLARIS_LDAP_CMD
#endif /* SOLARIS_LDAP_CMD */
contoper = 0;
#ifdef later
delbypasscmd = 0;
#endif
if ( optind == -1 ) {
usage();
}
ldaptool_fp = stdin;
}
ld = ldaptool_ldap_init( 0 );
ldaptool_bind( ld );
}
}
if ( ldaptool_fp == NULL ) {
char *conv;
}
}
} else {
rc = 0;
if ( *buf != '\0' ) {
}
}
}
ldaptool_cleanup( ld );
/* check for and report output error */
gettext("output error (output might be incomplete)") );
return( rc );
}
static void
{
switch( option ) {
case 'c': /* continuous operation mode */
++contoper;
break;
default:
usage();
}
}
static int
{
int rc;
if ( ldaptool_verbose ) {
}
if ( ldaptool_not ) {
rc = LDAP_SUCCESS;
}
return( rc );
}
#ifdef later
/* This code broke iDS.....it will have to be revisited */
static int
{
int rc;
char ch;
if ( ldaptool_verbose ) {
}
if ( ldaptool_not ) {
rc = LDAP_SUCCESS;
}
else { /* else 1 */
if ( (rc = ldap_search_s( ld, dn, LDAP_SCOPE_SUBTREE, my_filter, NULL, 0, &result )) != LDAP_SUCCESS ) {
}
else { /* else 2 */
}
}
yestodelete = 0;
if ( delbypasscmd == 0 ) {
printf( gettext("Are you sure you want to delete the entire branch rooted at %s? [no]\n"), (char *)((Element *)(((Head *)&HeadNode)->first))->data);
yestodelete = 1;
}
} else {
yestodelete = 1;
}
} else {
yestodelete = 1;
}
if ( yestodelete == 1 ) {
if (datalist) {
if ((rc = ldaptool_delete_ext_s( ld, (char *)datalist->data, serverctrls, NULL, "ldap_delete" )) == LDAP_SUCCESS && ldaptool_verbose ) {
}
}
}
} /* end if (yestodelete) */
} /* else 2 */
} /* else 1 */
return (rc);
} /* function end bracket */
#endif