]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/overlays/accesslog.c
ITS#5710 fix stupid updateCookie hack, use explicit o_dont_replicate flag
[openldap] / servers / slapd / overlays / accesslog.c
index 866afd7937763176ed0d5a3e81b3294c979df05a..a6b261377b4366534665f86e92f1cb7afeda4e6c 100644 (file)
@@ -534,17 +534,17 @@ log_age_unparse( int age, struct berval *agebv, size_t size )
 
        if ( dd ) {
                len = snprintf( ptr, size, "%d+", dd );
-               assert( len >= 0 && len < size );
+               assert( len >= 0 && (unsigned) len < size );
                size -= len;
                ptr += len;
        }
        len = snprintf( ptr, size, "%02d:%02d", hh, mm );
-       assert( len >= 0 && len < size );
+       assert( len >= 0 && (unsigned) len < size );
        size -= len;
        ptr += len;
        if ( ss ) {
                len = snprintf( ptr, size, ":%02d", ss );
-               assert( len >= 0 && len < size );
+               assert( len >= 0 && (unsigned) len < size );
                size -= len;
                ptr += len;
        }
@@ -580,7 +580,7 @@ log_old_lookup( Operation *op, SlapReply *rs )
        a = attr_find( rs->sr_entry->e_attrs,
                slap_schema.si_ad_entryCSN );
        if ( a ) {
-               int len = a->a_vals[0].bv_len;
+               ber_len_t len = a->a_vals[0].bv_len;
                if ( len > pd->csn.bv_len )
                        len = pd->csn.bv_len;
                if ( memcmp( a->a_vals[0].bv_val, pd->csn.bv_val, len ) > 0 ) {
@@ -933,7 +933,7 @@ logSchemaControlValidate(
        struct berval   *valp )
 {
        struct berval   val, bv;
-       int             i;
+       ber_len_t               i;
        int             rc = LDAP_SUCCESS;
 
        assert( valp != NULL );
@@ -1155,7 +1155,7 @@ accesslog_ctrls(
                }
                
                if ( !BER_BVISNULL( &ctrls[ i ]->ldctl_value ) ) {
-                       int     j;
+                       ber_len_t       j;
 
                        ptr = lutil_strcopy( ptr, " controlValue \"" );
                        for ( j = 0; j < ctrls[ i ]->ldctl_value.bv_len; j++ )
@@ -1400,7 +1400,7 @@ static int accesslog_response(Operation *op, SlapReply *rs) {
                attr_merge_one( e, ad_reqMessage, &bv, NULL );
        }
        bv.bv_len = snprintf( timebuf, sizeof( timebuf ), "%d", rs->sr_err );
-       if ( bv.bv_len >= 0 && bv.bv_len < sizeof( timebuf ) ) {
+       if ( bv.bv_len < sizeof( timebuf ) ) {
                bv.bv_val = timebuf;
                attr_merge_one( e, ad_reqResult, &bv, NULL );
        }
@@ -1617,17 +1617,17 @@ static int accesslog_response(Operation *op, SlapReply *rs) {
                }
                bv.bv_val = timebuf;
                bv.bv_len = snprintf( bv.bv_val, sizeof( timebuf ), "%d", rs->sr_nentries );
-               if ( bv.bv_len >= 0 && bv.bv_len < sizeof( timebuf ) ) {
+               if ( bv.bv_len < sizeof( timebuf ) ) {
                        attr_merge_one( e, ad_reqEntries, &bv, NULL );
                } /* else? */
 
                bv.bv_len = snprintf( bv.bv_val, sizeof( timebuf ), "%d", op->ors_tlimit );
-               if ( bv.bv_len >= 0 && bv.bv_len < sizeof( timebuf ) ) {
+               if ( bv.bv_len < sizeof( timebuf ) ) {
                        attr_merge_one( e, ad_reqTimeLimit, &bv, NULL );
                } /* else? */
 
                bv.bv_len = snprintf( bv.bv_val, sizeof( timebuf ), "%d", op->ors_slimit );
-               if ( bv.bv_len >= 0 && bv.bv_len < sizeof( timebuf ) ) {
+               if ( bv.bv_len < sizeof( timebuf ) ) {
                        attr_merge_one( e, ad_reqSizeLimit, &bv, NULL );
                } /* else? */
                break;
@@ -1635,7 +1635,7 @@ static int accesslog_response(Operation *op, SlapReply *rs) {
        case LOG_EN_BIND:
                bv.bv_val = timebuf;
                bv.bv_len = snprintf( bv.bv_val, sizeof( timebuf ), "%d", op->o_protocol );
-               if ( bv.bv_len >= 0 && bv.bv_len < sizeof( timebuf ) ) {
+               if ( bv.bv_len < sizeof( timebuf ) ) {
                        attr_merge_one( e, ad_reqVersion, &bv, NULL );
                } /* else? */
                if ( op->orb_method == LDAP_AUTH_SIMPLE ) {
@@ -1838,7 +1838,7 @@ accesslog_abandon( Operation *op, SlapReply *rs )
        e = accesslog_entry( op, rs, LOG_EN_ABANDON, &op2 );
        bv.bv_val = buf;
        bv.bv_len = snprintf( buf, sizeof( buf ), "%d", op->orn_msgid );
-       if ( bv.bv_len >= 0 && bv.bv_len < sizeof( buf ) ) {
+       if ( bv.bv_len < sizeof( buf ) ) {
                attr_merge_one( e, ad_reqId, &bv, NULL );
        } /* else? */