dovecot-2.0: auth: When logging in as anonymous user, return "an...

dovecot at dovecot.org dovecot at dovecot.org
Mon Dec 6 06:36:34 EET 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/c41ba33b8e16
changeset: 12518:c41ba33b8e16
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Dec 06 04:36:30 2010 +0000
description:
auth: When logging in as anonymous user, return "anonymous" userdb extra field.

diffstat:

 TODO                            |  1 -
 src/auth/auth-request-handler.c |  9 +++++++++
 2 files changed, 9 insertions(+), 1 deletions(-)

diffs (30 lines):

diff -r b7a8d2a357a8 -r c41ba33b8e16 TODO
--- 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?
diff -r b7a8d2a357a8 -r c41ba33b8e16 src/auth/auth-request-handler.c
--- 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;


More information about the dovecot-cvs mailing list