]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-shell/unbind.c
Don't reeval expression
[openldap] / servers / slapd / back-shell / unbind.c
index f90792d8760661a27c470f6d7b480d96e3fef745..d5d936106e6a865b083709476c271dd7545e8e6e 100644 (file)
@@ -1,4 +1,9 @@
 /* unbind.c - shell backend unbind function */
+/* $OpenLDAP$ */
+/*
+ * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
+ * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+ */
 
 #include "portable.h"
 
@@ -21,23 +26,19 @@ shell_back_unbind(
        FILE                    *rfp, *wfp;
 
        if ( si->si_unbind == NULL ) {
-               send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM, NULL,
-                   "unbind not implemented", NULL, NULL );
                return 0;
        }
 
        if ( (op->o_private = (void *) forkandexec( si->si_unbind, &rfp, &wfp ))
            == (void *) -1 ) {
-               send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR, NULL,
-                   "could not fork/exec", NULL, NULL );
                return 0;
        }
 
        /* write out the request to the unbind process */
        fprintf( wfp, "UNBIND\n" );
-       fprintf( wfp, "msgid: %ld\n", op->o_msgid );
+       fprintf( wfp, "msgid: %ld\n", (long) op->o_msgid );
        print_suffixes( wfp, be );
-       fprintf( wfp, "dn: %s\n", (conn->c_dn ? conn->c_dn : "") );
+       fprintf( wfp, "dn: %s\n", (conn->c_dn.bv_len ? conn->c_dn.bv_val : "") );
        fclose( wfp );
 
        /* no response to unbind */