1 /* modrdn.c - shell backend modrdn function */
8 #include <sys/socket.h>
22 struct shellinfo *si = (struct shellinfo *) be->be_private;
25 if ( si->si_modrdn == NULL ) {
26 send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM, NULL,
27 "modrdn not implemented" );
31 if ( (op->o_private = forkandexec( si->si_modrdn, &rfp, &wfp ))
33 send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR, NULL,
34 "could not fork/exec" );
38 /* write out the request to the modrdn process */
39 fprintf( wfp, "MODRDN\n" );
40 fprintf( wfp, "msgid: %d\n", op->o_msgid );
41 print_suffixes( wfp, be );
42 fprintf( wfp, "dn: %s\n", dn );
43 fprintf( wfp, "newrdn: %s\n", newrdn );
44 fprintf( wfp, "deleteoldrdn: %d\n", deleteoldrdn ? 1 : 0 );
47 /* read in the results and send them along */
48 read_and_send_results( be, conn, op, rfp, NULL, 0 );