From: Kurt Zeilenga Date: Mon, 15 May 2006 17:51:58 +0000 (+0000) Subject: + Fixed slapd-shell (ITS#4495) X-Git-Tag: OPENLDAP_REL_ENG_2_3_22~4 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=37d3e211cbfb1bc50331c1e55941045fb08374f1;p=openldap + Fixed slapd-shell (ITS#4495) + Added slapo-syncprov extra logging --- diff --git a/CHANGES b/CHANGES index 4d366dba44..c693893dd1 100644 --- 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 diff --git a/doc/man/man5/slapd-shell.5 b/doc/man/man5/slapd-shell.5 index 3e5311efb1..1589b65575 100644 --- a/doc/man/man5/slapd-shell.5 +++ b/doc/man/man5/slapd-shell.5 @@ -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: info: .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 diff --git a/servers/slapd/overlays/syncprov.c b/servers/slapd/overlays/syncprov.c index b6f77b832a..3fe92a3e2b 100644 --- a/servers/slapd/overlays/syncprov.c +++ b/servers/slapd/overlays/syncprov.c @@ -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 ); diff --git a/servers/slapd/result.c b/servers/slapd/result.c index b8ea936aa8..c5e17337b5 100644 --- a/servers/slapd/result.c +++ b/servers/slapd/result.c @@ -36,7 +36,6 @@ #include #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 );