Mercurial > dovecot > original-hg > dovecot-1.2
changeset 5706:afc4e8a7354a HEAD
Master and client sockets have default paths now. Section name only needs to
be uncommented now for the socket to be created.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Tue, 12 Jun 2007 19:46:53 +0300 |
parents | 4c62af215aca |
children | f63c99fe863c |
files | src/master/auth-process.c src/master/master-settings.c src/master/master-settings.h |
diffstat | 3 files changed, 18 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/master/auth-process.c Tue Jun 12 19:17:24 2007 +0300 +++ b/src/master/auth-process.c Tue Jun 12 19:46:53 2007 +0300 @@ -372,7 +372,7 @@ static void socket_settings_env_put(const char *env_base, struct socket_settings *set) { - if (*set->path == '\0') + if (!set->used) return; env_put(t_strdup_printf("%s=%s", env_base, set->path));
--- a/src/master/master-settings.c Tue Jun 12 19:17:24 2007 +0300 +++ b/src/master/master-settings.c Tue Jun 12 19:46:53 2007 +0300 @@ -314,8 +314,10 @@ }; struct socket_settings default_socket_settings = { +#define DEFAULT_MASTER_SOCKET_PATH "auth-master" +#define DEFAULT_CLIENT_SOCKET_PATH "auth-client" MEMBER(path) "", - MEMBER(mode) 0, + MEMBER(mode) 0600, MEMBER(user) "", MEMBER(group) "" }; @@ -369,6 +371,7 @@ static bool auth_settings_verify(struct auth_settings *auth) { struct passwd *pw; + struct auth_socket_settings *s; if ((pw = getpwnam(auth->user)) == NULL) { i_error("Auth user doesn't exist: %s", auth->user); @@ -405,6 +408,10 @@ auth->parent->imap->ssl_verify_client_cert = TRUE; } + for (s = auth->sockets; s != NULL; s = s->next) { + fix_base_path(auth->parent->defaults, &s->master.path); + fix_base_path(auth->parent->defaults, &s->client.path); + } return TRUE; } @@ -953,6 +960,9 @@ as->master = default_socket_settings; as->client = default_socket_settings; + as->master.path = DEFAULT_MASTER_SOCKET_PATH; + as->client.path = DEFAULT_CLIENT_SOCKET_PATH; + as_p = &auth->sockets; while (*as_p != NULL) as_p = &(*as_p)->next; @@ -1257,11 +1267,13 @@ if (strcmp(type, "master") == 0) { ctx->socket = &ctx->auth_socket->master; + ctx->socket->used = TRUE; return TRUE; } if (strcmp(type, "client") == 0) { ctx->socket = &ctx->auth_socket->client; + ctx->socket->used = TRUE; return TRUE; } } @@ -1541,14 +1553,14 @@ settings_dump(auth_socket_setting_defs, sets2, NULL, 2, nondefaults, 4); - if (socket->client.path != NULL) { + if (socket->client.used) { printf(" client:\n"); sets2[1] = &socket->client; settings_dump(socket_setting_defs, sets2, NULL, 2, nondefaults, 6); } - if (socket->master.path != NULL) { + if (socket->master.used) { printf(" master:\n"); sets2[1] = &socket->master; settings_dump(socket_setting_defs, sets2, NULL,