Mercurial > dovecot > original-hg > dovecot-1.2
changeset 5005:7a8f68b0cc31 HEAD
extra_fields == NULL and empty extra_fields (reset after each passdb
lookup) should be treated the same. Fixes some assert crashes.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Tue, 16 Jan 2007 15:18:23 +0200 |
parents | 13db2cd1ae94 |
children | 129aa779a7f8 |
files | src/auth/auth-request-handler.c src/auth/auth-stream.c src/auth/auth-stream.h src/auth/passdb-blocking.c src/auth/userdb-prefetch.c |
diffstat | 5 files changed, 11 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/auth/auth-request-handler.c Sun Jan 14 06:01:31 2007 +0200 +++ b/src/auth/auth-request-handler.c Tue Jan 16 15:18:23 2007 +0200 @@ -118,7 +118,7 @@ auth_stream_reply_export(request->extra_fields); if (!request->proxy) { - if (extra_fields == NULL) + if (auth_stream_is_empty(request->extra_fields)) return NULL; /* we only wish to remove all fields prefixed with "userdb_" */
--- a/src/auth/auth-stream.c Sun Jan 14 06:01:31 2007 +0200 +++ b/src/auth/auth-stream.c Tue Jan 16 15:18:23 2007 +0200 @@ -73,3 +73,8 @@ { return str_c(reply->str); } + +bool auth_stream_is_empty(struct auth_stream_reply *reply) +{ + return reply == NULL || str_len(reply->str) == 0; +}
--- a/src/auth/auth-stream.h Sun Jan 14 06:01:31 2007 +0200 +++ b/src/auth/auth-stream.h Tue Jan 16 15:18:23 2007 +0200 @@ -10,5 +10,6 @@ void auth_stream_reply_import(struct auth_stream_reply *reply, const char *str); const char *auth_stream_reply_export(struct auth_stream_reply *reply); +bool auth_stream_is_empty(struct auth_stream_reply *reply); #endif
--- a/src/auth/passdb-blocking.c Sun Jan 14 06:01:31 2007 +0200 +++ b/src/auth/passdb-blocking.c Tue Jan 16 15:18:23 2007 +0200 @@ -87,7 +87,7 @@ } if (*reply != '\0') { - i_assert(request->extra_fields == NULL); + i_assert(auth_stream_is_empty(request->extra_fields)); for (tmp = t_strsplit(reply, "\t"); *tmp != NULL; tmp++) { p = strchr(*tmp, '='); @@ -122,7 +122,7 @@ { string_t *str; - i_assert(request->extra_fields == NULL); + i_assert(auth_stream_is_empty(request->extra_fields)); str = t_str_new(64); str_printfa(str, "PASSV\t%u\t", request->passdb->id); @@ -154,7 +154,7 @@ { string_t *str; - i_assert(request->extra_fields == NULL); + i_assert(auth_stream_is_empty(request->extra_fields)); str = t_str_new(64); str_printfa(str, "PASSL\t%u\t%d\t",
--- a/src/auth/userdb-prefetch.c Sun Jan 14 06:01:31 2007 +0200 +++ b/src/auth/userdb-prefetch.c Tue Jan 16 15:18:23 2007 +0200 @@ -19,7 +19,7 @@ gid_t gid; bool uid_seen, gid_seen; - if (auth_request->extra_fields == NULL) { + if (auth_stream_is_empty(auth_request->extra_fields)) { if (auth_request->auth->userdbs->next == NULL) { /* no other userdbs */ auth_request_log_error(auth_request, "prefetch",