Commit Graph

71 Commits

Author SHA1 Message Date
130eac3ae6 mod_ldap: Use the LDAP API directly to implement the rebind callback
for modern versions of OpenLDAP, avoiding the overhead of the apr-util
implementation.

* modules/ldap/util_ldap.c:
  Define USE_APR_LDAP_REBIND if a modern version of OpenSSL is used.
  (uldap_rebind_proc): New function.
  (uldap_rebind_init, uldap_rebind_add): Define, using either the
  callback or the (bad) APR-util versions.
  (uldap_connection_unbind): Clear the rebind pool to remove rebind
  references prior to destroying the LDAP *.
  Omit for !USE_APR_LDAP_REBIND.
  (uldap_connection_init): Use new wrappers, only create the rebind
  pool if USE_APR_LDAP_REBIND.

* include/util_ldap.h: Don't include apr_ldap_rebind.h here.

PR: 64414
Github: closes #124


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1878890 13f79535-47bb-0310-9956-ffa450edef68
2020-06-16 14:31:26 +00:00
85760859ca Fix spelling errors found by codespell. [skip ci]
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1873985 13f79535-47bb-0310-9956-ffa450edef68
2020-02-13 18:15:57 +00:00
d79b514c4b Fix spelling in comments and text files.
No functional change.
PR 59990


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1756038 13f79535-47bb-0310-9956-ffa450edef68
2016-08-11 19:50:02 +00:00
2eaa646655 make LDAPConnectionPoolTTL more conservative, use r->request_time rather than
end-of-request time, and only update it after a round-trip with the LDAP
server rather than every time we check back into the pool.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1607960 13f79535-47bb-0310-9956-ffa450edef68
2014-07-05 00:06:15 +00:00
89054403cf change r1500483 to only be enabled when building against the MS LDAP SDK.
Guenter, please verify this still works for you.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1551802 13f79535-47bb-0310-9956-ffa450edef68
2013-12-18 02:05:50 +00:00
d560c4b0a2 Fixed some Windows warnings.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1500483 13f79535-47bb-0310-9956-ffa450edef68
2013-07-07 16:57:16 +00:00
70366501e4 PR54587: LDAP connections used for authn were not respecting
LDAPConnectionPoolTimeout due to confusion over what "bound" means.

Added some LDAP trace at TRACE5 to track how LDAP connections are
reused and rebound.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1452551 13f79535-47bb-0310-9956-ffa450edef68
2013-03-04 21:54:24 +00:00
0c13e0ffbe followup to r1348036, MSSDK's WinLdap.h uses an enum for LDAP_* status codes, so the block is not included
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1408402 13f79535-47bb-0310-9956-ffa450edef68
2012-11-12 18:54:43 +00:00
df256851fa * include/util_ldap.h: Treat LDAP_UNAVAILABLE as a transient error
with non-MS LDAP SDKs; seen with OpenLDAP against Novell eDirectory.

Submitted by: Filip Valder <filip.valder vsb.cz> (via RH bugzilla)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1348036 13f79535-47bb-0310-9956-ffa450edef68
2012-06-08 12:19:30 +00:00
103f776c25 Cleanup effort in prep for GA push:
Trim trailing whitespace... no func change



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1174748 13f79535-47bb-0310-9956-ffa450edef68
2011-09-23 13:38:09 +00:00
f5b63175fc mod_ldap: remove hard-coded loops of 10 retries w/o delay with a configurable
number of retries (LDAPRetries, default 3) and configurable delay between 
retries (LDAPRetryDelay, no delay by default).

The LDAP connection is re-initted every other retry, instead of
on the fifth retry -- this was a much more recent addition then
the basic looping behavior.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1156790 13f79535-47bb-0310-9956-ffa450edef68
2011-08-11 20:05:18 +00:00
480b79f5a5 * Make trunk compile with APR trunk again (without LDAP support of course), by
ensuring that we only include the include files of the APR / APU LDAP API if
  we use 1.x. Move stuff that depends on it inside the APR_HAS_LDAP block.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1150559 13f79535-47bb-0310-9956-ffa450edef68
