diff src/master/login-process.c @ 8302:0db37acdc59f HEAD

Login process: Log auth failure reasons better in disconnect message. For example if client certs are required it now logs if the cert wasn't sent or if the cert was invalid.
author Timo Sirainen <tss@iki.fi>
date Sun, 19 Oct 2008 14:00:57 +0300
parents 29b623366e1e
children 8fb20b423f8b
line wrap: on
line diff
--- a/src/master/login-process.c	Sun Oct 19 13:32:01 2008 +0300
+++ b/src/master/login-process.c	Sun Oct 19 14:00:57 2008 +0300
@@ -530,6 +530,8 @@
 static void login_process_init_env(struct login_group *group, pid_t pid)
 {
 	struct settings *set = group->set;
+	const struct auth_settings *auth;
+	bool require_cert;
 
 	child_process_init_env();
 
@@ -579,6 +581,13 @@
 		env_put("VERBOSE_SSL=1");
 	if (set->server->auths->verbose)
 		env_put("VERBOSE_AUTH=1");
+	require_cert = TRUE;
+	for (auth = set->server->auths; auth != NULL; auth = auth->next) {
+		if (!auth->ssl_require_client_cert)
+			require_cert = FALSE;
+	}
+	if (require_cert)
+		env_put("SSL_REQUIRE_CLIENT_CERT=1");
 
 	if (set->login_process_per_connection) {
 		env_put("PROCESS_PER_CONNECTION=1");