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