Only check opinfo.boi_err when ACL check failed.

This commit is contained in:
Howard Chu 2003-02-26 12:49:21 +00:00
parent 18554e7511
commit d7aac0a9d5
5 changed files with 75 additions and 66 deletions

View File

@ -218,13 +218,13 @@ retry: /* transaction retry */
rc = access_allowed( be, conn, op, p,
children, NULL, ACL_WRITE, NULL );
switch( opinfo.boi_err ) {
case DB_LOCK_DEADLOCK:
case DB_LOCK_NOTGRANTED:
goto retry;
}
if ( ! rc ) {
switch( opinfo.boi_err ) {
case DB_LOCK_DEADLOCK:
case DB_LOCK_NOTGRANTED:
goto retry;
}
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"bdb_add: no write access to parent\n", 0, 0, 0 );
@ -318,13 +318,13 @@ retry: /* transaction retry */
p = NULL;
switch( opinfo.boi_err ) {
case DB_LOCK_DEADLOCK:
case DB_LOCK_NOTGRANTED:
goto retry;
}
if ( ! rc ) {
switch( opinfo.boi_err ) {
case DB_LOCK_DEADLOCK:
case DB_LOCK_NOTGRANTED:
goto retry;
}
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"bdb_add: no write access to parent\n", 0, 0, 0 );
@ -381,13 +381,13 @@ retry: /* transaction retry */
rc = access_allowed( be, conn, op, e,
entry, NULL, ACL_WRITE, NULL );
switch( opinfo.boi_err ) {
case DB_LOCK_DEADLOCK:
case DB_LOCK_NOTGRANTED:
goto retry;
}
if ( ! rc ) {
switch( opinfo.boi_err ) {
case DB_LOCK_DEADLOCK:
case DB_LOCK_NOTGRANTED:
goto retry;
}
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"bdb_add: no write access to entry\n", 0, 0, 0 );

View File

@ -164,13 +164,13 @@ retry: /* transaction retry */
bdb_unlocked_cache_return_entry_r(&bdb->bi_cache, p);
p = NULL;
switch( opinfo.boi_err ) {
case DB_LOCK_DEADLOCK:
case DB_LOCK_NOTGRANTED:
goto retry;
}
if ( !rc ) {
switch( opinfo.boi_err ) {
case DB_LOCK_DEADLOCK:
case DB_LOCK_NOTGRANTED:
goto retry;
}
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"<=- bdb_delete: no write access to parent\n", 0, 0, 0 );
@ -197,13 +197,13 @@ retry: /* transaction retry */
p = NULL;
switch( opinfo.boi_err ) {
case DB_LOCK_DEADLOCK:
case DB_LOCK_NOTGRANTED:
goto retry;
}
if ( !rc ) {
switch( opinfo.boi_err ) {
case DB_LOCK_DEADLOCK:
case DB_LOCK_NOTGRANTED:
goto retry;
}
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"<=- bdb_delete: no access to parent\n", 0, 0, 0 );
@ -300,13 +300,13 @@ retry: /* transaction retry */
rc = access_allowed( be, conn, op, e,
entry, NULL, ACL_WRITE, NULL );
switch( opinfo.boi_err ) {
case DB_LOCK_DEADLOCK:
case DB_LOCK_NOTGRANTED:
goto retry;
}
if ( !rc ) {
switch( opinfo.boi_err ) {
case DB_LOCK_DEADLOCK:
case DB_LOCK_NOTGRANTED:
goto retry;
}
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"<=- bdb_delete: no write access to entry\n", 0, 0, 0 );

View File

