From 5d2ce603402849a673829b132f50440b7f6a70ba Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Fri, 11 Nov 2016 20:41:10 +0000 Subject: [PATCH] Fix regression in domain to session type mapping If no domain is passed, self->session->client_info->domain is an empty string that is incorrectly treated as if the domain were passed by the client. The regression was introduced in fc753a95, when an incorrect check for non-empty domain was added. That check was removed in 67119ecc based on coverity report, leaving no trace of the original intention. Check domain both for '_' and '\0' as the initial character. In either case, select the first session type section in xrdp.ini. --- xrdp/xrdp_wm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xrdp/xrdp_wm.c b/xrdp/xrdp_wm.c index 548742ac..4917c3aa 100644 --- a/xrdp/xrdp_wm.c +++ b/xrdp/xrdp_wm.c @@ -583,7 +583,8 @@ xrdp_wm_init(struct xrdp_wm *self) /* if autorun is configured in xrdp.ini, we enforce that module to be loaded */ g_strncpy(section_name, autorun_name, 255); } - else if (self->session->client_info->domain[0] != '_') + else if (self->session->client_info->domain[0] != '\0' && + self->session->client_info->domain[0] != '_') { /* domain names that starts with '_' are reserved for IP/DNS to * simplify for the user in a proxy setup */