dovecot-2.0: login: Allow command line to override login socket ...

dovecot at dovecot.org dovecot at dovecot.org
Fri May 14 11:33:24 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/df2599ab2cee
changeset: 11308:df2599ab2cee
user:      Timo Sirainen <tss at iki.fi>
date:      Fri May 14 10:33:19 2010 +0200
description:
login: Allow command line to override login socket path.

diffstat:

 src/login-common/main.c |  11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diffs (56 lines):

diff -r 706e411a134d -r df2599ab2cee src/login-common/main.c
--- a/src/login-common/main.c	Thu May 13 18:26:08 2010 +0200
+++ b/src/login-common/main.c	Fri May 14 10:33:19 2010 +0200
@@ -20,6 +20,7 @@
 #include <unistd.h>
 #include <syslog.h>
 
+#define DEFAULT_LOGIN_SOCKET "login"
 #define AUTH_CLIENT_IDLE_TIMEOUT_MSECS (1000*60)
 
 struct login_access_lookup {
@@ -283,7 +284,7 @@
 		restrict_access_allow_coredumps(TRUE);
 }
 
-static void main_init(void)
+static void main_init(const char *login_socket)
 {
 	/* make sure we can't fork() */
 	restrict_process_size((unsigned int)-1, 1);
@@ -297,7 +298,8 @@
 						   client_destroy_oldest);
 	master_service_set_die_callback(master_service, login_die);
 
-	auth_client = auth_client_init("login", (unsigned int)getpid(), FALSE);
+	auth_client = auth_client_init(login_socket, (unsigned int)getpid(),
+				       FALSE);
         auth_client_set_connect_notify(auth_client, auth_connect_notify, NULL);
 	master_auth = master_auth_init(master_service, login_binary.protocol);
 
@@ -328,6 +330,7 @@
 		MASTER_SERVICE_FLAG_TRACK_LOGIN_STATE;
 	pool_t set_pool;
 	bool allow_core_dumps = FALSE;
+	const char *login_socket = DEFAULT_LOGIN_SOCKET;
 	int c;
 
 	master_service = master_service_init(login_binary.process_name,
@@ -347,6 +350,8 @@
 			return FATAL_DEFAULT;
 		}
 	}
+	if (argv[optind] != NULL)
+		login_socket = argv[optind];
 
 	login_process_preinit();
 
@@ -359,7 +364,7 @@
 	   this. so call it first. */
 	master_service_init_finish(master_service);
 	main_preinit(allow_core_dumps);
-	main_init();
+	main_init(login_socket);
 
 	master_service_run(master_service, client_connected);
 	main_deinit();


More information about the dovecot-cvs mailing list