[dovecot-cvs] dovecot/src/imap main.c,1.77.2.5,1.77.2.6
tss at dovecot.org
tss at dovecot.org
Thu Mar 15 17:52:57 EET 2007
Update of /var/lib/cvs/dovecot/src/imap
In directory talvi:/tmp/cvs-serv15087/imap
Modified Files:
Tag: branch_1_0
main.c
Log Message:
Fixes to handling log prefixes. imap/pop3 processes now log the
mail_log_prefix even when started with --exec-mail.
Index: main.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/main.c,v
retrieving revision 1.77.2.5
retrieving revision 1.77.2.6
diff -u -d -r1.77.2.5 -r1.77.2.6
--- main.c 22 Feb 2007 14:35:59 -0000 1.77.2.5
+++ main.c 15 Mar 2007 15:52:55 -0000 1.77.2.6
@@ -97,20 +97,23 @@
return;
}
- user = getenv("USER");
- if (user == NULL) {
- if (IS_STANDALONE())
- user = getlogin();
- if (user == NULL)
- user = "??";
- }
- if (strlen(user) >= sizeof(log_prefix)-6) {
- /* quite a long user name, cut it */
- user = t_strndup(user, sizeof(log_prefix)-6-2);
- user = t_strconcat(user, "..", NULL);
+ if (getenv("LOG_PREFIX") != NULL)
+ strocpy(log_prefix, getenv("LOG_PREFIX"), sizeof(log_prefix));
+ else {
+ user = getenv("USER");
+ if (user == NULL) {
+ if (IS_STANDALONE())
+ user = getlogin();
+ if (user == NULL)
+ user = "??";
+ }
+ if (strlen(user) >= sizeof(log_prefix)-6) {
+ /* quite a long user name, cut it */
+ user = t_strndup(user, sizeof(log_prefix)-6-2);
+ user = t_strconcat(user, "..", NULL);
+ }
+ i_snprintf(log_prefix, sizeof(log_prefix), "imap(%s): ", user);
}
- i_snprintf(log_prefix, sizeof(log_prefix), "imap(%s)", user);
-
if (getenv("USE_SYSLOG") != NULL) {
const char *env = getenv("SYSLOG_FACILITY");
i_set_failure_syslog(log_prefix, LOG_NDELAY,
More information about the dovecot-cvs
mailing list