2011-07-25 07:08:33 +00:00
602791140b Revert r1129808:
Incorporate the ap_ldap incomplete API, as there is no interest or effort
    at APR to make this a complete abstraction, and it was voted 'off the island'
    with APR 2.0.  This will allow httpd 2.3 to build against either apr-2.0
    or apr+util 1.x.

This also reverts part of r1142938, which needs to be re-done.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/revert-ap-ldap@1150172 13f79535-47bb-0310-9956-ffa450edef68
2011-07-23 17:29:42 +00:00
9674eb32cb Revert r1129886:
Shift declaration logic of LDAP_DECLARE to ap_ldap.h from util_ldap.h



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/revert-ap-ldap@1150169 13f79535-47bb-0310-9956-ffa450edef68
2011-07-23 17:21:02 +00:00
533704a7fa Revert r1131393:
Several fixes for the ap_ldap build logic. This should fix compilation
    without --with-ldap.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/revert-ap-ldap@1150165 13f79535-47bb-0310-9956-ffa450edef68
2011-07-23 17:16:54 +00:00
47e13744e8 Revert r1143225:
Removed define which is now in ap_ldap.h.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/revert-ap-ldap@1150158 13f79535-47bb-0310-9956-ffa450edef68
2011-07-23 17:04:57 +00:00
5cbce65f88 Removed define which is now in ap_ldap.h.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1143225 13f79535-47bb-0310-9956-ffa450edef68
2011-07-05 23:39:29 +00:00
ec64e1a29f Several fixes for the ap_ldap build logic. This should fix compilation
without --with-ldap.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1131393 13f79535-47bb-0310-9956-ffa450edef68
2011-06-04 13:31:49 +00:00
07c1a9d29c Shift declaration logic of LDAP_DECLARE to ap_ldap.h from util_ldap.h
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1129886 13f79535-47bb-0310-9956-ffa450edef68
2011-05-31 19:57:07 +00:00
37770675d7 Incorporate the ap_ldap incomplete API, as there is no interest or effort
at APR to make this a complete abstraction, and it was voted 'off the island'
with APR 2.0.  This will allow httpd 2.3 to build against either apr-2.0
or apr+util 1.x.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1129808 13f79535-47bb-0310-9956-ffa450edef68
2011-05-31 17:10:11 +00:00
4355155ced fix incorrect type of LDAP connection pool member, fix naming fors
style guidlines



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1086432 13f79535-47bb-0310-9956-ffa450edef68
2011-03-28 22:40:20 +00:00
03c032b4e4 Lay some groundwork for improvements to the connection pool.
remove unnecessary uldap_connection_cleanup (nothing needed between unbind 
  and remove)

  properly remove rebind callback info when credentials change

  maintain a separate pool for the rebind callback storage so it can be cleared
  when the connection is unbound.

(major bump for util_ldap function removal)



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1081005 13f79535-47bb-0310-9956-ffa450edef68
2011-03-12 21:18:21 +00:00
ed451e94d1 re-order many struct members for better alignment on 64bit
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@959464 13f79535-47bb-0310-9956-ffa450edef68
2010-06-30 22:34:05 +00:00
1477c61e6f odd assortment of spelling fixes
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@947651 13f79535-47bb-0310-9956-ffa450edef68
2010-05-24 14:26:49 +00:00
811302730b missing file from r915660, major MMN bump already in original revision
for this file.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@915923 13f79535-47bb-0310-9956-ffa450edef68
2010-02-24 18:49:46 +00:00
e87803f042 Introduce new config option LDAPTimeout to set the timeout for operations
like bind and search.

