1 /* compare.c - shell backend compare function */
6 #include <sys/socket.h>
19 struct shellinfo *si = (struct shellinfo *) be->be_private;
22 if ( si->si_compare == NULL ) {
23 send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM, NULL,
24 "compare not implemented" );
28 if ( (op->o_private = forkandexec( si->si_compare, &rfp, &wfp ))
30 send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR, NULL,
31 "could not fork/exec" );
35 /* write out the request to the compare process */
36 fprintf( wfp, "COMPARE\n" );
37 fprintf( wfp, "msgid: %d\n", op->o_msgid );
38 print_suffixes( wfp, be );
39 fprintf( wfp, "dn: %s\n", dn );
40 fprintf( wfp, "%s: %s\n", ava->ava_type, ava->ava_value.bv_val );
43 /* read in the result and send it along */
44 read_and_send_results( be, conn, op, rfp, NULL, 0 );