dovecot: Allocate auth_realms from auth pool instead of from dat...
dovecot at dovecot.org
dovecot at dovecot.org
Wed Dec 5 17:47:53 EET 2007
details: http://hg.dovecot.org/dovecot/rev/aacc69cc267b
changeset: 6936:aacc69cc267b
user: Timo Sirainen <tss at iki.fi>
date: Wed Dec 05 17:22:21 2007 +0200
description:
Allocate auth_realms from auth pool instead of from data stack.
diffstat:
4 files changed, 6 insertions(+), 9 deletions(-)
src/auth/auth.c | 5 +----
src/auth/auth.h | 2 +-
src/auth/mech-digest-md5.c | 4 ++--
src/auth/mech-rpa.c | 4 ++--
diffs (72 lines):
diff -r 38fd7447172d -r aacc69cc267b src/auth/auth.c
--- a/src/auth/auth.c Wed Dec 05 17:19:57 2007 +0200
+++ b/src/auth/auth.c Wed Dec 05 17:22:21 2007 +0200
@@ -239,13 +239,10 @@ void auth_init(struct auth *auth)
i_fatal("No authentication mechanisms configured");
auth_mech_list_verify_passdb(auth);
- /* get our realm - note that we allocate from data stack so
- this function should never be called inside I/O loop or anywhere
- else where t_pop() is called */
env = getenv("REALMS");
if (env == NULL)
env = "";
- auth->auth_realms = t_strsplit_spaces(env, " ");
+ auth->auth_realms = p_strsplit_spaces(auth->pool, env, " ");
env = getenv("DEFAULT_REALM");
if (env != NULL && *env != '\0')
diff -r 38fd7447172d -r aacc69cc267b src/auth/auth.h
--- a/src/auth/auth.h Wed Dec 05 17:19:57 2007 +0200
+++ b/src/auth/auth.h Wed Dec 05 17:22:21 2007 +0200
@@ -37,7 +37,7 @@ struct auth {
struct auth_passdb *passdbs;
struct auth_userdb *userdbs;
- const char *const *auth_realms;
+ char *const *auth_realms;
const char *default_realm;
const char *anonymous_username;
const char *username_format;
diff -r 38fd7447172d -r aacc69cc267b src/auth/mech-digest-md5.c
--- a/src/auth/mech-digest-md5.c Wed Dec 05 17:19:57 2007 +0200
+++ b/src/auth/mech-digest-md5.c Wed Dec 05 17:22:21 2007 +0200
@@ -60,7 +60,7 @@ static string_t *get_digest_challenge(st
struct auth *auth = request->auth_request.auth;
buffer_t *buf;
string_t *str;
- const char *const *tmp;
+ char *const *tmp;
unsigned char nonce[16];
int i;
bool first_qop;
@@ -223,7 +223,7 @@ static bool verify_credentials(struct di
static bool verify_realm(struct digest_auth_request *request, const char *realm)
{
- const char *const *tmp;
+ char *const *tmp;
if (*realm == '\0')
return TRUE;
diff -r 38fd7447172d -r aacc69cc267b src/auth/mech-rpa.c
--- a/src/auth/mech-rpa.c Wed Dec 05 17:19:57 2007 +0200
+++ b/src/auth/mech-rpa.c Wed Dec 05 17:22:21 2007 +0200
@@ -239,7 +239,7 @@ rpa_verify_realm(struct rpa_auth_request
rpa_verify_realm(struct rpa_auth_request *request, const char *realm)
{
const char *default_realm;
- const char *const *tmp;
+ char *const *tmp;
tmp = request->auth_request.auth->auth_realms;
for (; *tmp != NULL; tmp++) {
@@ -353,7 +353,7 @@ mech_rpa_build_token2(struct rpa_auth_re
string_t *realms;
buffer_t *buf;
unsigned char timestamp[RPA_TIMESTAMP_LEN / 2];
- const char *const *tmp;
+ char *const *tmp;
realms = t_str_new(64);
for (tmp = auth->auth_realms; *tmp != NULL; tmp++) {
More information about the dovecot-cvs
mailing list