Mercurial > dovecot > core-2.2
changeset 13346:f7f75a5a6abf
lib-storage: Set struct mail_users.autocreated for raw/shared users.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Thu, 01 Sep 2011 06:13:26 +0300 |
parents | 2211371a3de5 |
children | 4d8cec7a7496 |
files | src/lda/main.c src/lib-storage/index/shared/shared-storage.c src/lib-storage/mail-user.h src/lmtp/client.c |
diffstat | 4 files changed, 6 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lda/main.c Thu Sep 01 06:02:23 2011 +0300 +++ b/src/lda/main.c Thu Sep 01 06:13:26 2011 +0300 @@ -372,6 +372,7 @@ /* create a separate mail user for the internal namespace */ sets = master_service_settings_get_others(master_service); raw_mail_user = mail_user_alloc(user, ctx.dest_user->set_info, sets[0]); + raw_mail_user->autocreated = TRUE; mail_user_set_home(raw_mail_user, "/"); if (mail_user_init(raw_mail_user, &errstr) < 0) i_fatal("Raw user initialization failed: %s", errstr);
--- a/src/lib-storage/index/shared/shared-storage.c Thu Sep 01 06:02:23 2011 +0300 +++ b/src/lib-storage/index/shared/shared-storage.c Thu Sep 01 06:13:26 2011 +0300 @@ -231,6 +231,7 @@ owner = mail_user_alloc(userdomain, user->set_info, user->unexpanded_set); + owner->autocreated = TRUE; if (!var_has_key(storage->location, 'h', "home")) ret = 1; else {
--- a/src/lib-storage/mail-user.h Thu Sep 01 06:02:23 2011 +0300 +++ b/src/lib-storage/mail-user.h Thu Sep 01 06:13:26 2011 +0300 @@ -42,6 +42,9 @@ /* User is an administrator. Allow operations not normally allowed for other people. */ unsigned int admin:1; + /* This is an autocreated user (e.g. for shared namespace or + lda raw storage) */ + unsigned int autocreated:1; /* mail_user_init() has been called */ unsigned int initialized:1; /* Shortcut to mail_storage_settings.mail_debug */
--- a/src/lmtp/client.c Thu Sep 01 06:02:23 2011 +0300 +++ b/src/lmtp/client.c Thu Sep 01 06:13:26 2011 +0300 @@ -132,6 +132,7 @@ client->raw_mail_user = mail_user_alloc("raw user", client->user_set_info, sets[0]); + client->raw_mail_user->autocreated = TRUE; mail_user_set_home(client->raw_mail_user, "/"); if (mail_user_init(client->raw_mail_user, &error) < 0) i_fatal("Raw user initialization failed: %s", error);