dovecot-2.0: verbose_proctitle setting works again.
dovecot at dovecot.org
dovecot at dovecot.org
Fri Sep 11 21:06:04 EEST 2009
details: http://hg.dovecot.org/dovecot-2.0/rev/307a5f65f74d
changeset: 9930:307a5f65f74d
user: Timo Sirainen <tss at iki.fi>
date: Fri Sep 11 14:05:59 2009 -0400
description:
verbose_proctitle setting works again.
diffstat:
9 files changed, 26 insertions(+), 12 deletions(-)
doc/example-config/conf.d/mail.conf | 5 -----
doc/example-config/dovecot.conf | 5 +++++
src/imap/imap-settings.c | 2 --
src/imap/imap-settings.h | 1 -
src/master/master-settings.c | 2 ++
src/master/master-settings.h | 1 +
src/master/service-process.c | 19 ++++++++++++++++++-
src/pop3/pop3-settings.c | 2 --
src/pop3/pop3-settings.h | 1 -
diffs (156 lines):
diff -r d60fa42fbaac -r 307a5f65f74d doc/example-config/conf.d/mail.conf
--- a/doc/example-config/conf.d/mail.conf Fri Sep 11 13:43:37 2009 -0400
+++ b/doc/example-config/conf.d/mail.conf Fri Sep 11 14:05:59 2009 -0400
@@ -151,11 +151,6 @@
# Dotlocking uses some tricks which may create more disk I/O than other locking
# methods. NFS users: flock doesn't work, remember to change mmap_disable.
#lock_method = fcntl
-
-# Show more verbose process titles (in ps). Currently shows user name and
-# IP address. Useful for seeing who are actually using the IMAP processes
-# (eg. shared mailboxes or if same uid is used for multiple accounts).
-#verbose_proctitle = no
# Valid UID range for users, defaults to 500 and above. This is mostly
# to make sure that users can't log in as daemons or other system users.
diff -r d60fa42fbaac -r 307a5f65f74d doc/example-config/dovecot.conf
--- a/doc/example-config/dovecot.conf Fri Sep 11 13:43:37 2009 -0400
+++ b/doc/example-config/dovecot.conf Fri Sep 11 14:05:59 2009 -0400
@@ -40,6 +40,11 @@
# these networks. Typically you'd specify your IMAP proxy servers here.
#login_trusted_networks =
+# Show more verbose process titles (in ps). Currently shows user name and
+# IP address. Useful for seeing who are actually using the IMAP processes
+# (eg. shared mailboxes or if same uid is used for multiple accounts).
+#verbose_proctitle = no
+
##
## Dictionary server settings
##
diff -r d60fa42fbaac -r 307a5f65f74d src/imap/imap-settings.c
--- a/src/imap/imap-settings.c Fri Sep 11 13:43:37 2009 -0400
+++ b/src/imap/imap-settings.c Fri Sep 11 14:05:59 2009 -0400
@@ -19,7 +19,6 @@ static struct setting_define imap_settin
static struct setting_define imap_setting_defines[] = {
DEF(SET_BOOL, mail_debug),
DEF(SET_BOOL, shutdown_clients),
- DEF(SET_BOOL, verbose_proctitle),
DEF(SET_UINT, imap_max_line_length),
DEF(SET_UINT, imap_idle_notify_interval),
@@ -35,7 +34,6 @@ static struct imap_settings imap_default
static struct imap_settings imap_default_settings = {
MEMBER(mail_debug) FALSE,
MEMBER(shutdown_clients) FALSE,
- MEMBER(verbose_proctitle) FALSE,
/* RFC-2683 recommends at least 8000 bytes. Some clients however don't
break large message sets to multiple commands, so we're pretty
diff -r d60fa42fbaac -r 307a5f65f74d src/imap/imap-settings.h
--- a/src/imap/imap-settings.h Fri Sep 11 13:43:37 2009 -0400
+++ b/src/imap/imap-settings.h Fri Sep 11 14:05:59 2009 -0400
@@ -6,7 +6,6 @@ struct imap_settings {
struct imap_settings {
bool mail_debug;
bool shutdown_clients;
- bool verbose_proctitle;
/* imap: */
unsigned int imap_max_line_length;
diff -r d60fa42fbaac -r 307a5f65f74d src/master/master-settings.c
--- a/src/master/master-settings.c Fri Sep 11 13:43:37 2009 -0400
+++ b/src/master/master-settings.c Fri Sep 11 14:05:59 2009 -0400
@@ -173,6 +173,7 @@ static struct setting_define master_sett
DEF(SET_BOOL, version_ignore),
DEF(SET_BOOL, mail_debug),
DEF(SET_BOOL, auth_debug),
+ DEF(SET_BOOL, verbose_proctitle),
DEF(SET_UINT, first_valid_uid),
DEF(SET_UINT, last_valid_uid),
@@ -195,6 +196,7 @@ static struct master_settings master_def
MEMBER(version_ignore) FALSE,
MEMBER(mail_debug) FALSE,
MEMBER(auth_debug) FALSE,
+ MEMBER(verbose_proctitle) FALSE,
MEMBER(first_valid_uid) 500,
MEMBER(last_valid_uid) 0,
diff -r d60fa42fbaac -r 307a5f65f74d src/master/master-settings.h
--- a/src/master/master-settings.h Fri Sep 11 13:43:37 2009 -0400
+++ b/src/master/master-settings.h Fri Sep 11 14:05:59 2009 -0400
@@ -53,6 +53,7 @@ struct master_settings {
bool version_ignore;
bool mail_debug;
bool auth_debug;
+ bool verbose_proctitle;
unsigned int first_valid_uid, last_valid_uid;
unsigned int first_valid_gid, last_valid_gid;
diff -r d60fa42fbaac -r 307a5f65f74d src/master/service-process.c
--- a/src/master/service-process.c Fri Sep 11 13:43:37 2009 -0400
+++ b/src/master/service-process.c Fri Sep 11 14:05:59 2009 -0400
@@ -467,6 +467,22 @@ handle_request(const struct service_proc
env_put(t_strconcat("IP=", net_ip2addr(&request->remote_ip), NULL));
}
+static const char **
+get_extra_args(struct service *service,
+ const struct service_process_auth_request *request,
+ const char *const *auth_args)
+{
+ const char **extra;
+
+ if (!service->set->master_set->verbose_proctitle || request == NULL)
+ return NULL;
+
+ extra = t_new(const char *, 2);
+ extra[0] = t_strdup_printf("[%s %s]", auth_args[0],
+ net_ip2addr(&request->remote_ip));
+ return extra;
+}
+
struct service_process *
service_process_create(struct service *service, const char *const *auth_args,
const struct service_process_auth_request *request)
@@ -522,7 +538,8 @@ service_process_create(struct service *s
service_dup_fds(service, fd[1], request == NULL ? -1 :
request->fd, auth_args != NULL);
drop_privileges(service, auth_args, request);
- process_exec(service->executable, NULL);
+ process_exec(service->executable,
+ get_extra_args(service, request, auth_args));
}
switch (service->type) {
diff -r d60fa42fbaac -r 307a5f65f74d src/pop3/pop3-settings.c
--- a/src/pop3/pop3-settings.c Fri Sep 11 13:43:37 2009 -0400
+++ b/src/pop3/pop3-settings.c Fri Sep 11 14:05:59 2009 -0400
@@ -19,7 +19,6 @@ static struct setting_define pop3_settin
static struct setting_define pop3_setting_defines[] = {
DEF(SET_BOOL, mail_debug),
DEF(SET_BOOL, shutdown_clients),
- DEF(SET_BOOL, verbose_proctitle),
DEF(SET_BOOL, pop3_no_flag_updates),
DEF(SET_BOOL, pop3_enable_last),
@@ -35,7 +34,6 @@ static struct pop3_settings pop3_default
static struct pop3_settings pop3_default_settings = {
MEMBER(mail_debug) FALSE,
MEMBER(shutdown_clients) FALSE,
- MEMBER(verbose_proctitle) FALSE,
MEMBER(pop3_no_flag_updates) FALSE,
MEMBER(pop3_enable_last) FALSE,
diff -r d60fa42fbaac -r 307a5f65f74d src/pop3/pop3-settings.h
--- a/src/pop3/pop3-settings.h Fri Sep 11 13:43:37 2009 -0400
+++ b/src/pop3/pop3-settings.h Fri Sep 11 14:05:59 2009 -0400
@@ -6,7 +6,6 @@ struct pop3_settings {
struct pop3_settings {
bool mail_debug;
bool shutdown_clients;
- bool verbose_proctitle;
/* pop3: */
bool pop3_no_flag_updates;
More information about the dovecot-cvs
mailing list