You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Vadim Chekan <ko...@gmail.com> on 2005/10/22 09:00:07 UTC

[users@httpd] [Fix:] ladap crash on exit (Bug #31366)

Hello there!

I think I've fixed this bug.

It's util_ldap_cache.c:util_ldap_cache_module_kill()
...
if (st->cache_shm != NULL) {
    apr_status_t result = apr_shm_destroy(st->cache_shm);
	st->cache_shm = NULL;
        apr_file_remove(st->cache_file, st->pool);

It should be checked either we do have cache file befor attempt to delete it.
Because initially it is NULL and it remains null unless
LDAPSharedCacheFile is set in config. And if shared memory has been
initialized it does not mean that file has been created.
This bug appears only on Win because Win attempts to recode the string
(file name) to Unicode and null reference fails in this function.

This works for me:
if (st->cache_shm != NULL) {
    apr_status_t result = apr_shm_destroy(st->cache_shm);
	st->cache_shm = NULL;
	if(st->cache_file != NULL) {
	    apr_file_remove(st->cache_file, st->pool);
		st->cache_file = NULL;


This works for the situation when there is no LDAPSharedCacheFile
attribute in config.
But when there is one, it still crashes. I'm looking ito it.

Brgds
Vadim Chekan.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org