Jelajahi Sumber

Ticket 48836 replication session fails because of permission denied

Bug Description:
    https://fedorahosted.org/389/ticket/48597 fix introduced a regression where it
    tests (in replica_is_updatedn) the returned value of replica_updatedn_list_ismember
    against PR_TRUE.
    Actually replica_updatedn_list_ismember returns PR_FALSE or a pointer to the found value
    but not PR_TRUE.

Fix Description:
    replica_updatedn_list_ismember should return PR_TRUE or PR_FALSE where the cast make it return
    values that are different from PR_TRUE or PR_FALSE

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

Reviewed by: Noriko Hosoi, Ludwig Krispenz (thanks for your reviews)

Platforms tested: F24

Flag Day: no

Doc impact: no
Thierry Bordaz 9 tahun lalu
induk
melakukan
35f6fb8fca

+ 1 - 0
ldap/servers/plugins/replication/repl5_replica.c

@@ -1155,6 +1155,7 @@ replica_is_updatedn (Replica *r, const Slapi_DN *sdn)
     if (r->updatedn_list) {
         result = replica_updatedn_list_ismember(r->updatedn_list, sdn);
         if (result == PR_TRUE) {
+            /* sdn is present in the updatedn_list */
             replica_unlock(r->repl_lock);
             return result;
         }

+ 4 - 1
ldap/servers/plugins/replication/repl5_updatedn_list.c

@@ -284,7 +284,10 @@ replica_updatedn_list_ismember(ReplicaUpdateDNList list, const Slapi_DN *dn)
 
 	/* Bug 605169 - null ndn would cause core dump */
 	if ( ndn ) {
-		ret = (PRBool)((uintptr_t)PL_HashTableLookupConst(hash, ndn));
+		if ((uintptr_t)PL_HashTableLookupConst(hash, ndn))
+                    ret = PR_TRUE;
+                else
+                    ret = PR_FALSE;
 	}
 
 	return ret;