Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2012-01-09 13:11:29 +0100
committerJakub Hrozek <jhrozek@redhat.com>2012-01-09 13:11:29 +0100
commit9d0c219e8d18ad29ac070f4a5a30f5f13ab951c2 (patch)
tree78156963c033719c7d3eb6b67d24d2395401c5d9
parent579937639a4b651719c17e801729b89799a83700 (diff)
Warn if ldap_set_option() fails for LDAP_OPT_ERROR_NUM
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1593 ef36b2f9-881f-0410-afb5-c4e39611909c
-rw-r--r--nslcd/myldap.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/nslcd/myldap.c b/nslcd/myldap.c
index 5858f0f..8342c64 100644
--- a/nslcd/myldap.c
+++ b/nslcd/myldap.c
@@ -779,7 +779,8 @@ static int do_try_search(MYLDAP_SEARCH *search)
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 @@ MYLDAP_ENTRY *myldap_get_entry(MYLDAP_SEARCH *search,int *rcp)
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 @@ const char **myldap_get_values(MYLDAP_ENTRY *entry,const char *attr)
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 @@ const char **myldap_get_values_len(MYLDAP_ENTRY *entry,const char *attr)
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)
{