/* delete.c - ldap backend delete function */
-
+/* $OpenLDAP$ */
+/*
+ * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
+ * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+ */
+/* This is an altered version */
/*
* Copyright 1999, Howard Chu, All rights reserved. <hyc@highlandsun.com>
*
* ever read sources, credits should appear in the documentation.
*
* 4. This notice may not be removed or altered.
+ *
+ *
+ *
+ * Copyright 2000, Pierangelo Masarati, All rights reserved. <ando@sys-net.it>
+ *
+ * This software is being modified by Pierangelo Masarati.
+ * The previously reported conditions apply to the modified code as well.
+ * Changes in the original code are highlighted where required.
+ * Credits for the original code go to the author, Howard Chu.
*/
#include "portable.h"
Backend *be,
Connection *conn,
Operation *op,
- char *dn
+ const char *dn,
+ const char *ndn
)
{
struct ldapinfo *li = (struct ldapinfo *) be->be_private;
struct ldapconn *lc;
+ char *mdn;
+
lc = ldap_back_getconn( li, conn, op );
- if (!lc)
+
+ if ( !lc || !ldap_back_dobind( lc, op ) ) {
return( -1 );
+ }
- if (!lc->bound) {
- ldap_back_dobind(lc, op);
- if (!lc->bound)
- return( -1 );
+ mdn = ldap_back_dn_massage( li, ch_strdup( dn ), 0 );
+ if ( mdn == NULL ) {
+ return( -1 );
}
+
+ ldap_delete_s( lc->ld, mdn );
- ldap_delete_s( lc->ld, dn );
+ free( mdn );
+
return( ldap_back_op_result( lc, op ) );
}