Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/nslcd/myldap.c
Commit message (Collapse)AuthorAgeFilesLines
* also retry if ldap_result() failed and getting error ↵Arthur de Jong2008-09-241-1/+1
| | | | | | number returned LDAP_SUCCESS git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@787 ef36b2f9-881f-0410-afb5-c4e39611909c
* log option name instead of option value for ↵Arthur de Jong2008-09-241-1/+1
| | | | | | ldap_set_option() value git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@786 ef36b2f9-881f-0410-afb5-c4e39611909c
* LDAP_OPT_X_TLS_REQUIRE_CERT is not a booleanArthur de Jong2008-07-101-4/+5
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@773 ef36b2f9-881f-0410-afb5-c4e39611909c
* replace https:// by ldaps:// (stupid typo)Arthur de Jong2008-06-171-1/+1
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@770 ef36b2f9-881f-0410-afb5-c4e39611909c
* implement SASL authentication based on a patch by Dan ↵Arthur de Jong2008-06-141-22/+47
| | | | | | White <dwhite@olp.net> git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@762 ef36b2f9-881f-0410-afb5-c4e39611909c
* also set TLS options if an ldaps:// URL is specifiedArthur de Jong2008-06-061-2/+4
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@749 ef36b2f9-881f-0410-afb5-c4e39611909c
* miscellaneous portability improvementsArthur de Jong2008-06-061-1/+10
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@742 ef36b2f9-881f-0410-afb5-c4e39611909c
* add sanity checks to sleep calls to never sleep too long ↵Arthur de Jong2008-05-161-0/+2
| | | | | | (problems could occur when the clock moves backwards) git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@738 ef36b2f9-881f-0410-afb5-c4e39611909c
* close the connection and retry the search (once) if the ↵Arthur de Jong2008-05-111-0/+24
| | | | | | search fails with the first call to myldap_get_entry() (starting a search doesn't always give an error when the connection has been broken) git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@733 ef36b2f9-881f-0410-afb5-c4e39611909c
* split retry mechanism of myldap_search() into a new ↵Arthur de Jong2008-05-111-45/+58
| | | | | | do_retry_search() function git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@732 ef36b2f9-881f-0410-afb5-c4e39611909c
* allocate the search memory region in myldap_search() ↵Arthur de Jong2008-05-111-31/+27
| | | | | | instead of in do_try_search() and have the latter return an LDAP status code git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@731 ef36b2f9-881f-0410-afb5-c4e39611909c
* also allow closing of searches that no longer have a ↵Arthur de Jong2008-05-111-19/+13
| | | | | | valid connection and integrate myldap_search_free() into myldap_search_close() git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@730 ef36b2f9-881f-0410-afb5-c4e39611909c
* only support tls-related options if LDAP library ↵Arthur de Jong2008-05-021-0/+11
| | | | | | supports TLS, only add rebind code if ldap_set_rebind_proc() is found and only set LDAP_X_OPT_CONNECT_TIMEOUT if that option is supported git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@716 ef36b2f9-881f-0410-afb5-c4e39611909c
* support ranged attribute valuesArthur de Jong2008-05-011-1/+166
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@715 ef36b2f9-881f-0410-afb5-c4e39611909c
* also close the LDAP connection on LDAP_SERVER_DOWN ↵Arthur de Jong2008-04-261-4/+4
| | | | | | (besides LDAP_UNAVAILABLE) git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@709 ef36b2f9-881f-0410-afb5-c4e39611909c
* ensure that the connection to the LDAP server is closed ↵Arthur de Jong2008-04-261-0/+15
| | | | | | whenever any of the ldap_*() functions return LDAP_UNAVAILABLE git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@702 ef36b2f9-881f-0410-afb5-c4e39611909c
* implement new timing mechanism for retries to quickly ↵Arthur de Jong2008-04-251-29/+67
| | | | | | fail lookups to LDAP server that have been failing for some time, removing the reconnect_tries option and giving reconnect_sleeptime and reconnect_maxsleeptime options a new meaning git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@701 ef36b2f9-881f-0410-afb5-c4e39611909c
* make warning message more verbose, fix comment and don't ↵Arthur de Jong2008-04-201-2/+5
| | | | | | try to store empty results git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@686 ef36b2f9-881f-0410-afb5-c4e39611909c
* instead of using the dict module to build a cache just ↵Arthur de Jong2008-04-181-28/+37
| | | | | | store the values in an fixed-sized array because no more than 9 attributes are currently retrieved from an entry and we never retrieve the same value more than once (so the cache is useless) git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@677 ef36b2f9-881f-0410-afb5-c4e39611909c
* change dict_values_first() and dict_values_next() into ↵Arthur de Jong2008-04-171-2/+2
| | | | | | dict_loop_first() and dict_loop_next() to have a looping mechanism over keys and values git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@675 ef36b2f9-881f-0410-afb5-c4e39611909c
* split closing of LDAP session to separate funtion to ↵Arthur de Jong2008-04-051-50/+46
| | | | | | invalidate running searches always and closes connection if setting up search failed git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@656 ef36b2f9-881f-0410-afb5-c4e39611909c
* remove code that handles special cases when calling as ↵Arthur de Jong2008-04-041-27/+10
| | | | | | root (removing rootbinddn, rootbindpw, rootuse_sasl and rootsasl_authid options) git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@653 ef36b2f9-881f-0410-afb5-c4e39611909c
* revert r628 (using ldap_str2dn() instead of ↵Arthur de Jong2008-04-041-56/+98
| | | | | | ldap_explode_r?dn()) for now to make this compile on older versions of OpenLDAP git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@652 ef36b2f9-881f-0410-afb5-c4e39611909c
* only define and use do_sasl_interact() if we have a sasl ↵Arthur de Jong2008-03-301-4/+13
| | | | | | library git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@648 ef36b2f9-881f-0410-afb5-c4e39611909c
* don't warn about problems retreiving the objectClass ↵Arthur de Jong2008-03-281-3/+0
| | | | | | from en entry git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@644 ef36b2f9-881f-0410-afb5-c4e39611909c
* add StartTLS support by Ralf Haferkamp <rhafer@suse.de>Arthur de Jong2008-02-151-0/+11
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@634 ef36b2f9-881f-0410-afb5-c4e39611909c
* pass URI to do_bind() to make it work with do_rebind() ↵Arthur de Jong2008-02-151-12/+8
| | | | | | and use that URI (thanks Ralf Haferkamp <rhafer@suse.de>) git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@633 ef36b2f9-881f-0410-afb5-c4e39611909c
* replace the calls to ldap_explode_dn() and ↵Arthur de Jong2008-02-101-98/+56
| | | | | | ldap_explode_rdn() with a call to ldap_str2dn() resulting in much simpler code git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@628 ef36b2f9-881f-0410-afb5-c4e39611909c
* make some changes to allow it to compile on more platformsArthur de Jong2008-02-041-3/+5
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@625 ef36b2f9-881f-0410-afb5-c4e39611909c
* implement myldap_cpy_rdn_value() function to copy rdn ↵Arthur de Jong2008-02-021-18/+59
| | | | | | value into a buffer (functionality like myldap_get_rdn_value()) git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@609 ef36b2f9-881f-0410-afb5-c4e39611909c
* log and otherwise ignore errors in ldap_parse_page_control()Arthur de Jong2008-02-021-3/+10
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@608 ef36b2f9-881f-0410-afb5-c4e39611909c
* fix copy-pastoArthur de Jong2008-02-021-1/+1
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@607 ef36b2f9-881f-0410-afb5-c4e39611909c
* don't request paging when doing a search with scope base ↵Arthur de Jong2008-02-021-6/+11
| | | | | | and ignore errors of ldap_create_page_control() git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@606 ef36b2f9-881f-0410-afb5-c4e39611909c
* reset LDAP error flag if ldap_get_values() returned an ↵Arthur de Jong2008-02-021-1/+6
| | | | | | error because some LDAP functions don't do this correctly git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@605 ef36b2f9-881f-0410-afb5-c4e39611909c
* have proper checks and logs of all ldap operationsArthur de Jong2008-02-011-9/+30
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@604 ef36b2f9-881f-0410-afb5-c4e39611909c
* defined LDAP_DEPRECATED to also have definitions for ↵Arthur de Jong2008-01-311-0/+3
| | | | | | deprecated functions git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@595 ef36b2f9-881f-0410-afb5-c4e39611909c
* move pagectrl code into compat directoryArthur de Jong2008-01-311-1/+1
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@592 ef36b2f9-881f-0410-afb5-c4e39611909c
* integrate some compatibility code into myldap.c, the ↵Arthur de Jong2008-01-271-3/+5
| | | | | | only place it's used git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@575 ef36b2f9-881f-0410-afb5-c4e39611909c
* work around some LDAP libraries not having all optionsArthur de Jong2008-01-271-0/+13
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@573 ef36b2f9-881f-0410-afb5-c4e39611909c
* only log "connected to LDAP server" if it is a new ↵Arthur de Jong2007-12-261-6/+2
| | | | | | connection git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@535 ef36b2f9-881f-0410-afb5-c4e39611909c
* properly flag running searches as invalid if the ↵Arthur de Jong2007-12-261-15/+83
| | | | | | connection to the LDAP server is reset git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@532 ef36b2f9-881f-0410-afb5-c4e39611909c
* have myldap_get_entry() return an LDAP status code that ↵Arthur de Jong2007-12-251-2/+25
| | | | | | can signal errors in the lookup git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@531 ef36b2f9-881f-0410-afb5-c4e39611909c
* merge the do_map_error(), do_with_reconnect() into the ↵Arthur de Jong2007-12-241-172/+105
| | | | | | myldap_search() and do_try_search() functions having more understandable reconnect and retry logic git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@525 ef36b2f9-881f-0410-afb5-c4e39611909c
* remove bind_policy option because the same effect is ↵Arthur de Jong2007-12-221-9/+4
| | | | | | achieved by setting reconnect_tries to 1 git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@522 ef36b2f9-881f-0410-afb5-c4e39611909c
* integrate do_result() into myldap_get_entry() reducing ↵Arthur de Jong2007-12-221-138/+119
| | | | | | complexity and improving error handling git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@518 ef36b2f9-881f-0410-afb5-c4e39611909c
* remove duplicate commentArthur de Jong2007-12-221-1/+0
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@517 ef36b2f9-881f-0410-afb5-c4e39611909c
* bring more uniformity to log messagesArthur de Jong2007-12-221-14/+26
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@515 ef36b2f9-881f-0410-afb5-c4e39611909c
* give struct myldap_session members more logical namesArthur de Jong2007-12-221-74/+74
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@514 ef36b2f9-881f-0410-afb5-c4e39611909c
* refactor myldap code to get rid of most of the old nss ↵Arthur de Jong2007-12-201-309/+294
| | | | | | status codes, properly handle failures of ldap function calls and improve sourcecode comments git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@509 ef36b2f9-881f-0410-afb5-c4e39611909c
* add myldap_session_close() function (mainly for testing ↵Arthur de Jong2007-12-201-0/+19
| | | | | | purposes) git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@508 ef36b2f9-881f-0410-afb5-c4e39611909c