URL: https://github.com/SSSD/sssd/pull/27
Author: mzidek-rh
 Title: #27: Minor code changes
Action: opened

PR body:
"""
Some small changes in the code.
"""

To pull the PR as Git branch:
git remote add ghsssd https://github.com/SSSD/sssd
git fetch ghsssd pull/27/head:pr27
git checkout pr27
From b861d0b4887f49cc9a43bea0e95a2156603b7db3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michal=20=C5=BDidek?= <mzi...@redhat.com>
Date: Fri, 16 Sep 2016 15:08:03 +0200
Subject: [PATCH 1/2] SDAP: Special dbg msg when exceeding adminlimit

Use different debug message LDAP_SIZELIMIT_EXCEEDED
and LDAP_ADMINLIMIT_EXCEEDED.
---
 src/providers/ldap/sdap_async.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/providers/ldap/sdap_async.c b/src/providers/ldap/sdap_async.c
index f374112..b260c09 100644
--- a/src/providers/ldap/sdap_async.c
+++ b/src/providers/ldap/sdap_async.c
@@ -1526,15 +1526,20 @@ static void sdap_get_generic_op_finished(struct sdap_op *op,
                   sss_ldap_err2string(result), result,
                   errmsg ? errmsg : "no errmsg set");
 
-        if (result == LDAP_SIZELIMIT_EXCEEDED
-                || result == LDAP_ADMINLIMIT_EXCEEDED) {
+        if (result == LDAP_SIZELIMIT_EXCEEDED) {
             /* Try to return what we've got */
-
             if ( ! (state->flags & SDAP_SRCH_FLG_SIZELIMIT_SILENT)) {
                 DEBUG(SSSDBG_MINOR_FAILURE,
                       "LDAP sizelimit was exceeded, "
                       "returning incomplete data\n");
             }
+        } else if (result == LDAP_ADMINLIMIT_EXCEEDED) {
+            /* Try to return what we've got */
+            if ( ! (state->flags & SDAP_SRCH_FLG_SIZELIMIT_SILENT)) {
+                DEBUG(SSSDBG_MINOR_FAILURE,
+                      "LDAP adminlimit was exceeded, "
+                      "returning incomplete data\n");
+            }
         } else if (result == LDAP_INAPPROPRIATE_MATCHING) {
             /* This error should only occur when we're testing for
              * specialized functionality like the ldap matching rule

From 50f214ac00350cde7198df2827a321502e77f00e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michal=20=C5=BDidek?= <mzi...@redhat.com>
Date: Fri, 16 Sep 2016 15:12:01 +0200
Subject: [PATCH 2/2] SDAP: Rename flag to silence debug msg

Rename SDAP_SRCH_FLG_SIZELIMIT_SILENT into
SDAP_SRCH_FLG_SILENT, because it is used
for both sizelimit and adminlimit.
---
 src/providers/ldap/sdap_async.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/providers/ldap/sdap_async.c b/src/providers/ldap/sdap_async.c
index b260c09..70f295d 100644
--- a/src/providers/ldap/sdap_async.c
+++ b/src/providers/ldap/sdap_async.c
@@ -1187,7 +1187,7 @@ static void sdap_get_generic_op_finished(struct sdap_op *op,
 
 enum {
     /* Be silent about exceeded size limit */
-    SDAP_SRCH_FLG_SIZELIMIT_SILENT = 1 << 0,
+    SDAP_SRCH_FLG_SILENT = 1 << 0,
 
     /* Allow paging */
     SDAP_SRCH_FLG_PAGING           = 1 << 1,
@@ -1528,14 +1528,14 @@ static void sdap_get_generic_op_finished(struct sdap_op *op,
 
         if (result == LDAP_SIZELIMIT_EXCEEDED) {
             /* Try to return what we've got */
-            if ( ! (state->flags & SDAP_SRCH_FLG_SIZELIMIT_SILENT)) {
+            if ( ! (state->flags & SDAP_SRCH_FLG_SILENT)) {
                 DEBUG(SSSDBG_MINOR_FAILURE,
                       "LDAP sizelimit was exceeded, "
                       "returning incomplete data\n");
             }
         } else if (result == LDAP_ADMINLIMIT_EXCEEDED) {
             /* Try to return what we've got */
-            if ( ! (state->flags & SDAP_SRCH_FLG_SIZELIMIT_SILENT)) {
+            if ( ! (state->flags & SDAP_SRCH_FLG_SILENT)) {
                 DEBUG(SSSDBG_MINOR_FAILURE,
                       "LDAP adminlimit was exceeded, "
                       "returning incomplete data\n");
@@ -2669,7 +2669,7 @@ static errno_t sdap_posix_check_next(struct tevent_req *req)
                                  state->attrs,
                                  NULL, NULL, 1, state->timeout,
                                  sdap_posix_check_parse, state,
-                                 SDAP_SRCH_FLG_SIZELIMIT_SILENT);
+                                 SDAP_SRCH_FLG_SILENT);
     if (subreq == NULL) {
         return ENOMEM;
     }
_______________________________________________
sssd-devel mailing list -- sssd-devel@lists.fedorahosted.org
To unsubscribe send an email to sssd-devel-le...@lists.fedorahosted.org

Reply via email to