For operations other than search, the support of the timeout depends on the
LDAP SDK supporting LDAP_OPT_TIMEOUT (e.g. OpenLDAP >= 2.4.4). An exception is
the ldap_simple_bind() in uldap_connection_open(): Here we put some extra
effort into detecting a timeout in a portable way, to catch an idle connection
having been dropped by a firewall.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@898102 13f79535-47bb-0310-9956-ffa450edef68
2010-01-11 23:08:31 +00:00
2e9668a33d Replace AcceptMutex, LockFile, RewriteLock, SSLMutex, SSLStaplingMutex,
and WatchdogMutexPath with a single Mutex directive.  Add APIs to
simplify setup and user customization of APR proc and global mutexes.  
(See util_mutex.h.)  Build-time setting DEFAULT_LOCKFILE is no longer
respected; set DEFAULT_REL_RUNTIMEDIR instead.

Some existing modules, such as mod_ldap and mod_auth_digest gain 
configurability for their mutexes.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@883540 13f79535-47bb-0310-9956-ffa450edef68
2009-11-23 23:17:51 +00:00
5f87e4a3f4 Stop trying to set the referral HOP limit on each connection since most SDKs don't seem
to do anything with it, and causes an error on released openldap levels.  

Also moves/remove some macros internal to mod_ldap out of the public header for a major bump.

Reported against APR in PR47501, but httpd shouldn't be asking for the option
by default.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@831542 13f79535-47bb-0310-9956-ffa450edef68
2009-10-31 14:02:04 +00:00
4e6f442708 add LDAPLibraryDebug directive to mod_ldap to turn on
tracing in underlying LDAP SDK, where all the interesting tidbits
about all kinds of LDAP errors are hidden.

