request->local_port = atoi(value);
else if (strcmp(key, "rport") == 0)
request->remote_port = atoi(value);
+ else if (strcmp(key, "session") == 0)
+ request->session_id = p_strdup(request->pool, value);
else
return FALSE;
return TRUE;
}
if (auth_request->requested_login_user != NULL)
str_append(str, ",master");
+ if (auth_request->session_id != NULL)
+ str_printfa(str, ",<%s>", auth_request->session_id);
str_append(str, "): ");
}
unsigned int id;
time_t last_access;
- const char *service, *mech_name;
+ const char *service, *mech_name, *session_id;
struct ip_addr local_ip, remote_ip;
unsigned int local_port, remote_port;
if ((info->flags & AUTH_REQUEST_FLAG_VALID_CLIENT_CERT) != 0)
str_append(str, "\tvalid-client-cert");
+ if (info->session_id != NULL) {
+ str_append(str, "\tsession=");
+ str_tabescape_write(str, info->session_id);
+ }
if (info->cert_username != NULL) {
str_append(str, "\tcert_username=");
str_tabescape_write(str, info->cert_username);
request->request_info = *request_info;
request->request_info.mech = p_strdup(pool, request_info->mech);
request->request_info.service = p_strdup(pool, request_info->service);
+ request->request_info.session_id =
+ p_strdup_empty(pool, request_info->session_id);
request->request_info.cert_username =
p_strdup_empty(pool, request_info->cert_username);
request->request_info.initial_resp_base64 =
struct auth_request_info {
const char *mech;
const char *service;
+ const char *session_id;
const char *cert_username;
enum auth_request_flags flags;
static const struct login_settings login_default_settings = {
.login_trusted_networks = "",
.login_greeting = PACKAGE_NAME" ready.",
- .login_log_format_elements = "user=<%u> method=%m rip=%r lip=%l mpid=%e %c",
+ .login_log_format_elements = "user=<%u> method=%m rip=%r lip=%l mpid=%e %c session=<%{session}>",
.login_log_format = "%$: %s",
.login_access_sockets = "",
.director_username_hash = "%u",
memset(&info, 0, sizeof(info));
info.mech = mech->name;
info.service = service;
+ info.session_id = client_get_session_id(client);
info.cert_username = client->ssl_proxy == NULL ? NULL :
ssl_proxy_get_peer_name(client->ssl_proxy);
info.flags = client_get_auth_flags(client);