lists.arthurdejong.org
RSS feed

nss-pam-ldapd commit: r1593 - nss-pam-ldapd/nslcd

[Date Prev][Date Next] [Thread Prev][Thread Next]

nss-pam-ldapd commit: r1593 - nss-pam-ldapd/nslcd



Author: jhrozek
Date: Mon Jan  9 13:11:29 2012
New Revision: 1593
URL: http://arthurdejong.org/viewvc/nss-pam-ldapd?revision=1593&view=revision

Log:
Warn if ldap_set_option() fails for LDAP_OPT_ERROR_NUM

Modified:
   nss-pam-ldapd/nslcd/myldap.c

Modified: nss-pam-ldapd/nslcd/myldap.c
==============================================================================
--- nss-pam-ldapd/nslcd/myldap.c        Mon Jan  9 13:10:23 2012        (r1592)
+++ nss-pam-ldapd/nslcd/myldap.c        Mon Jan  9 13:11:29 2012        (r1593)
@@ -779,7 +779,8 @@
       log_log(LOG_WARNING,"ldap_create_page_control() failed: 
%s",ldap_err2string(rc));
       /* clear error flag */
       rc=LDAP_SUCCESS;
-      ldap_set_option(search->session->ld,LDAP_OPT_ERROR_NUMBER,&rc);
+      if 
(ldap_set_option(search->session->ld,LDAP_OPT_ERROR_NUMBER,&rc)!=LDAP_SUCCESS)
+        log_log(LOG_WARNING,"failed to clear the error flag\n");
       pServerCtrls=NULL;
     }
   }
@@ -1167,7 +1168,8 @@
                                 ldap_err2string(rc));
             /* clear error flag */
             rc=LDAP_SUCCESS;
-            ldap_set_option(search->session->ld,LDAP_OPT_ERROR_NUMBER,&rc);
+            if 
(ldap_set_option(search->session->ld,LDAP_OPT_ERROR_NUMBER,&rc)!=LDAP_SUCCESS)
+              log_log(LOG_WARNING,"failed to clear the error flag\n");
           }
           /* TODO: handle the above return code?? */
           ldap_controls_free(resultcontrols);
@@ -1433,7 +1435,8 @@
     if (rc==LDAP_DECODING_ERROR)
     {
       rc=LDAP_SUCCESS;
-      ldap_set_option(entry->search->session->ld,LDAP_OPT_ERROR_NUMBER,&rc);
+      if 
(ldap_set_option(entry->search->session->ld,LDAP_OPT_ERROR_NUMBER,&rc)!=LDAP_SUCCESS)
+        log_log(LOG_WARNING,"failed to clear the error flag\n");
     }
     else if (rc==LDAP_SUCCESS)
     {
@@ -1542,7 +1545,8 @@
     if (rc==LDAP_DECODING_ERROR)
     {
       rc=LDAP_SUCCESS;
-      ldap_set_option(entry->search->session->ld,LDAP_OPT_ERROR_NUMBER,&rc);
+      if 
(ldap_set_option(entry->search->session->ld,LDAP_OPT_ERROR_NUMBER,&rc)!=LDAP_SUCCESS)
+        log_log(LOG_WARNING,"failed to clear the error flag\n");
     }
     else if (rc==LDAP_SUCCESS)
     {
-- 
To unsubscribe send an email to
nss-pam-ldapd-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-commits/