]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Improved setgid/setuid failure's error message.
authorTimo Sirainen <tss@iki.fi>
Mon, 8 Mar 2010 17:09:00 +0000 (19:09 +0200)
committerTimo Sirainen <tss@iki.fi>
Mon, 8 Mar 2010 17:09:00 +0000 (19:09 +0200)
--HG--
branch : HEAD

src/lib/failures.c
src/lib/mempool-alloconly.c
src/lib/restrict-access.c

index d2ac7de9d99849676a86a3c414a33c1d514f5165..e6bd9ac6e2df1082feee00116f81dda1436e5c51 100644 (file)
@@ -160,6 +160,7 @@ default_fatal_finish(enum log_type type, int status)
                        i_error("Raw backtrace: %s", backtrace);
        }
 
+       sleep(3600*24);
        if (type == LOG_TYPE_PANIC)
                abort();
        else
@@ -597,6 +598,8 @@ i_internal_error_handler(enum log_type type, const char *fmt, va_list args)
 {
        if (internal_handler(type, fmt, args) < 0)
                failure_exit(FATAL_LOGERROR);
+       if (type == LOG_TYPE_ERROR)
+               sleep(3600*24);
 }
 
 void i_set_failure_internal(void)
index f725fa8697bdd4e7c718984e82ef6fc1eabe7381..bb66abf4ce0487c322257a1ce7ed33b480a7a2cb 100644 (file)
@@ -244,8 +244,8 @@ static void block_alloc(struct alloconly_pool *apool, size_t size)
                           stack, so make sure everything is allocated before
                           calling it. */
                        t_buffer_alloc_last_full();
-                       i_warning("Growing pool '%s' with: %"PRIuSIZE_T,
-                                 apool->name, size);
+                       /*i_warning("Growing pool '%s' with: %"PRIuSIZE_T,
+                                 apool->name, size);*/
                }
 #endif
        }
index b1aaea96fb679e7c41316046cac3253745ec04b5..e949482878400719d168155c2640f97bab4bddd7 100644 (file)
@@ -70,10 +70,13 @@ static void restrict_init_groups(gid_t primary_gid, gid_t privileged_gid)
                }
 
                if (setgid(primary_gid) != 0) {
-                       i_fatal("setgid(%s) failed with euid=%s, "
-                               "gid=%s, egid=%s: %m",
+                       i_fatal("setgid(%s) failed with "
+                               "euid=%s, gid=%s, egid=%s: %m "
+                               "(This binary should probably be called with "
+                               "process group set to %s instead of %s)",
                                get_gid_str(primary_gid), get_uid_str(geteuid()),
-                               get_gid_str(getgid()), get_gid_str(getegid()));
+                               get_gid_str(getgid()), get_gid_str(getegid()),
+                               get_gid_str(primary_gid), get_uid_str(geteuid()));
                }
                return;
        }
@@ -291,7 +294,10 @@ void restrict_access(const struct restrict_access_settings *set,
        /* uid last */
        if (set->uid != (uid_t)-1) {
                if (setuid(set->uid) != 0) {
-                       i_fatal("setuid(%s) failed with euid=%s: %m",
+                       i_fatal("setuid(%s) failed with euid=%s: %m "
+                               "(This binary should probably be called with "
+                               "process user set to %s instead of %s)",
+                               get_uid_str(set->uid), get_uid_str(geteuid()),
                                get_uid_str(set->uid), get_uid_str(geteuid()));
                }
        }