From: Pierangelo Masarati Date: Sat, 14 Oct 2006 01:08:41 +0000 (+0000) Subject: only abort update if failed pre/post read control is critical: the only thing RFC... X-Git-Tag: OPENLDAP_REL_ENG_2_3_MP~57 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=fb2d3926ce4714b83f76c059a18a0d67d12b8019;p=openldap only abort update if failed pre/post read control is critical: the only thing RFC 4527 says about failure is that in case of failure of the read, no control is appended to the result message; maybe no failure should ever occur (please review) --- diff --git a/servers/slapd/back-bdb/add.c b/servers/slapd/back-bdb/add.c index b66f19f6db..0e4959838a 100644 --- a/servers/slapd/back-bdb/add.c +++ b/servers/slapd/back-bdb/add.c @@ -395,7 +395,11 @@ retry: /* transaction retry */ Debug( LDAP_DEBUG_TRACE, "<=- " LDAP_XSTRING(bdb_add) ": post-read " "failed!\n", 0, 0, 0 ); - goto return_results; + if ( op->o_postread & SLAP_CONTROL_CRITICAL ) { + /* FIXME: is it correct to abort + * operation if control fails? */ + goto return_results; + } } } diff --git a/servers/slapd/back-bdb/delete.c b/servers/slapd/back-bdb/delete.c index 2e715f8050..64baaa48d9 100644 --- a/servers/slapd/back-bdb/delete.c +++ b/servers/slapd/back-bdb/delete.c @@ -351,7 +351,11 @@ retry: /* transaction retry */ Debug( LDAP_DEBUG_TRACE, "<=- " LDAP_XSTRING(bdb_delete) ": pre-read " "failed!\n", 0, 0, 0 ); - goto return_results; + if ( op->o_preread & SLAP_CONTROL_CRITICAL ) { + /* FIXME: is it correct to abort + * operation if control fails? */ + goto return_results; + } } } diff --git a/servers/slapd/back-bdb/modify.c b/servers/slapd/back-bdb/modify.c index 76cf27bab8..a17948dfcf 100644 --- a/servers/slapd/back-bdb/modify.c +++ b/servers/slapd/back-bdb/modify.c @@ -499,9 +499,13 @@ retry: /* transaction retry */ &slap_pre_read_bv, preread_ctrl ) ) { Debug( LDAP_DEBUG_TRACE, - "<=- " LDAP_XSTRING(bdb_modify) ": pre-read failed!\n", - 0, 0, 0 ); - goto return_results; + "<=- " LDAP_XSTRING(bdb_modify) ": pre-read " + "failed!\n", 0, 0, 0 ); + if ( op->o_preread & SLAP_CONTROL_CRITICAL ) { + /* FIXME: is it correct to abort + * operation if control fails? */ + goto return_results; + } } } @@ -570,7 +574,11 @@ retry: /* transaction retry */ Debug( LDAP_DEBUG_TRACE, "<=- " LDAP_XSTRING(bdb_modify) ": post-read failed!\n", 0, 0, 0 ); - goto return_results; + if ( op->o_postread & SLAP_CONTROL_CRITICAL ) { + /* FIXME: is it correct to abort + * operation if control fails? */ + goto return_results; + } } } diff --git a/servers/slapd/back-bdb/modrdn.c b/servers/slapd/back-bdb/modrdn.c index 6aececa31e..4ea518e900 100644 --- a/servers/slapd/back-bdb/modrdn.c +++ b/servers/slapd/back-bdb/modrdn.c @@ -578,8 +578,12 @@ retry: /* transaction retry */ { Debug( LDAP_DEBUG_TRACE, "<=- " LDAP_XSTRING(bdb_modrdn) - ": post-read failed!\n", 0, 0, 0 ); - goto return_results; + ": pre-read failed!\n", 0, 0, 0 ); + if ( op->o_preread & SLAP_CONTROL_CRITICAL ) { + /* FIXME: is it correct to abort + * operation if control fails? */ + goto return_results; + } } } @@ -717,7 +721,11 @@ retry: /* transaction retry */ Debug( LDAP_DEBUG_TRACE, "<=- " LDAP_XSTRING(bdb_modrdn) ": post-read failed!\n", 0, 0, 0 ); - goto return_results; + if ( op->o_postread & SLAP_CONTROL_CRITICAL ) { + /* FIXME: is it correct to abort + * operation if control fails? */ + goto return_results; + } } }