]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
verbose_proctitle setting works again.
authorTimo Sirainen <tss@iki.fi>
Fri, 11 Sep 2009 18:05:59 +0000 (14:05 -0400)
committerTimo Sirainen <tss@iki.fi>
Fri, 11 Sep 2009 18:05:59 +0000 (14:05 -0400)
--HG--
branch : HEAD

doc/example-config/conf.d/mail.conf
doc/example-config/dovecot.conf
src/imap/imap-settings.c
src/imap/imap-settings.h
src/master/master-settings.c
src/master/master-settings.h
src/master/service-process.c
src/pop3/pop3-settings.c
src/pop3/pop3-settings.h

index 348a76c4640e2a1f5326b8ff8b7693daad128afb..233de4c99030b07fa83db7bfdfe7a54929eeb761 100644 (file)
 # 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.
 # Note that denying root logins is hardcoded to dovecot binary and can't
index ba5ab95c1d6e2ad1042aea6f332bf99c7ccc8052..6fad272f626d48f8070717029ddf80edf9ddd62a 100644 (file)
 # 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
 ##
index f0bbf4ea2786d423ab4ea70f6aa5fe32a98e2eaa..a9c8142ba357de47f62a4180864dd3a24bf0113a 100644 (file)
@@ -19,7 +19,6 @@
 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 setting_define imap_setting_defines[] = {
 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
index 229c71cacf44f8f69a6654e23d940f8302e74e02..7629b6d05743d2e5b11fabaf15c30bbb71e1f8a2 100644 (file)
@@ -6,7 +6,6 @@ struct mail_user_settings;
 struct imap_settings {
        bool mail_debug;
        bool shutdown_clients;
-       bool verbose_proctitle;
 
        /* imap: */
        unsigned int imap_max_line_length;
index 8dc33f72e7203dd6f3a2d298841ff4e410a86e9b..2a306e38404bb4db238344d9543ca4ee35522464 100644 (file)
@@ -173,6 +173,7 @@ static struct setting_define master_setting_defines[] = {
        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_default_settings = {
        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,
index 7d6549db78862160fec39d3bd9c6be62693c4a99..df8175a246cf0132b7fc9c95abe5fdfa0a5ddf7e 100644 (file)
@@ -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;
index 97a28ae469cfb220c79d199adea77740bfba379c..f9979fa6c4ccce9a8982441ecc627d6d2c3a766c 100644 (file)
@@ -467,6 +467,22 @@ handle_request(const struct service_process_auth_request *request)
        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 *service, const char *const *auth_args,
                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) {
index 01bcd836f0479ffb6f896676036eecfb209e75be..05b6fda83461e4956f4d42b7f0873de980f9b071 100644 (file)
@@ -19,7 +19,6 @@
 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 setting_define pop3_setting_defines[] = {
 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,
index f7d23611b4e84c153c1e4cf185734636b9c06528..09faeb01a0416cdc143aeb141154973db738d53b 100644 (file)
@@ -6,7 +6,6 @@ struct mail_user_settings;
 struct pop3_settings {
        bool mail_debug;
        bool shutdown_clients;
-       bool verbose_proctitle;
 
        /* pop3: */
        bool pop3_no_flag_updates;