From ee385e64f9dff2f36ffa8eebd872f98aadcffbdb Mon Sep 17 00:00:00 2001 From: Noriko Hosoi Date: Fri, 12 Oct 2007 18:03:43 +0000 Subject: 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. --- ldap/servers/plugins/cos/cos_cache.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'ldap/servers/plugins/cos/cos_cache.c') 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; -- cgit