# HG changeset patch # User Timo Sirainen # Date 1196868141 -7200 # Node ID aacc69cc267b6171b43bca6c9566228fbb121ec3 # Parent 38fd7447172dd49cd3727b20364e1f6c7d9a5d4d Allocate auth_realms from auth pool instead of from data stack. 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 @@ 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_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 @@ 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_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 *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 @@ 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++) {