aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikos Mavrogiannopoulos 2010-09-24 08:51:52 +0200
committerGravatar Nikos Mavrogiannopoulos 2010-09-24 08:51:52 +0200
commitd8c7cf4677d744f0e203d30cca4e69d84cf4b7b4 (patch)
tree3d442c9ac0dd88d8aaaef8cb2e03a7d79170a0f2
parent771ca63efe669f8b0a3ffaeba1f3be7e3688b35f (diff)
Only allow two options for DB. Berkeley DB and gdbm. The other options
such as SDBM had serious limitations. Thanks to Hardy Griech for pointing out.
-rw-r--r--NEWS5
-rw-r--r--include/mod_gnutls.h.in2
-rw-r--r--src/gnutls_cache.c12
-rw-r--r--src/gnutls_config.c6
4 files changed, 13 insertions, 12 deletions
diff --git a/NEWS b/NEWS
index ec3622d..85fcb5b 100644
--- a/NEWS
+++ b/NEWS
@@ -3,8 +3,9 @@
3 terminate the connection prematurely) 3 terminate the connection prematurely)
4 4
5- The GnuTLSCache variable now can be given the specific 5- The GnuTLSCache variable now can be given the specific
6 option "sdbm" instead of "dbm". "dbm" will use the default 6 option "gdbm" instead of "dbm". "dbm" will use the berkeley
7 dbm type of libapr while sdbm will force sdbm to be used. 7 db type of libapr while gdbm will force gdbm to be used.
8 sdbm is no longer being used due to serious limitations.
8 9
9** Version 0.5.8 (2010-08-18) 10** Version 0.5.8 (2010-08-18)
10- Session tickets are enabled by default. 11- Session tickets are enabled by default.
diff --git a/include/mod_gnutls.h.in b/include/mod_gnutls.h.in
index a421617..7d39a72 100644
--- a/include/mod_gnutls.h.in
+++ b/include/mod_gnutls.h.in
@@ -63,7 +63,7 @@ typedef enum
63{ 63{
64 mgs_cache_none, 64 mgs_cache_none,
65 mgs_cache_dbm, 65 mgs_cache_dbm,
66 mgs_cache_sdbm, 66 mgs_cache_gdbm,
67#if HAVE_APR_MEMCACHE 67#if HAVE_APR_MEMCACHE
68 mgs_cache_memcache 68 mgs_cache_memcache
69#endif 69#endif
diff --git a/src/gnutls_cache.c b/src/gnutls_cache.c
index 7bcb697..90ea440 100644
--- a/src/gnutls_cache.c
+++ b/src/gnutls_cache.c
@@ -296,10 +296,10 @@ static int mc_cache_delete(void* baton, gnutls_datum_t key)
296 296
297const char* db_type(mgs_srvconf_rec * sc) 297const char* db_type(mgs_srvconf_rec * sc)
298{ 298{
299 if (sc->cache_type == mgs_cache_sdbm) 299 if (sc->cache_type == mgs_cache_gdbm)
300 return "sdbm"; 300 return "gdbm";
301 else 301 else
302 return "default"; 302 return "db";
303} 303}
304 304
305#define SSL_DBM_FILE_MODE ( APR_UREAD | APR_UWRITE | APR_GREAD | APR_WREAD ) 305#define SSL_DBM_FILE_MODE ( APR_UREAD | APR_UWRITE | APR_GREAD | APR_WREAD )
@@ -555,7 +555,7 @@ static int dbm_cache_post_config(apr_pool_t *p, server_rec *s,
555int mgs_cache_post_config(apr_pool_t *p, server_rec *s, 555int mgs_cache_post_config(apr_pool_t *p, server_rec *s,
556 mgs_srvconf_rec *sc) 556 mgs_srvconf_rec *sc)
557{ 557{
558 if (sc->cache_type == mgs_cache_dbm || sc->cache_type == mgs_cache_sdbm) { 558 if (sc->cache_type == mgs_cache_dbm || sc->cache_type == mgs_cache_gdbm) {
559 return dbm_cache_post_config(p, s, sc); 559 return dbm_cache_post_config(p, s, sc);
560 } 560 }
561 return 0; 561 return 0;
@@ -564,7 +564,7 @@ int mgs_cache_post_config(apr_pool_t *p, server_rec *s,
564int mgs_cache_child_init(apr_pool_t *p, server_rec *s, 564int mgs_cache_child_init(apr_pool_t *p, server_rec *s,
565 mgs_srvconf_rec *sc) 565 mgs_srvconf_rec *sc)
566{ 566{
567 if (sc->cache_type == mgs_cache_dbm || sc->cache_type == mgs_cache_sdbm) { 567 if (sc->cache_type == mgs_cache_dbm || sc->cache_type == mgs_cache_gdbm) {
568 return 0; 568 return 0;
569 } 569 }
570#if HAVE_APR_MEMCACHE 570#if HAVE_APR_MEMCACHE
@@ -579,7 +579,7 @@ int mgs_cache_child_init(apr_pool_t *p, server_rec *s,
579 579
580int mgs_cache_session_init(mgs_handle_t *ctxt) 580int mgs_cache_session_init(mgs_handle_t *ctxt)
581{ 581{
582 if (ctxt->sc->cache_type == mgs_cache_dbm || ctxt->sc->cache_type == mgs_cache_sdbm) { 582 if (ctxt->sc->cache_type == mgs_cache_dbm || ctxt->sc->cache_type == mgs_cache_gdbm) {
583 gnutls_db_set_retrieve_function(ctxt->session, dbm_cache_fetch); 583 gnutls_db_set_retrieve_function(ctxt->session, dbm_cache_fetch);
584 gnutls_db_set_remove_function(ctxt->session, dbm_cache_delete); 584 gnutls_db_set_remove_function(ctxt->session, dbm_cache_delete);
585 gnutls_db_set_store_function(ctxt->session, dbm_cache_store); 585 gnutls_db_set_store_function(ctxt->session, dbm_cache_store);
diff --git a/src/gnutls_config.c b/src/gnutls_config.c
index 4bb523f..ff8ec33 100644
--- a/src/gnutls_config.c
+++ b/src/gnutls_config.c
@@ -348,8 +348,8 @@ const char *mgs_set_cache(cmd_parms * parms, void *dummy,
348 } else if (strcasecmp("dbm", type) == 0) { 348 } else if (strcasecmp("dbm", type) == 0) {
349 sc->cache_type = mgs_cache_dbm; 349 sc->cache_type = mgs_cache_dbm;
350 } 350 }
351 else if (strcasecmp("sdbm", type) == 0) { 351 else if (strcasecmp("gdbm", type) == 0) {
352 sc->cache_type = mgs_cache_sdbm; 352 sc->cache_type = mgs_cache_gdbm;
353 } 353 }
354#if HAVE_APR_MEMCACHE 354#if HAVE_APR_MEMCACHE
355 else if (strcasecmp("memcache", type) == 0) { 355 else if (strcasecmp("memcache", type) == 0) {
@@ -360,7 +360,7 @@ const char *mgs_set_cache(cmd_parms * parms, void *dummy,
360 return "Invalid Type for GnuTLSCache!"; 360 return "Invalid Type for GnuTLSCache!";
361 } 361 }
362 362
363 if (sc->cache_type == mgs_cache_dbm || sc->cache_type == mgs_cache_sdbm) { 363 if (sc->cache_type == mgs_cache_dbm || sc->cache_type == mgs_cache_gdbm) {
364 sc->cache_config = ap_server_root_relative(parms->pool, arg); 364 sc->cache_config = ap_server_root_relative(parms->pool, arg);
365 } else { 365 } else {
366 sc->cache_config = apr_pstrdup(parms->pool, arg); 366 sc->cache_config = apr_pstrdup(parms->pool, arg);