[dovecot-cvs] dovecot/src/imap main.c,1.77.2.3,1.77.2.4
tss at dovecot.org
tss at dovecot.org
Fri Feb 16 13:12:05 UTC 2007
Update of /var/lib/cvs/dovecot/src/imap
In directory talvi:/tmp/cvs-serv5370/imap
Modified Files:
Tag: branch_1_0
main.c
Log Message:
module_dir_load() doesn't call init() functions anymore. Added a new
module_dir_init() which does it. This way imap/pop3 can load the modules
before chrooting and initialize them after.
Index: main.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/main.c,v
retrieving revision 1.77.2.3
retrieving revision 1.77.2.4
diff -u -d -r1.77.2.3 -r1.77.2.4
--- main.c 15 Feb 2007 11:39:24 -0000 1.77.2.3
+++ main.c 16 Feb 2007 13:12:03 -0000 1.77.2.4
@@ -43,7 +43,7 @@
enum client_workarounds client_workarounds = 0;
static struct io *log_io = NULL;
-static struct module *modules;
+static struct module *modules = NULL;
static char log_prefix[128]; /* syslog() needs this to be permanent */
static pool_t namespace_pool;
@@ -135,6 +135,16 @@
chrooting. */
random_init();
+ /* Load the plugins before chrooting. Their init() is called later. */
+ if (getenv("MAIL_PLUGINS") != NULL) {
+ const char *plugin_dir = getenv("MAIL_PLUGIN_DIR");
+
+ if (plugin_dir == NULL)
+ plugin_dir = MODULEDIR"/imap";
+ modules = module_dir_load(plugin_dir, getenv("MAIL_PLUGINS"),
+ TRUE);
+ }
+
restrict_access_by_env(!IS_STANDALONE());
}
@@ -188,16 +198,7 @@
clients_init();
commands_init();
- if (getenv("MAIL_PLUGINS") == NULL)
- modules = NULL;
- else {
- const char *plugin_dir = getenv("MAIL_PLUGIN_DIR");
-
- if (plugin_dir == NULL)
- plugin_dir = MODULEDIR"/imap";
- modules = module_dir_load(plugin_dir, getenv("MAIL_PLUGINS"),
- TRUE);
- }
+ module_dir_init(modules);
if (getenv("DUMP_CAPABILITY") != NULL) {
printf("%s\n", str_c(capability_string));
More information about the dovecot-cvs
mailing list