dovecot-2.2: Adds 'anonymous' field to struct mail_user; derived...

dovecot at dovecot.org dovecot at dovecot.org
Sat Jun 2 19:02:27 EEST 2012


details:   http://hg.dovecot.org/dovecot-2.2/rev/e445670e7332
changeset: 14593:e445670e7332
user:      Stephan Bosch <stephan at rename-it.nl>
date:      Sat Jun 02 18:15:46 2012 +0300
description:
Adds 'anonymous' field to struct mail_user; derived indirectly from userdb extra fields.

Depends: none

diffstat:

 src/lib-auth/auth-master.c             |  2 ++
 src/lib-auth/auth-master.h             |  1 +
 src/lib-storage/mail-storage-service.c |  7 ++++++-
 src/lib-storage/mail-user.h            |  2 ++
 4 files changed, 11 insertions(+), 1 deletions(-)

diffs (66 lines):

diff -r 5344ff4215b4 -r e445670e7332 src/lib-auth/auth-master.c
--- a/src/lib-auth/auth-master.c	Sat Jun 02 18:14:16 2012 +0300
+++ b/src/lib-auth/auth-master.c	Sat Jun 02 18:15:46 2012 +0300
@@ -518,6 +518,8 @@
 			reply_r->home = p_strdup(pool, *fields + 5);
 		else if (strncmp(*fields, "chroot=", 7) == 0)
 			reply_r->chroot = p_strdup(pool, *fields + 7);
+		else if (strcmp(*fields, "anonymous") == 0)
+			reply_r->anonymous = TRUE;
 		else {
 			const char *field = p_strdup(pool, *fields);
 			array_append(&reply_r->extra_fields, &field, 1);
diff -r 5344ff4215b4 -r e445670e7332 src/lib-auth/auth-master.h
--- a/src/lib-auth/auth-master.h	Sat Jun 02 18:14:16 2012 +0300
+++ b/src/lib-auth/auth-master.h	Sat Jun 02 18:15:46 2012 +0300
@@ -21,6 +21,7 @@
 	gid_t gid;
 	const char *home, *chroot;
 	ARRAY_TYPE(const_string) extra_fields;
+	unsigned int anonymous:1;
 };
 
 struct auth_master_connection *
diff -r 5344ff4215b4 -r e445670e7332 src/lib-storage/mail-storage-service.c
--- a/src/lib-storage/mail-storage-service.c	Sat Jun 02 18:14:16 2012 +0300
+++ b/src/lib-storage/mail-storage-service.c	Sat Jun 02 18:15:46 2012 +0300
@@ -77,6 +77,8 @@
 	const struct mail_user_settings *user_set;
 	const struct setting_parser_info *user_info;
 	struct setting_parser_context *set_parser;
+
+	unsigned int anonymous:1;
 };
 
 struct module *mail_storage_service_modules = NULL;
@@ -252,6 +254,8 @@
 		set_keyval(ctx, user, "mail_chroot", chroot);
 	}
 
+	user->anonymous = reply->anonymous;
+
 	str = array_get(&reply->extra_fields, &count);
 	for (i = 0; i < count; i++) {
 		line = str[i];
@@ -600,7 +604,8 @@
 			   &user->input.local_ip, &user->input.remote_ip);
 	mail_user->uid = priv->uid == (uid_t)-1 ? geteuid() : priv->uid;
 	mail_user->gid = priv->gid == (gid_t)-1 ? getegid() : priv->gid;
-
+	mail_user->anonymous = user->anonymous;
+	
 	mail_set = mail_user_set_get_storage_set(mail_user);
 
 	if (mail_set->mail_debug) {
diff -r 5344ff4215b4 -r e445670e7332 src/lib-storage/mail-user.h
--- a/src/lib-storage/mail-user.h	Sat Jun 02 18:14:16 2012 +0300
+++ b/src/lib-storage/mail-user.h	Sat Jun 02 18:15:46 2012 +0300
@@ -45,6 +45,8 @@
 	/* User is an administrator. Allow operations not normally allowed
 	   for other people. */
 	unsigned int admin:1;
+	/* User is anonymous */
+	unsigned int anonymous:1;
 	/* This is an autocreated user (e.g. for shared namespace or
 	   lda raw storage) */
 	unsigned int autocreated:1;


More information about the dovecot-cvs mailing list