]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-shell/bind.c
Import slapd nextid chunking from -devel.
[openldap] / servers / slapd / back-shell / bind.c
index dea149e4106fc4779706c3a065000fd7e976a1e5..025cbe973c2bc4ae2e1b3dc310534cac542d9cff 100644 (file)
@@ -1,9 +1,12 @@
 /* bind.c - shell backend bind function */
 
+#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"
 
@@ -14,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 ) {
                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 );