1 /* compare.c - shell backend compare function */
22 struct shellinfo *si = (struct shellinfo *) be->be_private;
25 if ( si->si_compare == NULL ) {
26 send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM, NULL,
27 "compare not implemented" );
31 if ( (op->o_private = (void *) forkandexec( si->si_compare, &rfp, &wfp ))
33 send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR, NULL,
34 "could not fork/exec" );
38 /* write out the request to the compare process */
39 fprintf( wfp, "COMPARE\n" );
40 fprintf( wfp, "msgid: %ld\n", op->o_msgid );
41 print_suffixes( wfp, be );
42 fprintf( wfp, "dn: %s\n", dn );
43 fprintf( wfp, "%s: %s\n", ava->ava_type, ava->ava_value.bv_val );
46 /* read in the result and send it along */
47 read_and_send_results( be, conn, op, rfp, NULL, 0 );