Unfortunately windows doesn't implement this LDAP_OPT.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@831183 13f79535-47bb-0310-9956-ffa450edef68
2009-10-30 02:07:45 +00:00
85b935b3df Reduced the bumpiness (from major to minor) and utilized #defines throughout
(per Ruediger's suggestions). Still looking at the dir merge.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@614747 13f79535-47bb-0310-9956-ffa450edef68
2008-01-24 00:24:01 +00:00
f4e5632d60 This adds Apache support (taking advantage of the new APR capability)
for ldap rebind callback while chasing referrals. This allows direct
searches on LDAP servers (in particular MS Active Directory 2003+)
using referrals without the use of the global catalog.
This addresses PRs 26538, 40268, and 42557



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@614605 13f79535-47bb-0310-9956-ffa450edef68
2008-01-23 18:14:41 +00:00
7c9503a556 When using the MS SDK, re-establish LDAP backend connections on a
return code of LDAP_UNAVAILABLE as if it were LDAP_SERVER_DOWN.

With this SDK, LDAP_UNAVAIALBLE is returned when the socket had been closed 
between LDAP API calls.

PR 39095



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@607766 13f79535-47bb-0310-9956-ffa450edef68
2007-12-31 19:20:25 +00:00
4c46b08b82 Perform all per-LDAP-backend related memory allocations in a standalone pool,
provide a local method to completely remove an LDAP backend connection so
we can someday manage/dispose of extra connections in a reasonable way.

Clarify some commentary around the existing murky close/cleanup API
methods.

Minor bump for new members appended to util_ldap_connection_t, which is not
allocated by consumers of the API.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@599164 13f79535-47bb-0310-9956-ffa450edef68
2007-11-28 22:19:00 +00:00
7efb84f750 while technically uldap_connection_cleanup() does leave an entry in the
connection list, it is fully disconnected before it's put back.  My previous
commentary did more harm then good.





git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@593283 13f79535-47bb-0310-9956-ffa450edef68
2007-11-08 20:01:04 +00:00
30ede8a9cd Stop registering a cleanup on each LDAP connection created, this cleanup was
never called because it's registered against pconf in the child. LDAP
connections are created in the child and not shared between children, so no
action should be required at child exit

Additionally, clarify comments around uldap_connection_cleanup()



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@592764 13f79535-47bb-0310-9956-ffa450edef68
2007-11-07 14:43:26 +00:00
cc4a706e61 mod_ldap, mod_authnzldap: Add support for nested groups (i.e. the ability
to authorize an authenticated user via a "require ldap-group X" directive
     where the user is not in group X, but is in a subgroup contained in X.
     PR 42891 [Paul J. Reder]



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@560373 13f79535-47bb-0310-9956-ffa450edef68
2007-07-27 20:34:41 +00:00
f65de07e7e revert revision 555470
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@557772 13f79535-47bb-0310-9956-ffa450edef68
2007-07-19 21:05:16 +00:00
ab845c1671 This data is passed in an unsafe way to the LDAP SDK if the compiler
chooses to use shorts for the enum values.
http://www.redbooks.ibm.com/redbooks/SG245992/nn4/SG245992_88.html

Submitted by: David Jones


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@555470 13f79535-47bb-0310-9956-ffa450edef68
2007-07-12 02:42:44 +00:00
10fd249eea Use correct Doxygen keywords for functions and variables. TODO: figure out whether those keywords are actually necessary. HTML-ify some documentation comments for benefit of Doxygen.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@553013 13f79535-47bb-0310-9956-ffa450edef68
2007-07-03 23:02:32 +00:00
56acf588e4 * Add extern "C" linkage to several headers to make it easier to use
them in C++ code.

PR: 42286
Submitted by: Davi Arnaut <davi haxent.com.br>
Reviewed by: rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@535169 13f79535-47bb-0310-9956-ffa450edef68
2007-05-04 11:11:26 +00:00
de659cbed0 update license header text
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@420983 13f79535-47bb-0310-9956-ffa450edef68
2006-07-11 20:33:53 +00:00
dd95d7c37c Update the copyright year in all .c, .h and .xml files
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@395228 13f79535-47bb-0310-9956-ffa450edef68
2006-04-19 12:11:27 +00:00
8c1e315d3f Doxygen fixup / cleanup
submited by: Neale Ranns neale ranns.org
reviewed by: Ian Holsman



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@263931 13f79535-47bb-0310-9956-ffa450edef68
2005-08-28 23:03:59 +00:00
1439ca9d5c Add the LDAPVerifyServerCert directive to util_ldap to force
verification of a server certificate when establishing an SSL connection
to the LDAP server


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@169705 13f79535-47bb-0310-9956-ffa450edef68
2005-05-11 22:34:18 +00:00
38e8b5da89 Implement the exported function from mod_ldap(util_ldap) as optional functions so that we can eliminate the load ordering of mod_ldap and mod_authnz_ldap.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@159619 13f79535-47bb-0310-9956-ffa450edef68
2005-03-31 18:44:16 +00:00
edb46b1de9 * include/util_ldap.h (util_ldap_state_t): Fix gcc format string
warnings: use a long for connectionTimeout since the code expects a
long.

* modules/ldap/util_ldap.c (compare_client_certs): Make static to fix
gcc missing-prototype warning.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@153390 13f79535-47bb-0310-9956-ffa450edef68
2005-02-11 12:22:16 +00:00
905cdf9f0b Update copyright year to 2005 and standardize on current copyright owner line.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@151408 13f79535-47bb-0310-9956-ffa450edef68
2005-02-04 20:28:49 +00:00
30eea48f9b Added a new LDAPConnectionTimeout directive to util_ldap so that the socket connection timeout value is configurable.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@126565 13f79535-47bb-0310-9956-ffa450edef68
2005-01-27 01:13:15 +00:00
c78537114e mod_ldap: Updated to use the new apr-util v1.1 apr_ldap_*_option()
API for the setting of server and client SSL certificates. Replaced
LDAPTrustedCA directive with LDAPTrustedGlobalCert and
LDAPTrustedClientCert directives to correctly support global certs
(CA certs / Netware client certs) and per connection client certs
as supported by Netware, OpenLDAP and Netscape/Mozilla.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@125645 13f79535-47bb-0310-9956-ffa450edef68
2005-01-19 19:52:08 +00:00
8aea7cff22 Correct the order of includes to follow httpd conventions, and get
Win32 compiling again.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@124279 13f79535-47bb-0310-9956-ffa450edef68
2005-01-05 21:35:51 +00:00