]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/limits.c
also log cookie parsing
[openldap] / servers / slapd / limits.c
index d1a66fee39f798bcdb0af84bab3754ef57728f93..81f4027de36dceb52a2510dfacb0c4da98b6b0ed 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2005 The OpenLDAP Foundation.
+ * Copyright 1998-2007 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -502,7 +502,6 @@ limits_parse(
                        ad.bv_val = strchr( oc.bv_val, '/' );
                        if ( ad.bv_val != NULL ) {
                                const char      *text = NULL;
-                               int             rc;
 
                                oc.bv_len = ad.bv_val - oc.bv_val;
 
@@ -533,7 +532,6 @@ no_oc:;
 
                if ( group_ad == NULL ) {
                        const char      *text = NULL;
-                       int             rc;
                        
                        rc = slap_str2ad( SLAPD_GROUP_ATTR, &group_ad, &text );
 
@@ -926,8 +924,6 @@ limits_unparse( struct slap_limits *lim, struct berval *bv, ber_len_t buflen )
                        break;
                }
        }
-       if ( WHATSLEFT <= STRLENOF( " " ) ) return -1;
-       *ptr++ = ' ';
        bv->bv_len = ptr - bv->bv_val;
        btmp.bv_val = ptr;
        btmp.bv_len = 0;
@@ -947,7 +943,7 @@ limits_unparse_one( struct slap_limits_set *lim, int which, struct berval *bv, b
 {
        char *ptr;
 
-       if ( !bv || !bv->bv_val ) return;
+       if ( !bv || !bv->bv_val ) return -1;
 
        ptr = bv->bv_val;
 
@@ -1085,6 +1081,8 @@ t_hard:
                *ptr = '\0';
                bv->bv_len = ptr - bv->bv_val;
        }
+
+       return 0;
 }
 
 int
@@ -1287,6 +1285,9 @@ limits_check( Operation *op, SlapReply *rs )
                                                return -1;
                                        }
                                        op->ors_slimit = slimit;
+
+                               } else if ( slimit == 0 ) {
+                                       op->ors_slimit = 0;
                                }
 
                        } else {