X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fbackend.c;h=3048dd41bb26e3f411aa4fda2d3676fb0f1b91f7;hb=ed471a4d53b9bcd2cc89410743ffb4bd58b5fc05;hp=c71e1df78c8414133d3cb927f8071248786ad3d5;hpb=97e526cb2dcf5e485f0e130636afefeaf5b57447;p=openldap diff --git a/servers/slapd/backend.c b/servers/slapd/backend.c index c71e1df78c..3048dd41bb 100644 --- a/servers/slapd/backend.c +++ b/servers/slapd/backend.c @@ -7,6 +7,7 @@ #include "portable.h" +#include "slapi_common.h" #include @@ -16,6 +17,7 @@ #include #include "slap.h" +#include "slapi.h" #include "lutil.h" #include "lber_pvt.h" @@ -686,12 +688,60 @@ backend_unbind( Operation *op ) { - int i; + int i; + int rc; + Slapi_PBlock *pb = op->o_pb; + +#if defined( LDAP_SLAPI ) + slapi_pblock_set( pb, SLAPI_CONNECTION, (void *)conn ); + slapi_pblock_set( pb, SLAPI_OPERATION, (void *)op ); +#endif /* defined( LDAP_SLAPI ) */ for ( i = 0; i < nbackends; i++ ) { +#if defined( LDAP_SLAPI ) + slapi_pblock_set( pb, SLAPI_BACKEND, (void *)&backends[i] ); + rc = doPluginFNs( &backends[i], SLAPI_PLUGIN_PRE_UNBIND_FN, + (Slapi_PBlock *)pb ); + if ( rc != 0 && rc != LDAP_OTHER ) { + /* + * either there is no preOp (unbind) plugins + * or a plugin failed. Just log it. + * + * FIXME: is this correct? + */ +#ifdef NEW_LOGGING + LDAP_LOG( OPERATION, INFO, "do_bind: Unbind preOps " + "failed\n", 0, 0, 0); +#else + Debug(LDAP_DEBUG_TRACE, "do_bind: Unbind preOps " + "failed.\n", 0, 0, 0); +#endif + } +#endif /* defined( LDAP_SLAPI ) */ + if ( backends[i].be_unbind ) { (*backends[i].be_unbind)( &backends[i], conn, op ); } + +#if defined( LDAP_SLAPI ) + rc = doPluginFNs( &backends[i], SLAPI_PLUGIN_POST_UNBIND_FN, + (Slapi_PBlock *)pb ); + if ( rc != 0 && rc != LDAP_OTHER ) { + /* + * either there is no postOp (unbind) plugins + * or a plugin failed. Just log it. + * + * FIXME: is this correct? + */ +#ifdef NEW_LOGGING + LDAP_LOG( OPERATION, INFO, "do_unbind: Unbind postOps " + "failed\n", 0, 0, 0); +#else + Debug(LDAP_DEBUG_TRACE, "do_unbind: Unbind postOps " + "failed.\n", 0, 0, 0); +#endif + } +#endif /* defined( LDAP_SLAPI ) */ } return 0; @@ -910,7 +960,9 @@ backend_check_restrictions( return LDAP_CONFIDENTIALITY_REQUIRED; } - if( op->o_ndn.bv_len == 0 ) { + if( !( global_allows & SLAP_ALLOW_UPDATE_ANON ) && + op->o_ndn.bv_len == 0 ) + { *text = "modifications require authentication"; return LDAP_STRONG_AUTH_REQUIRED; } @@ -978,7 +1030,7 @@ backend_check_restrictions( if ( ! ( conn->c_listener->sl_perms & S_IXUSR ) ) { /* no "x" mode means bind required */ *text = "bind required on this listener"; - return LDAP_CONFIDENTIALITY_REQUIRED; + return LDAP_STRONG_AUTH_REQUIRED; } }