On Thu, 17 Apr 2014, Tomas Babej wrote:
From 96f27c06f062dcfaa40405c50ad087d6013dc62c Mon Sep 17 00:00:00 2001
From: Tomas Babej <tba...@redhat.com>
Date: Wed, 16 Apr 2014 17:28:34 +0200
Subject: [PATCH] ipa_range_check: Fix typo when comparing strings using
strcasecmp

Part of: https://fedorahosted.org/freeipa/ticket/4137
---
daemons/ipa-slapi-plugins/ipa-range-check/ipa_range_check.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/daemons/ipa-slapi-plugins/ipa-range-check/ipa_range_check.c 
b/daemons/ipa-slapi-plugins/ipa-range-check/ipa_range_check.c
index 
b05b121f0e9cbc6fb6422b4d50f96cb7e86cda07..794e7f3c81c283897059da28b52d7be93e8eb15b
 100644
--- a/daemons/ipa-slapi-plugins/ipa-range-check/ipa_range_check.c
+++ b/daemons/ipa-slapi-plugins/ipa-range-check/ipa_range_check.c
@@ -397,10 +397,10 @@ static int check_ranges(struct range_info *r1, struct 
range_info *r2)

    /* Check if base range overlaps with existing base range.
     * Exception: ipa-ad-trust-posix ranges from the same forest */
-    if (!(strcasecmp(r1->id_range_type, AD_TRUST_POSIX_RANGE_TYPE) &&
-          strcasecmp(r2->id_range_type, AD_TRUST_POSIX_RANGE_TYPE) &&
-          r1->forest_root_id != NULL && r2->forest_root_id !=NULL &&
-          strcasecmp(r1->forest_root_id, r2->forest_root_id) == 0)) {
+    if (!((strcasecmp(r1->id_range_type, AD_TRUST_POSIX_RANGE_TYPE) == 0) &&
+          (strcasecmp(r2->id_range_type, AD_TRUST_POSIX_RANGE_TYPE) == 0) &&
+          (r1->forest_root_id != NULL && r2->forest_root_id != NULL) &&
+          (strcasecmp(r1->forest_root_id, r2->forest_root_id) == 0))) {

        if (intervals_overlap(r1->base_id, r2->base_id,
            r1->id_range_size, r2->id_range_size)){
ACK.


--
/ Alexander Bokovoy

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to