Monday, April 4, 2016

[389-commits] ldap/servers

ldap/servers/slapd/back-ldbm/cache.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit d7bbbf29b6dcf1a282e8054c407cf9ee31cc2364
Author: Noriko Hosoi <nhosoi@redhat.com>
Date: Mon Apr 4 17:23:16 2016 -0700

Ticket #48374 - entry cache locks not released in error conditions

Description: Ludwig Krispenz <lkrispen@redhat.com> found 2 missing unlocks
in the cache.c code. This patch is created based upon his report. I also
scanned the code and did not find further mistakes.

https://fedorahosted.org/389/ticket/48374

Reviewed by nhosoi@redhat.com.

diff --git a/ldap/servers/slapd/back-ldbm/cache.c b/ldap/servers/slapd/back-ldbm/cache.c
index f6a9cf5..9db51e9 100644
--- a/ldap/servers/slapd/back-ldbm/cache.c
+++ b/ldap/servers/slapd/back-ldbm/cache.c
@@ -1049,7 +1049,7 @@ static int entrycache_replace(struct cache *cache, struct backentry *olde,
if (!add_hash(cache->c_dntable, (void *)newndn, strlen(newndn), newe, (void **)&alte)) {
LOG("entry cache replace (%s): can't add to dn table (returned %s)\n",
newndn, alte?slapi_entry_get_dn(alte->ep_entry):"none", 0);
- cache_lock(cache);
+ cache_unlock(cache);
return 1;
}
if (!add_hash(cache->c_idtable, &(newe->ep_id), sizeof(ID), newe, (void **)&alte)) {
@@ -1507,6 +1507,7 @@ int cache_lock_entry(struct cache *cache, struct backentry *e)
if (! e->ep_mutexp) {
e->ep_mutexp = PR_NewMonitor();
if (!e->ep_mutexp) {
+ PR_Unlock(cache->c_emutexalloc_mutex);
LOG("<= cache_lock_entry (DELETED)\n", 0, 0, 0);
LDAPDebug1Arg(LDAP_DEBUG_ANY,
"cache_lock_entry: failed to create a lock for %s\n",

--
389 commits mailing list
389-commits@%(host_name)s
http://lists.fedoraproject.org/admin/lists/389-commits@lists.fedoraproject.org

No comments:

Post a Comment