]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-shell/bind.c
Update of back-bdb2 to KDZ's new entry lock schema.
[openldap] / servers / slapd / back-shell / bind.c
index 2d8e5a0a133dd3e910acbf3259fa424798f2029c..93ef4d869a177b225d16d01a2c55f7636bb99157 100644 (file)
@@ -3,9 +3,10 @@
 #include "portable.h"
 
 #include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/socket.h>
+
+#include <ac/socket.h>
+#include <ac/string.h>
+
 #include "slap.h"
 #include "shell.h"
 
@@ -16,33 +17,36 @@ shell_back_bind(
     Operation          *op,
     char               *dn,
     int                        method,
-    struct berval      *cred
+    struct berval      *cred,
+       char            **edn
 )
 {
        struct shellinfo        *si = (struct shellinfo *) be->be_private;
        FILE                    *rfp, *wfp;
        int                     rc;
 
+       *edn = NULL;
+
        if ( si->si_bind == NULL ) {
                send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM, NULL,
                    "bind not implemented" );
-               return;
+               return( -1 );
        }
 
-       if ( (op->o_private = forkandexec( si->si_bind, &rfp, &wfp ))
-           == -1 ) {
+       if ( (op->o_private = (void *) forkandexec( si->si_bind, &rfp, &wfp ))
+           == (void *) -1 ) {
                send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR, NULL,
                    "could not fork/exec" );
-               return;
+               return( -1 );
        }
 
        /* write out the request to the bind process */
        fprintf( wfp, "BIND\n" );
-       fprintf( wfp, "msgid: %d\n", op->o_msgid );
+       fprintf( wfp, "msgid: %ld\n", op->o_msgid );
        print_suffixes( wfp, be );
        fprintf( wfp, "dn: %s\n", dn );
        fprintf( wfp, "method: %d\n", method );
-       fprintf( wfp, "credlen: %d\n", cred->bv_len );
+       fprintf( wfp, "credlen: %lu\n", cred->bv_len );
        fprintf( wfp, "cred: %s\n", cred->bv_val ); /* XXX */
        fclose( wfp );