1 /* bind.c - shell backend bind function */
8 #include <sys/socket.h>
22 struct shellinfo *si = (struct shellinfo *) be->be_private;
26 if ( si->si_bind == NULL ) {
27 send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM, NULL,
28 "bind not implemented" );
32 if ( (op->o_private = forkandexec( si->si_bind, &rfp, &wfp ))
34 send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR, NULL,
35 "could not fork/exec" );
39 /* write out the request to the bind process */
40 fprintf( wfp, "BIND\n" );
41 fprintf( wfp, "msgid: %d\n", op->o_msgid );
42 print_suffixes( wfp, be );
43 fprintf( wfp, "dn: %s\n", dn );
44 fprintf( wfp, "method: %d\n", method );
45 fprintf( wfp, "credlen: %d\n", cred->bv_len );
46 fprintf( wfp, "cred: %s\n", cred->bv_val ); /* XXX */
49 /* read in the results and send them along */
50 rc = read_and_send_results( be, conn, op, rfp, NULL, 0 );