1 /* modify.c - shell backend modify function */
24 struct shellinfo *si = (struct shellinfo *) be->be_private;
28 if ( si->si_modify == NULL ) {
29 send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM, NULL,
30 "modify not implemented", NULL, NULL );
34 if ( (op->o_private = (void *) forkandexec( si->si_modify, &rfp, &wfp ))
36 send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR, NULL,
37 "could not fork/exec", NULL, NULL );
41 /* write out the request to the modify process */
42 fprintf( wfp, "MODIFY\n" );
43 fprintf( wfp, "msgid: %ld\n", (long) op->o_msgid );
44 print_suffixes( wfp, be );
45 fprintf( wfp, "dn: %s\n", dn );
46 for ( ; ml != NULL; ml = ml->ml_next ) {
47 switch ( ml->ml_op & ~LDAP_MOD_BVALUES ) {
49 fprintf( wfp, "add: %s\n", ml->ml_type );
53 fprintf( wfp, "delete: %s\n", ml->ml_type );
56 case LDAP_MOD_REPLACE:
57 fprintf( wfp, "replace: %s\n", ml->ml_type );
61 for ( i = 0; ml->ml_bvalues != NULL && ml->ml_bvalues[i]
63 fprintf( wfp, "%s: %s\n", ml->ml_type,
64 ml->ml_bvalues[i]->bv_val );
69 /* read in the results and send them along */
70 read_and_send_results( be, conn, op, rfp, NULL, 0 );