1 /* add.c - shell backend add function */
22 struct shellinfo *si = (struct shellinfo *) be->be_private;
26 if ( si->si_add == NULL ) {
27 send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM, NULL,
28 "add not implemented", NULL, NULL );
32 if ( (op->o_private = (void *) forkandexec( si->si_add, &rfp, &wfp )) == (void *) -1 ) {
33 send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR, NULL,
34 "could not fork/exec", NULL, NULL );
38 /* write out the request to the add process */
39 fprintf( wfp, "ADD\n" );
40 fprintf( wfp, "msgid: %ld\n", (long) op->o_msgid );
41 print_suffixes( wfp, be );
42 ldap_pvt_thread_mutex_lock( &entry2str_mutex );
43 fprintf( wfp, "%s", entry2str( e, &len ) );
44 ldap_pvt_thread_mutex_unlock( &entry2str_mutex );
47 /* read in the result and send it along */
48 read_and_send_results( be, conn, op, rfp, NULL, 0 );