Mercurial > dovecot > original-hg > dovecot-1.2
changeset 9146:de64bd431b80 HEAD
expire-tool: If auth_socket_path isn't set, default to base_dir/auth-master.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sun, 21 Jun 2009 23:09:19 -0400 |
parents | c4ac007d4e0b |
children | c002187195bd |
files | src/plugins/expire/expire-tool.c |
diffstat | 1 files changed, 9 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/plugins/expire/expire-tool.c Sun Jun 21 22:48:50 2009 -0400 +++ b/src/plugins/expire/expire-tool.c Sun Jun 21 23:09:19 2009 -0400 @@ -25,7 +25,7 @@ dynamic object.. */ #include "expire-env.c" -#define DEFAULT_AUTH_SOCKET_PATH PKG_RUNDIR"/auth-master" +#define DEFAULT_AUTH_SOCKET_FNAME "auth-master" struct expire_context { struct auth_master_connection *auth_conn; @@ -229,7 +229,7 @@ time_t oldest, expire_time; unsigned int expunge_secs, altmove_secs; const char *auth_socket, *p, *key, *value; - const char *userp, *mailbox, *expire, *expire_altmove; + const char *userp, *mailbox, *expire, *expire_altmove, *base_dir; int ret; expire = t_strdup(getenv("EXPIRE")); @@ -268,9 +268,14 @@ expire_get_global_mail_ids(); + base_dir = getenv("BASE_DIR"); + if (base_dir == NULL) + base_dir = PKG_RUNDIR; auth_socket = getenv("AUTH_SOCKET_PATH"); - if (auth_socket == NULL) - auth_socket = DEFAULT_AUTH_SOCKET_PATH; + if (auth_socket == NULL) { + auth_socket = t_strconcat(base_dir, "/", + DEFAULT_AUTH_SOCKET_FNAME, NULL); + } memset(&ctx, 0, sizeof(ctx)); ctx.testrun = testrun;