1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-07 04:02:58 +03:00

203 Commits

Author SHA1 Message Date
Eric Covener
c2236c7cbf The default timeout value of 10s lives in two places, the per-server config
and in this initialization. Drop the latter and check to see if a timeout
is requested in the per-server config.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1166662 13f79535-47bb-0310-9956-ffa450edef68
2011-09-08 12:53:06 +00:00
Eric Covener
5124ad1b62 s/lderrno/uldap_ld_errno, but keep it internal.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1157678 13f79535-47bb-0310-9956-ffa450edef68
2011-08-14 22:19:09 +00:00
Eric Covener
ead0bcf35c add a static method to retrieve the LDAP errno, and call from a
few other paths that have us returning LDAP_OTHER (since
only 'server down' is retryable, we want to work hard to get
it returned when appropriate)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1157677 13f79535-47bb-0310-9956-ffa450edef68
2011-08-14 22:03:02 +00:00
Stefan Fritsch
f19641462b Compare value instead of string pointer
Remove unused label
Remove unused var


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1157357 13f79535-47bb-0310-9956-ffa450edef68
2011-08-13 09:14:33 +00:00
Eric Covener
a68a8e4918 Accept LDAP_OPT_CONNECT_TIMEOUT as an alternative to LDAP_OPT_NETWORK_TIMEOUT.
An alternative on at least some IBM client libraries:

  http://publib.boulder.ibm.com/infocenter/tivihelp/v2r1/topic/com.ibm.IBMDS.doc/progref281.htm#opttimeout



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1157111 13f79535-47bb-0310-9956-ffa450edef68
2011-08-12 13:56:54 +00:00
Eric Covener
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
Eric Covener
293bffa871 Try to obtain the specific LDAP error code returned during a failed
ldap_simple_bind(). 


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1156001 13f79535-47bb-0310-9956-ffa450edef68
2011-08-10 02:06:52 +00:00
Stefan Fritsch
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
Stefan Fritsch
2d42def875 Revert r1140069:
Fix load order dependencies in LDAP code by switching to use of APR
    optional functions for the inter-module API...



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/revert-ap-ldap@1150164 13f79535-47bb-0310-9956-ffa450edef68
2011-07-23 17:10:49 +00:00
Rainer Jung
d37c52a6e4 Silence compiler warnings.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1142733 13f79535-47bb-0310-9956-ffa450edef68
2011-07-04 16:37:46 +00:00
Joe Orton
559c6ae018 Fix load order dependencies in LDAP code by switching to use of APR
optional functions for the inter-module API:

* modules/ldap/ldap_private.h: New file, containing "real" function
  declarations, copied from...

* include/ap_ldap.h.in, include/ap_ldap_url.h,
  include/ap_ldap_option.h, include/ap_ldap_init.h,
  include/ap_ldap_rebind.h: ... here.  All declarations changed to APR
  optional function declarations.

* modules/ldap/util_ldap.c (util_ldap_register_hooks): Register all
  the new optional functions.

* modules/aaa/mod_authnz_ldap.c (ImportULDAPOptFn): Pick up optional
  function stub for ap_ldap_url_parse.
  (mod_auth_ldap_parse_url): Use it here.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1140069 13f79535-47bb-0310-9956-ffa450edef68
2011-06-27 09:27:04 +00:00
Stefan Fritsch
4bc8885d8d Fix "statement not reached" warnings with sun cc
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1139391 13f79535-47bb-0310-9956-ffa450edef68
2011-06-24 17:59:44 +00:00
William A. Rowe Jr
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
Stefan Fritsch
46dc6e060b mod_ldap: Make LDAPSharedCacheSize 0 create a non-shared-memory cache per
process as opposed to disabling caching completely. This allows to use
the non-shared-memory cache as a workaround for the shared memory cache
not being available during graceful restarts

