]> git.sur5r.net Git - openldap/commitdiff
+ Fixed slapd-shell (ITS#4495)
authorKurt Zeilenga <kurt@openldap.org>
Mon, 15 May 2006 17:51:58 +0000 (17:51 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Mon, 15 May 2006 17:51:58 +0000 (17:51 +0000)
+       Added slapo-syncprov extra logging

CHANGES
doc/man/man5/slapd-shell.5
servers/slapd/overlays/syncprov.c
servers/slapd/result.c

diff --git a/CHANGES b/CHANGES
index 4d366dba443f0b388e2c277ad2d468c88d6b0677..c693893dd1fed6638cb0a3912990e545b6630a3b 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -22,11 +22,12 @@ OpenLDAP 2.3.22 Engineering
        Fixed slapd-bdb pre/post-read freeing (ITS#4532)
        Fixed slapd-bdb pre/post-read unavailable issue (ITS#4538)
        Fixed slapd-hdb IDL sort issue (ITS#4531)
-       Fixed slapadd cn=config issue (ITS#4194)
        Fixed slapd-ldap proxyAuthz of bound identity/override (ITS#4497)
        Fixed slapd-ldap/meta protocol version propagation (ITS#4488)
        Fixed slapd-ldap fd cleanup (ITS#4474)
        Fixed slapd-ldif deadlock (ITS#4500)
+       Fixed slapd-shell (ITS#4495)
+       Fixed slapadd cn=config issue (ITS#4194)
        Fixed slapo-accesslog log purging issue (ITS#4505)
        Added slapo-accesslog reqOld feature
        Fixed slapo-auditlog missing return codes
@@ -35,6 +36,7 @@ OpenLDAP 2.3.22 Engineering
        Fixed slapo-refint delete prohibit issue (ITS#4442)
        Fixed slapo-syncprov MODs cause DELs (ITS#4423)
        Fixed slapo-syncprov/syncrepl sessionlog issue (ITS#4534)
+       Added slapo-syncprov extra logging
        Fixed slapo-translucent modifications (ITS#4527)
        Fixed slurpd potential overflow issue
        Build Environment
index 3e5311efb103dcd7e2cd001220663040cdf8b163..1589b6557555d601403a282e63109a3f6bcc4bb1 100644 (file)
@@ -121,7 +121,10 @@ want the backend to handle.
 Operations for which a command is not supplied will be refused with an
 "unwilling to perform" error.
 .LP
-The commands - except \fBunbind\fP - should output:
+The \fBsearch\fP command should output the entries in LDIF format,
+each entry followed by a blank line, and after these the RESULT below.
+.LP
+All commands except \fBunbind\fP should then output:
 .RS
 .nf
 RESULT
@@ -130,9 +133,7 @@ matched: <matched DN>
 info: <text>
 .fi
 .RE
-where only RESULT is mandatory.
-The \fBsearch\fP RESULT should be preceded by the entries in LDIF
-format, each entry followed by a blank line.
+where only the RESULT line is mandatory.
 Lines starting with `#' or `DEBUG:' are ignored.
 .SH ACCESS CONTROL
 The
index b6f77b832a11ed2b1bd5dad8cad13afd349d9547..3fe92a3e2be5bebf771c1117b007895ea60f53e6 100644 (file)
@@ -1822,13 +1822,23 @@ syncprov_search_response( Operation *op, SlapReply *rs )
                }
                if ( a ) {
                        /* Make sure entry is less than the snapshot'd contextCSN */
-                       if ( ber_bvcmp( &a->a_nvals[0], &ss->ss_ctxcsn ) > 0 )
+                       if ( ber_bvcmp( &a->a_nvals[0], &ss->ss_ctxcsn ) > 0 ) {
+                               Debug( LDAP_DEBUG_SYNC, "Entry %s CSN %s greater than snapshot %s\n",
+                                       rs->sr_entry->e_name.bv_val,
+                                       a->a_nvals[0].bv_val,
+                                       ss->ss_ctxcsn.bv_val );
                                return LDAP_SUCCESS;
+                       }
 
                        /* Don't send the ctx entry twice */
                        if ( !BER_BVISNULL( &srs->sr_state.ctxcsn ) &&
-                               bvmatch( &a->a_nvals[0], &srs->sr_state.ctxcsn ) )
+                               bvmatch( &a->a_nvals[0], &srs->sr_state.ctxcsn ) ) {
+                               Debug( LDAP_DEBUG_SYNC, "Entry %s CSN %s matches ctx %s\n",
+                                       rs->sr_entry->e_name.bv_val,
+                                       a->a_nvals[0].bv_val,
+                                       srs->sr_state.ctxcsn.bv_val );
                                return LDAP_SUCCESS;
+                       }
                }
                rs->sr_ctrls = op->o_tmpalloc( sizeof(LDAPControl *)*2,
                        op->o_tmpmemctx );
index b8ea936aa814a094c43bc9a24bf6f0706b97c725..c5e17337b577d8aa4cd6b12d27238228606b9e35 100644 (file)
@@ -36,7 +36,6 @@
 #include <ac/unistd.h>
 
 #include "slap.h"
-#include "lutil.h"
 
 const struct berval slap_dummy_bv = BER_BVNULL;
 
@@ -1421,9 +1420,43 @@ str2result(
                }
 
                if ( strncasecmp( s, "code", STRLENOF( "code" ) ) == 0 ) {
-                       if ( c != NULL && lutil_atoi( code, c ) != 0 ) {
-                               goto bailout;
+                       char    *next = NULL;
+                       long    retcode;
+
+                       if ( c == NULL ) {
+                               Debug( LDAP_DEBUG_ANY, "str2result (%s) missing value\n",
+                                   s, 0, 0 );
+                               rc = -1;
+                               continue;
                        }
+
+                       while ( isspace( (unsigned char) c[ 0 ] ) ) c++;
+                       if ( c[ 0 ] == '\0' ) {
+                               Debug( LDAP_DEBUG_ANY, "str2result (%s) missing or empty value\n",
+                                   s, 0, 0 );
+                               rc = -1;
+                               continue;
+                       }
+
+                       retcode = strtol( c, &next, 10 );
+                       if ( next == NULL || next == c ) {
+                               Debug( LDAP_DEBUG_ANY, "str2result (%s) unable to parse value\n",
+                                   s, 0, 0 );
+                               rc = -1;
+                               continue;
+                       }
+
+                       while ( isspace( (unsigned char) next[ 0 ] ) ) next++;
+                       if ( next[ 0 ] != '\0' ) {
+                               Debug( LDAP_DEBUG_ANY, "str2result (%s) extra cruft after value\n",
+                                   s, 0, 0 );
+                               rc = -1;
+                               continue;
+                       }
+
+                       /* FIXME: what if it's larger that max int? */
+                       *code = (int)retcode;
+
                } else if ( strncasecmp( s, "matched", STRLENOF( "matched" ) ) == 0 ) {
                        if ( c != NULL ) {
                                *matched = c;
@@ -1433,7 +1466,6 @@ str2result(
                                *info = c;
                        }
                } else {
-bailout:;
                        Debug( LDAP_DEBUG_ANY, "str2result (%s) unknown\n",
                            s, 0, 0 );