1 /* modify.c - shell backend modify function */
22 struct shellinfo *si = (struct shellinfo *) be->be_private;
26 if ( si->si_modify == NULL ) {
27 send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM, NULL,
28 "modify not implemented", NULL, NULL );
32 if ( (op->o_private = (void *) forkandexec( si->si_modify, &rfp, &wfp ))
34 send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR, NULL,
35 "could not fork/exec", NULL, NULL );
39 /* write out the request to the modify process */
40 fprintf( wfp, "MODIFY\n" );
41 fprintf( wfp, "msgid: %ld\n", op->o_msgid );
42 print_suffixes( wfp, be );
43 fprintf( wfp, "dn: %s\n", dn );
44 for ( ; ml != NULL; ml = ml->ml_next ) {
45 switch ( ml->ml_op & ~LDAP_MOD_BVALUES ) {
47 fprintf( wfp, "add: %s\n", ml->ml_type );
51 fprintf( wfp, "delete: %s\n", ml->ml_type );
54 case LDAP_MOD_REPLACE:
55 fprintf( wfp, "replace: %s\n", ml->ml_type );
59 for ( i = 0; ml->ml_bvalues != NULL && ml->ml_bvalues[i]
61 fprintf( wfp, "%s: %s\n", ml->ml_type,
62 ml->ml_bvalues[i]->bv_val );
67 /* read in the results and send them along */
68 read_and_send_results( be, conn, op, rfp, NULL, 0 );