1 /* delete.c - shell backend delete function */
4 * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
5 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
12 #include <ac/string.h>
13 #include <ac/socket.h>
27 struct shellinfo *si = (struct shellinfo *) be->be_private;
28 AttributeDescription *entry = slap_schema.si_ad_entry;
32 if ( si->si_delete == NULL ) {
33 send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM, NULL,
34 "delete not implemented", NULL, NULL );
47 if ( ! access_allowed( be, conn, op, &e,
48 entry, NULL, ACL_WRITE, NULL ) )
50 send_ldap_result( conn, op, LDAP_INSUFFICIENT_ACCESS,
51 NULL, NULL, NULL, NULL );
55 if ( (op->o_private = (void *) forkandexec( si->si_delete, &rfp, &wfp ))
57 send_ldap_result( conn, op, LDAP_OTHER, NULL,
58 "could not fork/exec", NULL, NULL );
62 /* write out the request to the delete process */
63 fprintf( wfp, "DELETE\n" );
64 fprintf( wfp, "msgid: %ld\n", (long) op->o_msgid );
65 print_suffixes( wfp, be );
66 fprintf( wfp, "dn: %s\n", dn->bv_val );
69 /* read in the results and send them along */
70 read_and_send_results( be, conn, op, rfp, NULL, 0 );