]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
login-common: Add login_auth_socket_path setting
authorKarl Fleischmann <karl.fleischmann@open-xchange.com>
Fri, 25 Mar 2022 13:54:02 +0000 (14:54 +0100)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Tue, 5 Apr 2022 07:19:12 +0000 (07:19 +0000)
This setting allows to set a default socket path for login processes
without the need to define it for each one individually. It can be
overwritten by explicitly giving it via the existing methods.

doc/example-config/conf.d/10-director.conf
src/login-common/login-settings.c
src/login-common/login-settings.h
src/login-common/main.c

index 073d8a8d69ef407fa223c0238230df35bb280016..a063b8e133ae535fb8e3938cba036313ca81c484 100644 (file)
@@ -42,17 +42,9 @@ service director {
   }
 }
 
-# Enable director for the wanted login services by telling them to
-# connect to director socket instead of the default login socket:
-service imap-login {
-  #executable = imap-login director
-}
-service pop3-login {
-  #executable = pop3-login director
-}
-service submission-login {
-  #executable = submission-login director
-}
+# Enable director for all login services by telling them to connect to
+# director socket instead of the default login socket:
+#login_auth_socket_path = director
 
 # Enable director for LMTP proxying:
 protocol lmtp {
index 30f7399dc26e17f33a169d045cfbca5590576f89..e1080f840cc174cd253e0457b0c6ecbe84de2844 100644 (file)
@@ -33,6 +33,7 @@ static const struct setting_define login_setting_defines[] = {
        DEF(TIME, login_proxy_max_disconnect_delay),
        DEF(STR, login_proxy_rawlog_dir),
        DEF(STR, director_username_hash),
+       DEF(STR, login_auth_socket_path),
 
        DEF(BOOL, auth_ssl_require_client_cert),
        DEF(BOOL, auth_ssl_username_from_cert),
@@ -61,6 +62,7 @@ static const struct login_settings login_default_settings = {
        .login_proxy_max_disconnect_delay = 0,
        .login_proxy_rawlog_dir = "",
        .director_username_hash = "%Lu",
+       .login_auth_socket_path = "",
 
        .auth_ssl_require_client_cert = FALSE,
        .auth_ssl_username_from_cert = FALSE,
index 5bff8377bdd4bf5f2a30b4315454693f6f6c3c73..35771f9c441ebc6a864af234b549bf43035b0b3f 100644 (file)
@@ -18,6 +18,7 @@ struct login_settings {
        unsigned int login_proxy_max_disconnect_delay;
        const char *login_proxy_rawlog_dir;
        const char *director_username_hash;
+       const char *login_auth_socket_path;
 
        bool auth_ssl_require_client_cert;
        bool auth_ssl_username_from_cert;
index 41ef867936e0104d029b86404543a4fb74f31c7d..bee61dbef0e3393c8d88d10cd22328a3bddf6f40 100644 (file)
@@ -500,8 +500,6 @@ int login_binary_run(struct login_binary *binary,
                        return FATAL_DEFAULT;
                }
        }
-       if (argv[optind] != NULL)
-               login_socket = argv[optind];
 
        login_binary->preinit();
 
@@ -512,6 +510,11 @@ int login_binary_run(struct login_binary *binary,
                                    &global_ssl_server_settings,
                                    &global_other_settings);
 
+       if (argv[optind] != NULL)
+               login_socket = argv[optind];
+       else if (global_login_settings->login_auth_socket_path[0] != '\0')
+               login_socket = global_login_settings->login_auth_socket_path;
+
        main_preinit();
        main_init(login_socket);