Mercurial > dovecot > core-2.2
changeset 12556:c41ba33b8e16
auth: When logging in as anonymous user, return "anonymous" userdb extra field.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Mon, 06 Dec 2010 04:36:30 +0000 |
parents | b7a8d2a357a8 |
children | 6a48a361c63f |
files | TODO src/auth/auth-request-handler.c |
diffstat | 2 files changed, 9 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/TODO Mon Dec 06 01:27:03 2010 +0000 +++ b/TODO Mon Dec 06 04:36:30 2010 +0000 @@ -109,7 +109,6 @@ - read the entire file to memory only once and keep it there, stat() later to see if it has changed. if not, perhaps don't even bother stat()ing dovecot-acl files? at least not that often.. - - add anonymous environment for anon logins (for managesieve mainly) - fs quota: getquotaroot inbox vs. other-box should return different quotas if two quotas are defined - new primes code: are hash tables now being resized too often?
--- a/src/auth/auth-request-handler.c Mon Dec 06 01:27:03 2010 +0000 +++ b/src/auth/auth-request-handler.c Mon Dec 06 04:36:30 2010 +0000 @@ -589,6 +589,15 @@ "master_user", request->master_user); } + if (*request->set->anonymous_username != '\0' && + strcmp(request->user, + request->set->anonymous_username) == 0) { + /* this is an anonymous login, either via ANONYMOUS + SASL mechanism or simply logging in as the anonymous + user via another mechanism */ + auth_stream_reply_add(request->userdb_reply, + "anonymous", NULL); + } auth_stream_reply_import(reply, auth_stream_reply_export(request->userdb_reply)); break;