From: Timo Sirainen Date: Wed, 19 May 2010 13:03:26 +0000 (+0200) Subject: auth: Create auth-login socket by default where internal user can connect to. X-Git-Tag: 2.0.beta6~200 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bbadd5331f534017cf62d5183003b3d9fdad079e;p=thirdparty%2Fdovecot%2Fcore.git auth: Create auth-login socket by default where internal user can connect to. --HG-- branch : HEAD --- diff --git a/src/auth/auth-settings.c b/src/auth/auth-settings.c index 67192b916a..5fd66b24c2 100644 --- a/src/auth/auth-settings.c +++ b/src/auth/auth-settings.c @@ -17,6 +17,7 @@ static bool auth_userdb_settings_check(void *_set, pool_t pool, const char **err /* */ static struct file_listener_settings auth_unix_listeners_array[] = { { "login/login", 0666, "", "" }, + { "auth-login", 0600, "$default_internal_user", "" }, { "auth-client", 0600, "", "" }, { "auth-userdb", 0600, "", "" }, { "auth-master", 0600, "", "" } @@ -25,7 +26,8 @@ static struct file_listener_settings *auth_unix_listeners[] = { &auth_unix_listeners_array[0], &auth_unix_listeners_array[1], &auth_unix_listeners_array[2], - &auth_unix_listeners_array[3] + &auth_unix_listeners_array[3], + &auth_unix_listeners_array[4] }; static buffer_t auth_unix_listeners_buf = { auth_unix_listeners, sizeof(auth_unix_listeners), { 0, } diff --git a/src/auth/main.c b/src/auth/main.c index 57228e80c9..4acf2cf4af 100644 --- a/src/auth/main.c +++ b/src/auth/main.c @@ -213,20 +213,19 @@ static void client_connected(const struct master_service_connection *conn) name++; suffix = strrchr(name, '-'); - if (suffix == NULL) { - if (strcmp(name, "login") == 0) - *type = AUTH_SOCKET_LOGIN_CLIENT; - else - *type = AUTH_SOCKET_CLIENT; - } else { + if (suffix == NULL) + suffix = name; + else suffix++; - if (strcmp(suffix, "master") == 0) - *type = AUTH_SOCKET_MASTER; - else if (strcmp(suffix, "userdb") == 0) - *type = AUTH_SOCKET_USERDB; - else - *type = AUTH_SOCKET_CLIENT; - } + + if (strcmp(suffix, "login") == 0) + *type = AUTH_SOCKET_LOGIN_CLIENT; + else if (strcmp(suffix, "master") == 0) + *type = AUTH_SOCKET_MASTER; + else if (strcmp(suffix, "userdb") == 0) + *type = AUTH_SOCKET_USERDB; + else + *type = AUTH_SOCKET_CLIENT; } auth = auth_find_service(NULL);