]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/controls.c
Berkeley DB 4.2 support (DB 4.2 required by default)
[openldap] / servers / slapd / controls.c
index 47916031656c9f1a62b7e37cc028ab59165d76e3..16a9e3fcdce63f07ef6a5b5df0fe5149c40d26ab 100644 (file)
@@ -986,7 +986,7 @@ static int parsePreRead (
        }
 
        siz = sizeof( AttributeName );
-       off = 0;
+       off = offsetof( AttributeName, an_name );
        if ( ber_scanf( ber, "{M}", &an, &siz, off ) == LBER_ERROR ) {
                rs->sr_text = "preread control: decoding error";
                return LDAP_PROTOCOL_ERROR;
@@ -1035,7 +1035,7 @@ static int parsePostRead (
        }
 
        siz = sizeof( AttributeName );
-       off = 0;
+       off = offsetof( AttributeName, an_name );
        if ( ber_scanf( ber, "{M}", &an, &siz, off ) == LBER_ERROR ) {
                rs->sr_text = "postread control: decoding error";
                return LDAP_PROTOCOL_ERROR;
@@ -1255,20 +1255,25 @@ static int parseLDAPsync (
 
        tag = ber_peek_tag( ber, &len );
 
-       if ( tag == LDAP_SYNC_TAG_COOKIE ) {
+       if ( tag == LDAP_TAG_SYNC_COOKIE ) {
                struct berval tmp_bv;   
-               if (( ber_scanf( ber, /*{*/ "o}", &tmp_bv )) == LBER_ERROR ) {
+               if (( ber_scanf( ber, /*{*/ "o", &tmp_bv )) == LBER_ERROR ) {
                        rs->sr_text = "LDAP Sync control : cookie decoding error";
                        return LDAP_PROTOCOL_ERROR;
                }
                ber_bvarray_add( &op->o_sync_state.octet_str, &tmp_bv );
                slap_parse_sync_cookie( &op->o_sync_state );
-       } else {
-               if (( ber_scanf( ber, /*{*/ "}")) == LBER_ERROR ) {
-                       rs->sr_text = "LDAP Sync control : decoding error";
+       }
+       if ( tag == LDAP_TAG_RELOAD_HINT ) {
+               if (( ber_scanf( ber, /*{*/ "b", &op->o_sync_rhint )) == LBER_ERROR ) {
+                       rs->sr_text = "LDAP Sync control : rhint decoding error";
                        return LDAP_PROTOCOL_ERROR;
                }
        }
+       if (( ber_scanf( ber, /*{*/ "}")) == LBER_ERROR ) {
+                       rs->sr_text = "LDAP Sync control : decoding error";
+                       return LDAP_PROTOCOL_ERROR;
+       }
 
        (void) ber_free( ber, 1 );