]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Added setting mail_drop_priv_before_exec.
authorTimo Sirainen <tss@iki.fi>
Fri, 21 Feb 2003 13:02:16 +0000 (15:02 +0200)
committerTimo Sirainen <tss@iki.fi>
Fri, 21 Feb 2003 13:02:16 +0000 (15:02 +0200)
--HG--
branch : HEAD

dovecot-example.conf
src/master/mail-process.c
src/master/main.c
src/master/master-settings.c
src/master/master-settings.h

index a9a95a757d9a3cb8ba26f3791b5c7c8b24676dc3..5ea7a9cff67f4f57c601f67db748a4a06cfeb151 100644 (file)
@@ -300,6 +300,13 @@ login = pop3
 # umask to use for mail files and directories
 #umask = 0077
 
+# Drop all privileges before exec()ing the mail process. This is mostly
+# meant for debugging, otherwise you don't get core dumps. Note that setting
+# this to yes means that log file is opened as the logged in user, which
+# might not work. It could also be a small security risk if you use single UID
+# for multiple users, as the users could ptrace() each others processes then.
+#mail_drop_priv_before_exec = no
+
 ##
 ## IMAP process
 ##
index f7fb69b7ef43c1f2ad22b1b85f76de422332026f..3e43c10721a3b74f0e40ddb14bfc62811327bfca 100644 (file)
@@ -216,6 +216,9 @@ int create_mail_process(int socket, struct ip_addr *ip,
           any errors above will be logged */
        closelog();
 
+       if (set->mail_drop_priv_before_exec)
+               restrict_access_by_env(TRUE);
+
        /* hide the path, it's ugly */
        argv[0] = strrchr(executable, '/');
        if (argv[0] == NULL) argv[0] = executable; else argv[0]++;
index 603206811477431b1c5aea95e5fe31c1cf90621e..e1746bbb69e7daa73962a5ed0248eb249b89f966 100644 (file)
@@ -78,11 +78,11 @@ static void settings_reload(void)
 {
        i_warning("SIGHUP received - reloading configuration");
 
-       master_settings_read(configfile);
-
        /* restart auth and login processes */
         login_processes_destroy_all();
         auth_processes_destroy_all();
+
+       master_settings_read(configfile);
 }
 
 static const char *get_exit_status_message(enum fatal_exit_status status)
index f1b317629c5c5216927bda27db859322af1b0da3..c31409f7b330901fffbe7b5e9000b07a5390255e 100644 (file)
@@ -68,6 +68,7 @@ static struct setting_def setting_defs[] = {
        DEF(SET_INT, mbox_dotlock_change_timeout),
        DEF(SET_BOOL, overwrite_incompatible_index),
        DEF(SET_INT, umask),
+       DEF(SET_BOOL, mail_drop_priv_before_exec),
 
        /* imap */
        DEF(SET_STR, imap_executable),
@@ -173,6 +174,7 @@ struct settings default_settings = {
        MEMBER(mbox_dotlock_change_timeout) 30,
        MEMBER(overwrite_incompatible_index) FALSE,
        MEMBER(umask) 0077,
+       MEMBER(mail_drop_priv_before_exec) FALSE,
 
        /* imap */
        MEMBER(imap_executable) PKG_LIBEXECDIR"/imap",
index 555230025027c184d8e38542715ea3018fbce0db..5821920dcd4b82c926ab5b7fea0b02b2d5cb8648 100644 (file)
@@ -52,6 +52,7 @@ struct settings {
        unsigned int mbox_dotlock_change_timeout;
        int overwrite_incompatible_index;
        unsigned int umask;
+       int mail_drop_priv_before_exec;
 
        /* imap */
        const char *imap_executable;