PR: 48958


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1096577 13f79535-47bb-0310-9956-ffa450edef68
2011-04-25 20:00:43 +00:00
Eric Covener
cdba63f119 always use (via break) the LDAP connection we're looking at once it's a match,
whether it's used as-is or has just been unbound.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1086433 13f79535-47bb-0310-9956-ffa450edef68
2011-03-28 22:43:08 +00:00
Eric Covener
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
Eric Covener
05e818b8b2 change all the negative values for LDAPConnPoolTTL into
-2 (AP_LDAP_CONNPOOL_INFINITE), so we can't get confused 
over -1 (AP_LDAP_CONNPOOL_DEFAULT) being merged.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1081146 13f79535-47bb-0310-9956-ffa450edef68
2011-03-13 16:45:06 +00:00
Eric Covener
7dbcca96c1 *) mod_ldap: Add LDAPConnectionPoolTTL to give control over lifetime
of bound backend LDAP connections.  PR47634 [Eric Covener]




git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1081007 13f79535-47bb-0310-9956-ffa450edef68
2011-03-12 21:42:36 +00:00
Eric Covener
813da4a81f ifdef 0-out uldap_connection_remove(), which is not part of the API and
currently has no callers. 


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1081006 13f79535-47bb-0310-9956-ffa450edef68
2011-03-12 21:20:23 +00:00
Eric Covener
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
Eric Covener
2d471132db whitespace-only: re-indent the blocks I wrapped in an if with r1080922
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1080923 13f79535-47bb-0310-9956-ffa450edef68
2011-03-12 12:03:59 +00:00
Eric Covener
9885316bba avoid apr_ldap_rebind_{add,remove} when referral chasing is turned off
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1080922 13f79535-47bb-0310-9956-ffa450edef68
2011-03-12 12:02:40 +00:00
Jeff Trawick
4598f1a7d4 fix some grammar mistakes, mostly in comments
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1080821 13f79535-47bb-0310-9956-ffa450edef68
2011-03-12 00:35:39 +00:00
Stefan Fritsch
385da96d50 Use ap_state_query() to fix many modules that were not correctly initializing
if they were not active during server startup but got enabled later during a
graceful restart (in which case they need to do all work during a single
config run).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1070153 13f79535-47bb-0310-9956-ffa450edef68
2011-02-12 21:23:56 +00:00
Graham Leggett
7cecbabda3 Avoid unnecessariy initialisation before we test ldap-status handler name.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1024453 13f79535-47bb-0310-9956-ffa450edef68
2010-10-19 22:53:41 +00:00
Stefan Fritsch
73bae8d90f Properly check the result returned by apr_ldap_init: There may have been an
error even if ldc->ldap != NULL.

PR 46076


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@986974 13f79535-47bb-0310-9956-ffa450edef68
2010-08-18 22:59:45 +00:00
Stefan Fritsch
c3490c3c66 set free()d pointers to NULL to avoid potential use-after-free bugs
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@982011 13f79535-47bb-0310-9956-ffa450edef68
2010-08-03 19:36:03 +00:00
Eric Covener
e842857ce9 whitespace only
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@963084 13f79535-47bb-0310-9956-ffa450edef68
2010-07-11 14:50:13 +00:00
Stefan Fritsch
1b34a4369e whitespace/indent fixes
remove a redundant comment


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@956377 13f79535-47bb-0310-9956-ffa450edef68
2010-06-20 17:10:25 +00:00
Stefan Fritsch
95fe2050a8 - add some trace logging
- stop logging the PID explicitly, this is now always done by ap_log_*error


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@956375 13f79535-47bb-0310-9956-ffa450edef68
2010-06-20 16:43:23 +00:00
Stefan Fritsch
ebb62867fb Use the new APLOG_USE_MODULE/AP_DECLARE_MODULE macros everywhere to take
advantage of per-module loglevels


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951895 13f79535-47bb-0310-9956-ffa450edef68
2010-06-06 16:59:50 +00:00
Eric Covener
dd90ac4591 when we actually get a per-server config in a vhost, the shared memory
cache was not in the merged config.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951235 13f79535-47bb-0310-9956-ffa450edef68
2010-06-04 01:58:46 +00:00
William A. Rowe Jr
01d300298f Catch up with ap_[proc|global]_mutex_create api change
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@940981 13f79535-47bb-0310-9956-ffa450edef68
2010-05-04 17:40:43 +00:00
Stefan Fritsch
8d143e15c8 fix more errors found by cppcheck
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@930962 13f79535-47bb-0310-9956-ffa450edef68
2010-04-05 21:17:08 +00:00
Eric Covener
5b5c5facb0 make some sense of the difference between "Client" and "Global" certs in mod_ldap.
PR46541

