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 ) {
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;
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;
}
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;
}
if( ltid != NULL ) {
- txn_abort( ltid );
+ TXN_ABORT( ltid );
op->o_private = NULL;
}