1 /* bind.c - shell backend bind function */
4 * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
5 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
12 #include <ac/socket.h>
13 #include <ac/string.h>
30 struct shellinfo *si = (struct shellinfo *) be->be_private;
34 if ( IS_NULLCMD( si->si_bind ) ) {
35 send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM, NULL,
36 "bind not implemented", NULL, NULL );
40 if ( (op->o_private = (void *) forkandexec( si->si_bind, &rfp, &wfp ))
42 send_ldap_result( conn, op, LDAP_OTHER, NULL,
43 "could not fork/exec", NULL, NULL );
47 /* write out the request to the bind process */
48 fprintf( wfp, "BIND\n" );
49 fprintf( wfp, "msgid: %ld\n", (long) op->o_msgid );
50 print_suffixes( wfp, be );
51 fprintf( wfp, "dn: %s\n", dn->bv_val );
52 fprintf( wfp, "method: %d\n", method );
53 fprintf( wfp, "credlen: %lu\n", cred->bv_len );
54 fprintf( wfp, "cred: %s\n", cred->bv_val ); /* XXX */
57 /* read in the results and send them along */
58 rc = read_and_send_results( be, conn, op, rfp, NULL, 0 );