@ -451,6 +451,9 @@ retry: /* transaction retry */
"bdb_modify: modify failed (%d)\n",
rc, 0, 0 );
#endif
if ( (rc == LDAP_INSUFFICIENT_ACCESS) && opinfo.boi_err ) {
rc = opinfo.boi_err;
}
switch( rc ) {
case DB_LOCK_DEADLOCK:
case DB_LOCK_NOTGRANTED:

View File

@ -193,13 +193,13 @@ retry: /* transaction retry */
/* check write on old entry */
rc = access_allowed( be, conn, op, e, entry, NULL, ACL_WRITE, NULL );
switch( opinfo.boi_err ) {
case DB_LOCK_DEADLOCK:
case DB_LOCK_NOTGRANTED:
goto retry;
}
if ( ! rc ) {
switch( opinfo.boi_err ) {
case DB_LOCK_DEADLOCK:
case DB_LOCK_NOTGRANTED:
goto retry;
}
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"==>bdb_modrdn: no access to entry\n", 0, 0, 0 );
@ -278,13 +278,13 @@ retry: /* transaction retry */
rc = access_allowed( be, conn, op, p,
children, NULL, ACL_WRITE, NULL );
switch( opinfo.boi_err ) {
case DB_LOCK_DEADLOCK:
case DB_LOCK_NOTGRANTED:
goto retry;
}
if ( ! rc ) {
switch( opinfo.boi_err ) {
case DB_LOCK_DEADLOCK:
case DB_LOCK_NOTGRANTED:
goto retry;
}
rc = LDAP_INSUFFICIENT_ACCESS;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
@ -334,15 +334,15 @@ retry: /* transaction retry */
rc = access_allowed( be, conn, op, p,
children, NULL, ACL_WRITE, NULL );
switch( opinfo.boi_err ) {
case DB_LOCK_DEADLOCK:
case DB_LOCK_NOTGRANTED:
goto retry;
}
p = NULL;
if ( ! rc ) {
switch( opinfo.boi_err ) {
case DB_LOCK_DEADLOCK:
case DB_LOCK_NOTGRANTED:
goto retry;
}
rc = LDAP_INSUFFICIENT_ACCESS;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
@ -481,13 +481,13 @@ retry: /* transaction retry */
rc = access_allowed( be, conn, op, np, children,
NULL, ACL_WRITE, NULL );
switch( opinfo.boi_err ) {
case DB_LOCK_DEADLOCK:
case DB_LOCK_NOTGRANTED:
goto retry;
}
if( ! rc ) {
switch( opinfo.boi_err ) {
case DB_LOCK_DEADLOCK:
case DB_LOCK_NOTGRANTED:
goto retry;
}
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"==>bdb_modrdn: no wr to newSup children\n", 0, 0, 0 );
@ -548,15 +548,15 @@ retry: /* transaction retry */
rc = access_allowed( be, conn, op, np,
children, NULL, ACL_WRITE, NULL );
switch( opinfo.boi_err ) {
case DB_LOCK_DEADLOCK:
case DB_LOCK_NOTGRANTED:
goto retry;
}
np = NULL;
if ( ! rc ) {
switch( opinfo.boi_err ) {
case DB_LOCK_DEADLOCK:
case DB_LOCK_NOTGRANTED:
goto retry;
}
rc = LDAP_INSUFFICIENT_ACCESS;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
@ -771,6 +771,9 @@ retry: /* transaction retry */
&text, textbuf, textlen );
if( rc != LDAP_SUCCESS ) {
if ( ( rc == LDAP_INSUFFICIENT_ACCESS ) && opinfo.boi_err ) {
rc = opinfo.boi_err;
}
switch( rc ) {
case DB_LOCK_DEADLOCK:
case DB_LOCK_NOTGRANTED:

View File

@ -227,6 +227,9 @@ retry: /* transaction retry */
rc = bdb_modify_internal( be, conn, op, ltid,
&ml, e, text, textbuf, textlen );
if ( (rc == LDAP_INSUFFICIENT_ACCESS) && opinfo.boi_err ) {
rc = opinfo.boi_err;
}
switch(rc) {
case DB_LOCK_DEADLOCK:
case DB_LOCK_NOTGRANTED: