1 /* modrdn.c - shell backend modrdn function */
4 * LDAP v3 newSuperior support.
6 * Copyright 1999, Juan C. Gomez, All rights reserved.
7 * This software is not subject to any license of Silicon Graphics
8 * Inc. or Purdue University.
10 * Redistribution and use in source and binary forms are permitted
11 * without restriction or fee of any kind as long as this notice
20 #include <ac/socket.h>
21 #include <ac/string.h>
37 struct shellinfo *si = (struct shellinfo *) be->be_private;
40 if ( si->si_modrdn == NULL ) {
41 send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM, NULL,
42 "modrdn not implemented", NULL, NULL );
46 if ( (op->o_private = (void *) forkandexec( si->si_modrdn, &rfp, &wfp ))
48 send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR, NULL,
49 "could not fork/exec", NULL, NULL );
53 /* write out the request to the modrdn process */
54 fprintf( wfp, "MODRDN\n" );
55 fprintf( wfp, "msgid: %ld\n", op->o_msgid );
56 print_suffixes( wfp, be );
57 fprintf( wfp, "dn: %s\n", dn );
58 fprintf( wfp, "newrdn: %s\n", newrdn );
59 fprintf( wfp, "deleteoldrdn: %d\n", deleteoldrdn ? 1 : 0 );
60 if (newSuperior != NULL) {
61 fprintf( wfp, "newSuperior: %s\n", newSuperior );
65 /* read in the results and send them along */
66 read_and_send_results( be, conn, op, rfp, NULL, 0 );