Submitted By: Paul Reder, Eric Covener
Reviewed By: Eric Covener



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@915660 13f79535-47bb-0310-9956-ffa450edef68
2010-02-24 04:02:06 +00:00
Eric Covener
9a0ea94ac1 mod_ldap: Eliminate a potential crash with multiple LDAPTrustedClientCert when
some are not password-protected.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@915295 13f79535-47bb-0310-9956-ffa450edef68
2010-02-23 12:07:03 +00:00
Stefan Fritsch
006cdf796b Move the ldap_simple_bind() + ldap_result() code implementing a timeout
into a utility function and use it to replace the other occurence of
ldap_simple_bind_s().


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@902604 13f79535-47bb-0310-9956-ffa450edef68
2010-01-24 17:14:12 +00:00
Ruediger Pluem
09f43b8aa6 * Fix compiler warning about wrong format
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@898910 13f79535-47bb-0310-9956-ffa450edef68
2010-01-13 19:28:00 +00:00
Stefan Fritsch
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
Guenter Knauf
0cc4a12564 block setting debug level if AP_LDAP_OPT_DEBUG is not defined.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@885281 13f79535-47bb-0310-9956-ffa450edef68
2009-11-29 22:23:26 +00:00
Jeff Trawick
0644e027f4 tweaks to r883540:
watchdog: use better mutex type name
  ldap/digest: use same FOO_mutex_type variable name as other modules
    for easier searching


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@883708 13f79535-47bb-0310-9956-ffa450edef68
2009-11-24 14:47:55 +00:00
Jeff Trawick
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
Eric Covener
c09a39aac9 require LDAPReferralHopLimit > 0
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@831549 13f79535-47bb-0310-9956-ffa450edef68
2009-10-31 15:09:09 +00:00
Eric Covener
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
Eric Covener
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
Stefan Fritsch
da0e12aacf Work around broken cache management in mod_ldap: If LDAPSharedCacheSize is too
small, try to free some memory by purging the cache and log a warning.

Also increase the default LDAPSharedCacheSize to 500000. This is a more
realistic size suitable for the default values of 1024 for LdapCacheEntries and
LdapOpCacheEntries.

PR: 46749


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@822458 13f79535-47bb-0310-9956-ffa450edef68
2009-10-06 19:39:38 +00:00
Eric Covener
7bf3e4012d Bring the LDAPCacheEntries and LDAPOpCacheEntries usage() in synch with
the manual and the implementation (0 and -1 both disable the cache).

PR 40948


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@814441 13f79535-47bb-0310-9956-ffa450edef68
2009-09-13 23:54:23 +00:00
Jeff Trawick
a6e008c9e2 fix spelling in debug log message
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@737582 13f79535-47bb-0310-9956-ffa450edef68
2009-01-25 21:35:44 +00:00
Jeff Trawick
932a6065b2 tweak the referral/hoplimit ldap option logic to save the failure reason in the util_ldap_connection_t for later logging
old error log message:
  auth_ldap authenticate: user wbush authentication failed; URI /ldap-status [(null)][Can't contact LDAP server]
new error log message:
  auth_ldap authenticate: user wbush authentication failed; URI /ldap-status [Unable to set LDAP_OPT_REFHOPLIMIT.][Can't contact LDAP server]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@735068 13f79535-47bb-0310-9956-ffa450edef68
2009-01-16 17:57:52 +00:00
Paul J. Reder
43c90c9fac *) mod_ldap: Avoid a segfault when result->rc is checked in uldap_connection_init
when result is NULL. This could happen if LDAP initialization failed.
   PR 45994.  [Dan Poirier <poirier pobox.com>]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@727053 13f79535-47bb-0310-9956-ffa450edef68
2008-12-16 14:08:19 +00:00