mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-20 13:53:21 -05:00
check for update dn
This commit is contained in:
parent
a3ded4782e
commit
b1688462ce
6 changed files with 27 additions and 12 deletions
|
|
@ -241,8 +241,7 @@ do_add( Connection *conn, Operation *op )
|
|||
*/
|
||||
if ( be->be_add ) {
|
||||
/* do the update here */
|
||||
int repl_user = (be->be_update_ndn != NULL &&
|
||||
strcmp( be->be_update_ndn, op->o_ndn ) == 0);
|
||||
int repl_user = be_isupdate(be, op->o_ndn );
|
||||
#ifndef SLAPD_MULTIMASTER
|
||||
if ( be->be_update_ndn == NULL || repl_user )
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -584,6 +584,24 @@ be_isroot( Backend *be, const char *ndn )
|
|||
return(rc);
|
||||
}
|
||||
|
||||
int
|
||||
be_isupdate( Backend *be, const char *ndn )
|
||||
{
|
||||
int rc;
|
||||
|
||||
if ( ndn == NULL || *ndn == '\0' ) {
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
if ( be->be_update_ndn == NULL || *be->be_update_ndn == '\0' ) {
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
rc = strcmp( be->be_update_ndn, ndn ) ? 0 : 1;
|
||||
|
||||
return(rc);
|
||||
}
|
||||
|
||||
char *
|
||||
be_root_dn( Backend *be )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -161,14 +161,13 @@ do_delete(
|
|||
if ( be->be_delete ) {
|
||||
/* do the update here */
|
||||
#ifndef SLAPD_MULTIMASTER
|
||||
if ( be->be_update_ndn == NULL ||
|
||||
strcmp( be->be_update_ndn, op->o_ndn ) == 0 )
|
||||
int repl_user = be_isupdate( be, op->o_ndn );
|
||||
if ( be->be_update_ndn == NULL || repl_user )
|
||||
#endif
|
||||
{
|
||||
if ( (*be->be_delete)( be, conn, op, dn, ndn ) == 0 ) {
|
||||
#ifdef SLAPD_MULTIMASTER
|
||||
if (be->be_update_ndn == NULL ||
|
||||
strcmp( be->be_update_ndn, op->o_ndn ))
|
||||
if (be->be_update_ndn == NULL || !repl_user )
|
||||
#endif
|
||||
{
|
||||
replog( be, op, dn, NULL );
|
||||
|
|
|
|||
|
|
@ -287,8 +287,7 @@ do_modify(
|
|||
*/
|
||||
if ( be->be_modify ) {
|
||||
/* do the update here */
|
||||
int repl_user = (be->be_update_ndn != NULL &&
|
||||
strcmp( be->be_update_ndn, op->o_ndn ) == 0);
|
||||
int repl_user = be_isupdate( be, op->o_ndn );
|
||||
#ifndef SLAPD_MULTIMASTER
|
||||
/* Multimaster slapd does not have to check for replicator dn
|
||||
* because it accepts each modify request
|
||||
|
|
|
|||
|
|
@ -306,15 +306,14 @@ do_modrdn(
|
|||
if ( be->be_modrdn ) {
|
||||
/* do the update here */
|
||||
#ifndef SLAPD_MULTIMASTER
|
||||
if ( be->be_update_ndn == NULL ||
|
||||
strcmp( be->be_update_ndn, op->o_ndn ) == 0 )
|
||||
int repl_user = be_isupdate( be, op->o_ndn );
|
||||
if ( be->be_update_ndn == NULL || repl_user )
|
||||
#endif
|
||||
{
|
||||
if ( (*be->be_modrdn)( be, conn, op, dn, ndn, newrdn,
|
||||
deloldrdn, newSuperior ) == 0
|
||||
#ifdef SLAPD_MULTIMASTER
|
||||
&& ( be->be_update_ndn == NULL ||
|
||||
strcmp( be->be_update_ndn, op->o_ndn ) )
|
||||
&& ( be->be_update_ndn == NULL || !repl_user )
|
||||
#endif
|
||||
) {
|
||||
struct replog_moddn moddn;
|
||||
|
|
|
|||
|
|
@ -158,6 +158,7 @@ LDAP_SLAPD_F (int) be_issuffix LDAP_P(( Backend *be, const char *suffix ));
|
|||
LDAP_SLAPD_F (int) be_isroot LDAP_P(( Backend *be, const char *ndn ));
|
||||
LDAP_SLAPD_F (int) be_isroot_pw LDAP_P(( Backend *be,
|
||||
Connection *conn, const char *ndn, struct berval *cred ));
|
||||
LDAP_SLAPD_F (int) be_isupdate LDAP_P(( Backend *be, const char *ndn ));
|
||||
LDAP_SLAPD_F (char *) be_root_dn LDAP_P(( Backend *be ));
|
||||
LDAP_SLAPD_F (int) be_entry_release_rw LDAP_P((
|
||||
BackendDB *be, Connection *c, Operation *o, Entry *e, int rw ));
|
||||
|
|
|
|||
Loading…
Reference in a new issue