]> git.sur5r.net Git - openldap/commitdiff
Remove lint and misc MSVC updates
authorKurt Zeilenga <kurt@openldap.org>
Sun, 9 Dec 2001 02:34:45 +0000 (02:34 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Sun, 9 Dec 2001 02:34:45 +0000 (02:34 +0000)
34 files changed:
build/main.dsw
clients/ud/edit.c
clients/ud/main.c
include/lutil.h
include/queue-compat.h
libraries/liblber/decode.c
libraries/liblber/liblber.dsp
libraries/libldap/charray.c
libraries/libldap/ldap-int.h
libraries/libldap/libldap.dsp
libraries/libldap/request.c
libraries/libldap/search.c
libraries/libldap/url.c
libraries/libldap_r/libldap_r.dsp
libraries/libldbm/ldbm.c
libraries/liblutil/csn.c
libraries/liblutil/liblutil.dsp
libraries/liblutil/uuid.c
servers/slapd/acl.c
servers/slapd/back-bdb/backbdb.dsp
servers/slapd/back-bdb/config.c
servers/slapd/back-bdb/dn2id.c
servers/slapd/back-bdb/init.c
servers/slapd/back-ldbm/search.c
servers/slapd/backend.c
servers/slapd/backglue.c
servers/slapd/compare.c
servers/slapd/entry.c
servers/slapd/libslapd.dsp
servers/slapd/limits.c
servers/slapd/modify.c
servers/slapd/result.c
servers/slapd/saslauthz.c
servers/slapd/tools/slapadd.c

index 2226ef1f658b38bf547479c7abb65ceab889c650..d08cf6e2235954a9d5422877aa7716910cc00cd0 100644 (file)
@@ -677,6 +677,9 @@ Package=<4>
     Begin Project Dependency
     Project_Dep_Name libavl
     End Project Dependency
+    Begin Project Dependency
+    Project_Dep_Name liblber
+    End Project Dependency
 }}}
 
 ###############################################################################
