[dovecot-cvs] dovecot: Master and client sockets have default paths now. Secti...
dovecot at dovecot.org
dovecot at dovecot.org
Tue Jun 12 19:47:00 EEST 2007
details: http://hg.dovecot.org/dovecot/rev/afc4e8a7354a
changeset: 5706:afc4e8a7354a
user: Timo Sirainen <tss at iki.fi>
date: Tue Jun 12 19:46:53 2007 +0300
description:
Master and client sockets have default paths now. Section name only needs to
be uncommented now for the socket to be created.
diffstat:
3 files changed, 18 insertions(+), 4 deletions(-)
src/master/auth-process.c | 2 +-
src/master/master-settings.c | 18 +++++++++++++++---
src/master/master-settings.h | 2 ++
diffs (99 lines):
diff -r 4c62af215aca -r afc4e8a7354a src/master/auth-process.c
--- 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
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));
diff -r 4c62af215aca -r afc4e8a7354a src/master/master-settings.c
--- 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 auth_settings default_auth_settin
};
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
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 @@ static bool auth_settings_verify(struct
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;
}
@@ -952,6 +959,9 @@ auth_socket_settings_new(struct auth_set
as->type = str_lcase(p_strdup(settings_pool, type));
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)
@@ -1257,11 +1267,13 @@ static bool parse_section(const char *ty
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 @@ static void auth_settings_dump(struct au
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,
diff -r 4c62af215aca -r afc4e8a7354a src/master/master-settings.h
--- a/src/master/master-settings.h Tue Jun 12 19:17:24 2007 +0300
+++ b/src/master/master-settings.h Tue Jun 12 19:46:53 2007 +0300
@@ -138,6 +138,8 @@ struct socket_settings {
unsigned int mode;
const char *user;
const char *group;
+
+ unsigned int used:1;
};
struct auth_socket_settings {
More information about the dovecot-cvs
mailing list