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