summaryrefslogtreecommitdiffstats
path: root/ldap/servers/plugins/cos/cos_cache.c
diff options
context:
space:
mode:
authorNoriko Hosoi <nhosoi@redhat.com>2007-10-12 18:03:43 +0000
committerNoriko Hosoi <nhosoi@redhat.com>2007-10-12 18:03:43 +0000
commitee385e64f9dff2f36ffa8eebd872f98aadcffbdb (patch)
treeee202c50603315d75268df89ad58398b7e9bc6be /ldap/servers/plugins/cos/cos_cache.c
parentad8f6417258a3eca48da8cd8778721fdecc61078 (diff)
downloadds-ee385e64f9dff2f36ffa8eebd872f98aadcffbdb.tar.gz
ds-ee385e64f9dff2f36ffa8eebd872f98aadcffbdb.tar.xz
ds-ee385e64f9dff2f36ffa8eebd872f98aadcffbdb.zip
Resolves: #193724
Summary: "nested" filtered roles result in deadlock (Comment #12) Description: 1. Changed cache_lock to the read-write lock. 2. Instead of using the local vattr_context in vattr_test_filter, use the one set in pblock as much as possible. To achieve the goal, introduced pb_vattr_context to pblock. 3. Increased VATTR_LOOP_COUNT_MAX from 50 to 256. 4. When the loop count hit VATTR_LOOP_COUNT_MAX, it sets LDAP_UNWILLING_TO_PERFORM and returns it to the client.
Diffstat (limited to 'ldap/servers/plugins/cos/cos_cache.c')
-rw-r--r--ldap/servers/plugins/cos/cos_cache.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/ldap/servers/plugins/cos/cos_cache.c b/ldap/servers/plugins/cos/cos_cache.c
index 9eac62a1..88678868 100644
--- a/ldap/servers/plugins/cos/cos_cache.c
+++ b/ldap/servers/plugins/cos/cos_cache.c
@@ -2222,6 +2222,7 @@ bail:
returns
0 on success, we added a computed attribute
1 on outright failure
+ > LDAP ERROR CODE
-1 when doesn't know about attribute
{PARPAR} must also check the attribute does not exist if we are not
@@ -2392,10 +2393,14 @@ static int cos_cache_query_attr(cos_cache *ptheCache, vattr_context *context, Sl
int free_flags = 0;
if(pSpec && pSpec->val) {
- slapi_vattr_values_get_sp(context, e, pSpec->val, &pAttrSpecs, &type_name_disposition, &actual_type_name, 0, &free_flags);
+ ret = slapi_vattr_values_get_sp(context, e, pSpec->val, &pAttrSpecs, &type_name_disposition, &actual_type_name, 0, &free_flags);
/* MAB: We need to free actual_type_name here !!!
XXX BAD--should use slapi_vattr_values_free() */
slapi_ch_free((void **) &actual_type_name);
+ if (SLAPI_VIRTUALATTRS_LOOP_DETECTED == ret) {
+ ret = LDAP_UNWILLING_TO_PERFORM;
+ goto bail;
+ }
}
if(pAttrSpecs || pDef->cosType == COSTYPE_POINTER)
@@ -2548,6 +2553,8 @@ static int cos_cache_query_attr(cos_cache *ptheCache, vattr_context *context, Sl
ret = 1;
else if(hit == 1)
ret = 0;
+ else
+ ret = -1;
if(props)
*props = 0;