]> git.sur5r.net Git - openldap/blobdiff - servers/ldapd/request.c
Fix idl_firstid to return NOID when !(nids > 1) instead of when (nids == 1)
[openldap] / servers / ldapd / request.c
index 77d59eb2f527ae30aa79d6a2e25ba3bcc7d7c275..28dae68661e5e94060ce14ab2bf2e6ef5c85de14 100644 (file)
 #include <quipu/dua.h>
 
 #include "lber.h"
+#include "../../libraries/liblber/lber-int.h"  /* get struct berelement */
 #include "ldap.h"
 #include "common.h"
 
-extern int     dosyslog;
-
 #ifdef PEPSY_DUMP
 #ifndef DEBUG
 #define DEBUG
@@ -69,11 +68,6 @@ client_request(
        BerElement      ber, *copyofber;
        struct msg      *m;
        static int      bound;
-       extern char     *bound_dn, *bound_pw;
-       struct PSAPaddr *psap_cpy();
-#ifdef LDAP_COMPAT
-       extern int      ldap_compat;
-#endif
 
        Debug( LDAP_DEBUG_TRACE, "client_request%s\n",
            udp ? " udp" : "", 0, 0 );
@@ -83,7 +77,7 @@ client_request(
         * and then the actual request choice.
         */
 
-       ber_init( &ber, 0 );
+       ber_init_w_nullc( &ber, 0 );
        if ( (tag = ber_get_next( clientsb, &len, &ber )) == LBER_DEFAULT ) {
                Debug( LDAP_DEBUG_ANY, "ber_get_next failed\n", 0, 0, 0 );
                log_and_exit( 1 );
@@ -134,8 +128,8 @@ client_request(
                        ttag = ber_skip_tag( &tber, &tlen );
                        ttag = ber_peek_tag( &tber, &tlen );
 
-                       Debug( LDAP_DEBUG_ANY, "checking for 3.0 tag 0x%x\n",
-                           ttag, 0, 0 );
+                       Debug( LDAP_DEBUG_ANY, "checking for 3.0 tag 0x%lx\n",
+                              ttag, 0, 0 );
                        if ( ttag == LBER_SEQUENCE ) {
                                Debug( LDAP_DEBUG_ANY, "version 3.0 detected\n",
                                    0, 0, 0 );
@@ -202,7 +196,7 @@ client_request(
                 * duplicate request: toss this one
                 */
                Debug( LDAP_DEBUG_TRACE,
-                   "client_request tossing dup request id %d from %s\n",
+                   "client_request tossing dup request id %ld from %s\n",
                    msgid, inet_ntoa( ((struct sockaddr_in *)
                    clientsb->sb_fromaddr)->sin_addr ), 0 );
                free( ber.ber_buf );