summaryrefslogtreecommitdiffstats
path: root/xrdp/xrdp_wm.c
diff options
context:
space:
mode:
Diffstat (limited to 'xrdp/xrdp_wm.c')
-rw-r--r--xrdp/xrdp_wm.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/xrdp/xrdp_wm.c b/xrdp/xrdp_wm.c
index 4f010698..fb0825f3 100644
--- a/xrdp/xrdp_wm.c
+++ b/xrdp/xrdp_wm.c
@@ -540,6 +540,7 @@ xrdp_wm_init(struct xrdp_wm *self)
struct list *values;
char *q;
char *r;
+ char param[256];
char section_name[256];
char cfg_file[256];
char autorun_name[256];
@@ -632,6 +633,29 @@ xrdp_wm_init(struct xrdp_wm *self)
r = self->session->client_info->username;
}
}
+ else if (g_strncmp("ip", q, 255) == 0)
+ {
+ /* if the ip has been asked for by the module, use what the
+ client says (target ip should be in 'domain' field, when starting with "_")
+ if the ip has been manually set in the config, use that
+ instead of what the client says. */
+ if (g_strncmp("ask", r, 3) == 0)
+ {
+ if (self->session->client_info->domain[0] == '_')
+ {
+ g_strncpy(param, &self->session->client_info->domain[1], 255);
+ r = param;
+ }
+
+ }
+ }
+ else if (g_strncmp("port", q, 255) == 0)
+ {
+ if (g_strncmp("ask3389", r, 7) == 0)
+ {
+ r = "3389"; /* use default */
+ }
+ }
list_add_item(self->mm->login_names, (long)g_strdup(q));
list_add_item(self->mm->login_values, (long)g_strdup(r));