index 9e208603837a77df31470154d294888f3382fb3d..53aeb57dfd594393243783c9eb8022417a2d1e58 100644 (file)
@@ -130,7 +130,6 @@ load_editor( void )
 {
        FILE *fp;
        char *cp, *editor = UD_DEFAULT_EDITOR;
-       int tmpfd;
 #ifndef HAVE_SPAWNLP
        int pid;
        int status;
@@ -145,16 +144,18 @@ load_editor( void )
 #ifdef HAVE_MKSTEMP
        strcpy(entry_temp_file, LDAP_TMPDIR LDAP_DIRSEP "udXXXXXX");
 
-       tmpfd = mkstemp(entry_temp_file);
+       {
+               int tmpfd = mkstemp(entry_temp_file);
 
-       if( tmpfd < 0 ) {
-               perror("mkstemp");
-               return -1;
-       }
+               if( tmpfd < 0 ) {
+                       perror("mkstemp");
+                       return -1;
+               }
 
-       if ((fp = fdopen(tmpfd, "w")) == NULL) {
-               perror("fdopen");
-               return(-1);
+               if ((fp = fdopen(tmpfd, "w")) == NULL) {
+                       perror("fdopen");
+                       return(-1);
+               }
        }
 
 #else
index cec5a03e6379a0537d72c6cc9a13ac027206ae2c..d6b5947c4e9c475409ca8b2119e6421f231ec97f 100644 (file)
@@ -327,7 +327,6 @@ void
 change_base( int type, char **base, char *s )
 {
        register char *cp;                      /* utility pointers */
-       char **rdns;                            /* for parsing */
        char *output_string = NULL;             /* for nice output */
        int num_picked;                         /* # of selected base */
        int j;                                  /* used with num_picked */
index 5adc4b998e5c614b669744d966b3835533ad69b6..b5f038be5e871a25ab565897e66bfa7f035e1c3d 100644 (file)
@@ -110,6 +110,14 @@ lutil_progname LDAP_P((
 LDAP_LUTIL_F( int )
 lutil_pair( ber_socket_t sd[2] );
 
+/* uuid.c */
+LDAP_LUTIL_F( size_t )
+lutil_uuidstr( char *buf, size_t len );
+
+/* csn.c */
+LDAP_LUTIL_F( size_t )
+lutil_csnstr( char *buf, size_t len, unsigned int replica, unsigned int mod );
+
 /*
  * Sometimes not all declarations in a header file are needed.
  * An indicator to this is whether or not the symbol's type has
index 1ba68a72620f8936812bbf896b9617db4f83f58f..e1915d862dc1b2b3a9d20dd768bdc1ff105ca05b 100644 (file)
@@ -48,7 +48,7 @@
 #ifndef _SYS_QUEUE_H_
 #define        _SYS_QUEUE_H_
 
-#include <machine/ansi.h>      /* for __offsetof */
+#define __offsetof     offsetof
 
 /*
  * This file defines five types of data structures: singly-linked lists,
index d79f8cbeb633574f993f69e4db4962182776ca2b..482834ed5c2c6d0f2db1862362fcf91117a9dbcd 100644 (file)
@@ -137,6 +137,11 @@ ber_skip_tag( BerElement *ber, ber_len_t *len )
                *len = lc;
        }
 
+       /* BER length should be non-negative */
+       if( *len < 0 ) {
+               return LBER_DEFAULT;
+       }
+
        /* BER element should have enough data left */
        if( *len > ber_pvt_ber_remaining( ber ) ) {
                return LBER_DEFAULT;
@@ -293,7 +298,7 @@ ber_get_stringa( BerElement *ber, char **buf )
                return LBER_DEFAULT;
        }
 
-       if ( (ber_len_t) ber_read( ber, *buf, datalen ) != datalen ) {
+       if ( datalen > 0 && (ber_len_t) ber_read( ber, *buf, datalen ) != datalen ) {
                LBER_FREE( *buf );
                *buf = NULL;
                return LBER_DEFAULT;
index e02e1f3f762617076a1cf250fb1c4fe153aa114c..e414c67d3efd5abe35107b9f42bf635f4fd577da 100644 (file)
@@ -219,6 +219,10 @@ SOURCE=.\options.c
 # End Source File
 # Begin Source File
 
+SOURCE="..\..\include\queue-compat.h"
+# End Source File
+# Begin Source File
+
 SOURCE=.\sockbuf.c
 # End Source File
 # End Target
index 41432d21b4d21dffd10025406c15951b512bfbd4..5037f6610a69b01426b2d029662f2522f798c0df 100644 (file)
@@ -77,8 +77,9 @@ ldap_charray_merge(
 
        aa = (char **) LDAP_REALLOC( (char *) *a, (n + nn + 1) * sizeof(char *) );
 
-       if( aa == NULL )
+       if( aa == NULL ) {
                return -1;
+       }
 
        *a = aa;
 
index 693686a280eded85e2ecbe1afbfc9fbe98987f43..8609ce2768cfc5da94cd068e64d464f4045bbf85 100644 (file)
@@ -18,6 +18,8 @@
 
 #include "../liblber/lber-int.h"
 
+#include <ac/queue.h>
+
 #ifdef HAVE_CYRUS_SASL
        /* the need for this should be removed */
 #include <sasl.h>
@@ -194,7 +196,7 @@ typedef struct ldap_conn {
 #endif
        BerElement              *lconn_ber;     /* ber receiving on this conn. */
 
-       struct ldap_conn        *lconn_next;
+       struct ldap_conn *lconn_next;
 } LDAPConn;
 
 
index d4e46e37c358cae10d0f42346b8983f7d0a50807..a409864fce69aac31e974665396aa4247c378c07 100644 (file)
@@ -199,10 +199,6 @@ SOURCE=.\free.c
 # End Source File
 # Begin Source File
 
-SOURCE=.\friendly.c
-# End Source File
-# Begin Source File
-
 SOURCE=.\getattr.c
 # End Source File
 # Begin Source File
index a909f4c4f7828b45904da9d15469eff35ca62b41..3ee6501a4e3318a86802edc813b01c8ec7c1d15f 100644 (file)
@@ -568,7 +568,6 @@ ldap_free_request_int( LDAP *ld, LDAPRequest *lr )
 void
 ldap_free_request( LDAP *ld, LDAPRequest *lr )
 {
-       LDAPRequest     *tmplr, *nextlr;
        LDAPRequest     **ttmplr;
 
        Debug( LDAP_DEBUG_TRACE, "ldap_free_request (origid %d, msgid %d)\n",
index 50f50067ff92dfe2d6d32fcd46f9226367758429..9a54165cb54c3f503947db7f6869ddd05797a2d7 100644 (file)
@@ -73,7 +73,7 @@ static int put_filter_list LDAP_P((
  *
  * Example:
  *     char    *attrs[] = { "mail", "title", 0 };
- *     ldap_search_ext( ld, "c=us,o=UM", LDAP_SCOPE_SUBTREE, "cn~=bob",
+ *     ldap_search_ext( ld, "dc=example,dc=com", LDAP_SCOPE_SUBTREE, "cn~=bob",
  *         attrs, attrsonly, sctrls, ctrls, timeout, sizelimit,
  *             &msgid );
  */
@@ -203,7 +203,7 @@ ldap_search_ext_s(
  *
  * Example:
  *     char    *attrs[] = { "mail", "title", 0 };
- *     msgid = ldap_search( ld, "c=us@o=UM", LDAP_SCOPE_SUBTREE, "cn~=bob",
+ *     msgid = ldap_search( ld, "dc=example,dc=com", LDAP_SCOPE_SUBTREE, "cn~=bob",
  *         attrs, attrsonly );
  */
 int
@@ -466,7 +466,7 @@ ldap_pvt_find_wildcard( const char *s )
 
 /* unescape filter value */
 /* support both LDAP v2 and v3 escapes */
-/* output can include nul characters */
+/* output can include nul characters! */
 ber_slen_t
 ldap_pvt_filter_value_unescape( char *fval )
 {
@@ -487,7 +487,6 @@ ldap_pvt_filter_value_unescape( char *fval )
 
                        if (( v1 = hex2value( fval[v] )) >= 0 ) {
                                /* LDAPv3 escape */
-
                                if (( v2 = hex2value( fval[v+1] )) < 0 ) {
                                        /* must be two digit code */
                                        return -1;
@@ -498,9 +497,18 @@ ldap_pvt_filter_value_unescape( char *fval )
 
                        } else {
                                /* LDAPv2 escape */
-                               fval[r++] = fval[v];
+                               switch( fval[v] ) {
+                               case '(':
+                               case ')':
+                               case '*':
+                               case '\\':
+                                       fval[r++] = fval[v];
+                                       break;
+                               default:
+                                       /* illegal escape */
+                                       return -1;
+                               }
                        }
-
                        break;
 
                default:
index 8db923b2a5f5a1d51cac5ae84ce9863bd50b0ea8..c716f2f0356abf5adb6c384a0f1dce6ee94de42b 100644 (file)
@@ -17,7 +17,7 @@
  *   scope is one of these three strings:  base one sub (default=base)
  *   filter is an string-represented filter as in RFC 2254
  *
- *  e.g.,  ldap://host:port/dc=com?o,cn?base?o=openldap?extension
+ *  e.g.,  ldap://host:port/dc=com?o,cn?base?(o=openldap)?extension
  *
  *  We also tolerate URLs that look like: <ldapurl> and <URL:ldapurl>
  */
index 4d8e7f57705c8a9f1025cdc0d9ca59ea1ff4e7f1..4803399cc8560eaa9b825d70822238e9948879ab 100644 (file)
@@ -196,10 +196,6 @@ SOURCE=..\libldap\free.c
 # End Source File
 # Begin Source File
 
-SOURCE=..\libldap\friendly.c
-# End Source File
-# Begin Source File
-
 SOURCE=..\libldap\getattr.c
 # End Source File
 # Begin Source File
index b9aedcf25cb0d7225c0c2a1870ee3f0c91601a0f..0e404ec6c508e6c7e9adca4fd0639ed167bd63db 100644 (file)
@@ -120,8 +120,10 @@ ldbm_db_errcall( const char *prefix, char *message )
 
 int ldbm_initialize( const char* home )
 {
+#if DB_VERSION_MAJOR < 3
        int     err;
        u_int32_t       envFlags;
+#endif
 
        if(ldbm_initialized++) return 1;
 
index 9c9273772418be53d3ff6d6285583cc89c98d95f..a56af6b65841b31957a41f501ab62e87e18b7f13 100644 (file)
@@ -32,6 +32,8 @@
 #include <stdio.h>
 #include <ac/time.h>
 
+#include <lutil.h>
+
 size_t
 lutil_csnstr(char *buf, size_t len, unsigned int replica, unsigned int mod)
 {
@@ -55,7 +57,8 @@ lutil_csnstr(char *buf, size_t len, unsigned int replica, unsigned int mod)
            ltm->tm_year + 1900, ltm->tm_mon, ltm->tm_mday, ltm->tm_hour,
            ltm->tm_min, ltm->tm_sec, op, replica, mod );
 
-       return ( n < len ) ? n : 0;
+       if( n < 0 ) return 0;
+       return ( (size_t) n < len ) ? n : 0;
 }
 
 #ifdef TEST
index 1e32beb4a5710fdb7d8b397c316cee43f85bc267..b08910531854e216431abe82a8186f6c90141e24 100644 (file)
@@ -140,6 +140,10 @@ SOURCE=..\..\include\ac\bytes.h
 # End Source File
 # Begin Source File
 
+SOURCE=.\csn.c
+# End Source File
+# Begin Source File
+
 SOURCE=.\debug.c
 # End Source File
 # Begin Source File
@@ -281,5 +285,9 @@ SOURCE=.\sockpair.c
 
 SOURCE=.\utils.c
 # End Source File
+# Begin Source File
+
+SOURCE=.\uuid.c
+# End Source File
 # End Target
 # End Project
index 7497c96888cc8ef92126631e2e9713a2e4abfd1b..0bb664a0dc01815032551defd2955ee137e402a4 100644 (file)
@@ -9,8 +9,6 @@
  * This is free software; you can redistribute and use it
  * under the same terms as OpenLDAP itself.
  */
-/* Adapted for incorporatation into OpenLDAP by Kurt Zeilenga */
-
 /*
  * Sorry this file is so scary, but it needs to run on a wide range of
  * platforms.  The only exported routine is lutil_uuidstr() which is all
 #include "portable.h"
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <sys/types.h>
 
+
 #ifdef HAVE_SYS_UUID_H
 #  include <sys/uuid.h>
+#elif defined( _WIN32 )
+#  include <rpc.h>
 #else
 #  include <ac/socket.h>
 #  include <ac/time.h>
+
+       /* 100 usec intervals from 10/10/1582 to 1/1/1970 */
+#      define UUID_TPLUS       0x01B21DD2138140LL
+
 #  ifdef HAVE_SYS_SYSCTL_H
 #    include <net/if.h>
 #    include <sys/sysctl.h>
@@ -36,9 +42,6 @@
 
 #include <lutil.h>
 
-/* 100 usec intervals from 10/10/1582 to 1/1/1970 */
-#define UUID_TPLUS     0x01B21DD2138140LL
-
 #ifndef HAVE_SYS_UUID_H
 static unsigned char *
 lutil_eaddr( void )
@@ -175,7 +178,7 @@ lutil_eaddr( void )
 ** We use DCE version one, and the DCE variant.  Our unique identifier is
 ** the first ethernet address on the system.
 */
-int
+size_t
 lutil_uuidstr( char *buf, size_t len )
 {
 #ifdef HAVE_SYS_UUID_H
@@ -200,11 +203,34 @@ lutil_uuidstr( char *buf, size_t len )
                return 0;
        }
 
-       strncpy( buf, s, l );
+       strncpy( buf, s, len );
        free( s );
 
        return l;
 
+#elif defined( _WIN32 )
+       UUID uuid;
+       unsigned char *uuidstr;
+       size_t uuidlen;
+
+       if( UuidCreate( &uuid ) != RPC_S_OK ) {
+               return 0;
+       }
+       if( UuidToString( &uuid, &uuidstr ) !=  RPC_S_OK ) {
+               return 0;
+       }
+
+       uuidlen = strlen( uuidstr );
+       if( uuidlen >= len ) {
+               return 0;
+       }
+
+       strncpy( buf, uuidstr, len );
+       free( uuidstr );
+
+       return uuidlen;
 #else
        struct timeval tv;
        unsigned long long tl;
index 193eba4d0c92d66dfdeb0d57f4f2269e0a8bcf89..dda814b38532396673988d29c312f53c6b8205f9 100644 (file)
@@ -346,7 +346,6 @@ acl_get(
                                                continue;
 
                                } else if ( a->acl_dn_style == ACL_STYLE_ONE ) {
-                                       char *rdn;
                                        int rdnlen = -1;
 
                                        if ( dnlen <= patlen )
@@ -549,7 +548,6 @@ acl_mask(
                                                continue;
 
                                } else if ( b->a_dn_style == ACL_STYLE_ONE ) {
-                                       char *rdn;
                                        int rdnlen = -1;
 
                                        if ( odnlen <= patlen )
index 8e97d8dd401aaafbb6e1bfa6ac6e632e6019c4bf..4c3a21730fadc5fdc84be2f1011b4c2183c99b8c 100644 (file)
@@ -131,6 +131,14 @@ SOURCE=.\add.c
 # End Source File
 # Begin Source File
 
+SOURCE=.\attr.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\attribute.c
+# End Source File
+# Begin Source File
+
 SOURCE=".\back-bdb.h"
 # End Source File
 # Begin Source File
@@ -147,6 +155,10 @@ SOURCE=.\config.c
 # End Source File
 # Begin Source File
 
+SOURCE=.\dbcache.c
+# End Source File
+# Begin Source File
+
 SOURCE=.\delete.c
 # End Source File
 # Begin Source File
@@ -187,10 +199,18 @@ SOURCE=.\idl.h
 # End Source File
 # Begin Source File
 
+SOURCE=.\index.c
+# End Source File
+# Begin Source File
+
 SOURCE=.\init.c
 # End Source File
 # Begin Source File
 
+SOURCE=.\key.c
+# End Source File
+# Begin Source File
+
 SOURCE=.\modify.c
 # End Source File
 # Begin Source File
index 75d41a4dc4d1f42c1b0e1109d76a09344915726c..a2f7910748ad6497137784c6dc8766e7c0d2294f 100644 (file)
@@ -13,7 +13,9 @@
 #include "back-bdb.h"
 
 #define        SLAP_BDB_ALLOW_DBNOTXN
-#define        SLAP_BDB_ALLOW_DIRTY_READ
+#ifdef DB_DIRTY_READ
+#      define  SLAP_BDB_ALLOW_DIRTY_READ
+#endif
 
 int
 bdb_db_config(
index d3735e416005157ee1a857e1127f0b1a2a7dae5d..3a81a54c1ddcaf23d5cbebf57b275350ff88f89d 100644 (file)
@@ -379,7 +379,7 @@ bdb_dn2idl(
        ID *ids )
 {
        int             rc;
-       DBT             key, data;
+       DBT             key;
        struct bdb_info *bdb = (struct bdb_info *) be->be_private;
        DB *db = bdb->bi_dn2id->bdi_db;
 
index 2ced0496839a53c4c6d40525622bcd7195e4fcc1..5ee04ab9da390067598f86826c9f0fab3d89d801 100644 (file)
@@ -432,8 +432,8 @@ bdb_initialize(
        bi->bi_op_abandon = bdb_abandon;
 
        bi->bi_extended = bdb_extended;
-#endif
        bi->bi_acl_group = bdb_group;
+#endif
        bi->bi_acl_attribute = bdb_attribute;
        bi->bi_chk_referrals = bdb_referrals;
 
index f4484ecf605b92a5088e5c06f736d2f30ce2d988..98c1fd11ebe74d06a462374c1bc78d82ba4a6033 100644 (file)
@@ -214,7 +214,7 @@ searchit:
 
        /* if candidates exceed to-be-checked entries, abort */
        if ( !isroot && limit->lms_s_unchecked != -1 ) {
-               if ( ID_BLOCK_NIDS( candidates ) > limit->lms_s_unchecked ) {
+               if ( ID_BLOCK_NIDS( candidates ) > (unsigned) limit->lms_s_unchecked ) {
                        send_search_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
                                        NULL, NULL, NULL, NULL, 0 );
                        rc = 0;
index 9398661b2e905a18d590ef16d071ba6ddb0e38f4..d199d8486dffd45b001582c3b78dddcf84680c8f 100644 (file)
@@ -565,7 +565,7 @@ be_issuffix(
 )
 {
        int     i;
-       int     len = strlen(suffix);
+       size_t len = strlen(suffix);
 
        for ( i = 0; be->be_nsuffix != NULL && be->be_nsuffix[i] != NULL; i++ ) {
                if ( len != be->be_nsuffix[i]->bv_len ) {
index 310519b3df26845c040b0205ee5d68bb41f131d6..cd2363ee97221ccaeffe008d29a58461d284739a 100644 (file)
@@ -627,8 +627,6 @@ glue_tool_entry_open (
        int mode
 )
 {
-       int i, rc;
-
        /* We don't know which backend to talk to yet, so just
         * remember the mode and move on...
         */
index 6c24393c00217d9100e7e5054a74207cd0913f13..f7d81050ac799abcc43c8d0fbdf977a2d5e013af 100644 (file)
@@ -176,7 +176,7 @@ do_compare(
 #ifdef NEW_LOGGING
                LDAP_LOG(( "operation", LDAP_LEVEL_ARGS,
                        "do_compare: conn %d  dn (%s) attr(%s) value (%s)\n",
-                       conn->c_connid, dn, ava.aa_desc->ad_cname->bv_val,
+                       conn->c_connid, dn, ava.aa_desc->ad_cname.bv_val,
                        ava.aa_value->bv_val ));
 #else
                Debug( LDAP_DEBUG_ARGS, "do_compare: dn (%s) attr (%s) value (%s)\n",
index 3608eeaefb46ad43d19b9985d807ee08ce72f5b6..ebd740f3c067478d211f654d574a8c73f6e5d3b0 100644 (file)
@@ -438,7 +438,7 @@ entry_putlen(unsigned char **buf, ber_len_t len)
                **buf = (unsigned char) len;
        } else {
                int i;
-               **buf = 0x80 | (lenlen - 1);
+               **buf = 0x80 | ((unsigned char) lenlen - 1);
                for (i=lenlen-1; i>0; i--) {
                        (*buf)[i] = (unsigned char) len;
                        len >>= 8;
index 7251ceffb8a4574e6584c4647c4ff1adf10fd078..63554a727710698fc2695fa8e502a309ea1eaf2e 100644 (file)
@@ -232,6 +232,10 @@ SOURCE=.\kerberos.c
 # End Source File
 # Begin Source File
 
+SOURCE=.\limits.c
+# End Source File
+# Begin Source File
+
 SOURCE=.\lock.c
 # End Source File
 # Begin Source File
@@ -276,6 +280,10 @@ SOURCE=".\proto-slap.h"
 # End Source File
 # Begin Source File
 
+SOURCE=.\referral.c
+# End Source File
+# Begin Source File
+
 SOURCE=.\repl.c
 # End Source File
 # Begin Source File
index fb65b4c13efcbdcc69390bf0304cdd0b324d2362..4a19e01a5ebb6f79be800470e756ea2a37531562 100644 (file)
@@ -49,7 +49,7 @@ get_limits(
                case SLAP_LIMITS_ONE:
                case SLAP_LIMITS_SUBTREE:
                case SLAP_LIMITS_CHILDREN: {
-                       long    d;
+                       size_t d;
                        
                        if ( ndn == NULL || ndn[0] == '\0' ) {
                                break;
index 313c13460255790c796c77f228dfb0769efc9b26..b988009479efa814b170ec19060dc60248884d22 100644 (file)
 #include <ac/string.h>
 #include <ac/time.h>
 
+#include "lutil.h"
+
 #include "ldap_pvt.h"
 #include "slap.h"
 
-
 int
 do_modify(
     Connection *conn,
index 5f954f19df30bf20659328b527e12b66d0c5e99c..48638cad56e007d4063408919405c1d583addaa8 100644 (file)
@@ -187,12 +187,14 @@ send_ldap_response(
        int             rc;
        long    bytes;
 
+       if (op->o_response) {
+               op->o_response( conn, op, tag, msgid, err, matched,
+                       text, ref, resoid, resdata, sasldata, ctrls );
+               return;
+       }
+               
        assert( ctrls == NULL ); /* ctrls not implemented */
 
-       if (op->o_response)
-               return op->o_response( conn, op, tag, msgid, err, matched,
-                       text, ref, resoid, resdata, sasldata, ctrls);
-               
        ber = ber_alloc_t( LBER_USE_DER );
 
 #ifdef NEW_LOGGING
@@ -556,11 +558,14 @@ send_search_result(
        ber_tag_t tag;
        ber_int_t msgid;
        char *tmp = NULL;
+
        assert( !LDAP_API_ERROR( err ) );
 
-       if (op->o_sresult)
-               return op->o_sresult(conn, op, err, matched, text, refs,
+       if (op->o_sresult) {
+               op->o_sresult(conn, op, err, matched, text, refs,
                        ctrls, nentries);
+               return;
+       }
 
 #ifdef NEW_LOGGING
        LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY,
index 5a8b689be537898e4c4309767a7ad24407fc3808..280e50ad15bf383b84289d7d729b529b956a5b43 100644 (file)
@@ -592,7 +592,7 @@ COMPLETE:
 
 int slap_sasl_authorized( char *authcDN, char *authzDN )
 {
-       int rc;
+       int rc = LDAP_INAPPROPRIATE_AUTH;
 
 #ifdef HAVE_CYRUS_SASL
        /* User binding as anonymous */
@@ -619,19 +619,22 @@ int slap_sasl_authorized( char *authcDN, char *authzDN )
        /* Check source rules */
        rc = slap_sasl_check_authz( authcDN, authzDN, SASL_AUTHZ_SOURCE_ATTR,
           authcDN );
-       if( rc == LDAP_SUCCESS )
+       if( rc == LDAP_SUCCESS ) {
                goto DONE;
+       }
 
        /* Check destination rules */
        rc = slap_sasl_check_authz( authzDN, authcDN, SASL_AUTHZ_DEST_ATTR,
           authcDN );
-       if( rc == LDAP_SUCCESS )
+       if( rc == LDAP_SUCCESS ) {
                goto DONE;
+       }
 
-#endif
        rc = LDAP_INAPPROPRIATE_AUTH;
 
 DONE:
+#endif
+
 #ifdef NEW_LOGGING
        LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY,
                   "slap_sasl_authorized: return %d\n", rc ));
index 55b536c43dcde2143c23038713e7898105602103..c32d593ae422fff8952fb7de04bf8eaee8c7b33b 100644 (file)
@@ -14,6 +14,9 @@
 #include <ac/socket.h>
 #include <ac/unistd.h>
 
+#include <lber.h>
+#include <ldif.h>
+
 #include "slapcommon.h"
 
 int