X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fback-bdb%2Fpasswd.c;h=bec86197894430933f815cbd5ff677c2b8bbcab5;hb=6df9b5459294bcc9adf27f048508d43eea58a203;hp=cb9b51aa6225fdb317191575022a38590d39d245;hpb=14662be6923878e17b2092e754a0bbc06c634a20;p=openldap diff --git a/servers/slapd/back-bdb/passwd.c b/servers/slapd/back-bdb/passwd.c index cb9b51aa62..bec8619789 100644 --- a/servers/slapd/back-bdb/passwd.c +++ b/servers/slapd/back-bdb/passwd.c @@ -91,7 +91,7 @@ retry: /* transaction retry */ bdb_cache_return_entry_w(&bdb->bi_cache, e); } Debug( LDAP_DEBUG_TRACE, "bdb_exop_passwd: retrying...\n", 0, 0, 0 ); - rc = txn_abort( ltid ); + rc = TXN_ABORT( ltid ); ltid = NULL; op->o_private = NULL; if( rc != 0 ) { @@ -102,19 +102,17 @@ retry: /* transaction retry */ ldap_pvt_thread_yield(); } - if( bdb->bi_txn ) { - /* begin transaction */ - rc = txn_begin( bdb->bi_dbenv, NULL, <id, - bdb->bi_db_opflags ); - *text = NULL; - if( rc != 0 ) { - Debug( LDAP_DEBUG_TRACE, - "bdb_exop_passwd: txn_begin failed: %s (%d)\n", - db_strerror(rc), rc, 0 ); - rc = LDAP_OTHER; - *text = "internal error"; - goto done; - } + /* begin transaction */ + rc = TXN_BEGIN( bdb->bi_dbenv, NULL, <id, + bdb->bi_db_opflags ); + *text = NULL; + if( rc != 0 ) { + Debug( LDAP_DEBUG_TRACE, + "bdb_exop_passwd: txn_begin failed: %s (%d)\n", + db_strerror(rc), rc, 0 ); + rc = LDAP_OTHER; + *text = "internal error"; + goto done; } opinfo.boi_bdb = be; @@ -144,18 +142,27 @@ retry: /* transaction retry */ goto done; } +#ifdef BDB_SUBENTRIES + if( is_entry_subentries( e ) ) { + /* entry is an alias, don't allow operation */ + *text = "authorization entry is subentry"; + rc = LDAP_OTHER; + goto done; + } +#endif +#ifdef BDB_ALIASES if( is_entry_alias( e ) ) { /* entry is an alias, don't allow operation */ *text = "authorization entry is alias"; rc = LDAP_ALIAS_PROBLEM; goto done; } - +#endif if( is_entry_referral( e ) ) { /* entry is an referral, don't allow operation */ *text = "authorization entry is referral"; - rc = LDAP_OPERATIONS_ERROR; + rc = LDAP_OTHER; goto done; } @@ -199,8 +206,12 @@ retry: /* transaction retry */ rc = LDAP_OTHER; } - if( bdb->bi_txn && rc == 0 ) { - rc = txn_commit( ltid, 0 ); + if( rc == 0 ) { + if( op->o_noop ) { + rc = TXN_ABORT( ltid ); + } else { + rc = TXN_COMMIT( ltid, 0 ); + } ltid = NULL; } op->o_private = NULL; @@ -220,7 +231,7 @@ done: } if( ltid != NULL ) { - txn_abort( ltid ); + TXN_ABORT( ltid ); op->o_private = NULL; }