|
|
@ -106,17 +106,17 @@ xrdp_mm_delete(struct xrdp_mm* self)
|
|
|
|
static int APP_CC
|
|
|
|
static int APP_CC
|
|
|
|
xrdp_mm_send_login(struct xrdp_mm* self)
|
|
|
|
xrdp_mm_send_login(struct xrdp_mm* self)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
struct stream* s;
|
|
|
|
struct stream * s = (struct stream *)NULL;
|
|
|
|
int rv;
|
|
|
|
int rv = 0;
|
|
|
|
int index;
|
|
|
|
int index = 0;
|
|
|
|
int count;
|
|
|
|
int count = 0;
|
|
|
|
char* username;
|
|
|
|
char * username = (char *)NULL;
|
|
|
|
char* password;
|
|
|
|
char * password = (char *)NULL;
|
|
|
|
char* name;
|
|
|
|
char * name = (char *)NULL;
|
|
|
|
char* value;
|
|
|
|
char * value = (char *)NULL;
|
|
|
|
|
|
|
|
|
|
|
|
xrdp_wm_log_msg(self->wm, "sending login info to session manager, "
|
|
|
|
xrdp_wm_log_msg(self->wm, "sending login info to session manager, "
|
|
|
|
"please wait...");
|
|
|
|
"please wait...");
|
|
|
|
username = 0;
|
|
|
|
username = 0;
|
|
|
|
password = 0;
|
|
|
|
password = 0;
|
|
|
|
self->code = 0;
|
|
|
|
self->code = 0;
|
|
|
@ -144,9 +144,10 @@ xrdp_mm_send_login(struct xrdp_mm* self)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ((username == 0) || (password == 0))
|
|
|
|
if ((username == 0) || (password == 0))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
xrdp_wm_log_msg(self->wm, "error finding username and password");
|
|
|
|
xrdp_wm_log_msg(self->wm, "Error finding username and password");
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
s = trans_get_out_s(self->sesman_trans, 8192);
|
|
|
|
s = trans_get_out_s(self->sesman_trans, 8192);
|
|
|
|
s_push_layer(s, channel_hdr, 8);
|
|
|
|
s_push_layer(s, channel_hdr, 8);
|
|
|
|
/* this code is either 0 for Xvnc or 10 for X11rdp */
|
|
|
|
/* this code is either 0 for Xvnc or 10 for X11rdp */
|
|
|
@ -155,15 +156,18 @@ xrdp_mm_send_login(struct xrdp_mm* self)
|
|
|
|
out_uint16_be(s, index);
|
|
|
|
out_uint16_be(s, index);
|
|
|
|
out_uint8a(s, username, index);
|
|
|
|
out_uint8a(s, username, index);
|
|
|
|
index = g_strlen(password);
|
|
|
|
index = g_strlen(password);
|
|
|
|
|
|
|
|
|
|
|
|
out_uint16_be(s, index);
|
|
|
|
out_uint16_be(s, index);
|
|
|
|
out_uint8a(s, password, index);
|
|
|
|
out_uint8a(s, password, index);
|
|
|
|
out_uint16_be(s, self->wm->screen->width);
|
|
|
|
out_uint16_be(s, self->wm->screen->width);
|
|
|
|
out_uint16_be(s, self->wm->screen->height);
|
|
|
|
out_uint16_be(s, self->wm->screen->height);
|
|
|
|
out_uint16_be(s, self->wm->screen->bpp);
|
|
|
|
out_uint16_be(s, self->wm->screen->bpp);
|
|
|
|
|
|
|
|
|
|
|
|
/* send domain */
|
|
|
|
/* send domain */
|
|
|
|
index = g_strlen(self->wm->client_info->domain);
|
|
|
|
index = g_strlen(self->wm->client_info->domain);
|
|
|
|
out_uint16_be(s, index);
|
|
|
|
out_uint16_be(s, index);
|
|
|
|
out_uint8a(s, self->wm->client_info->domain, index);
|
|
|
|
out_uint8a(s, self->wm->client_info->domain, index);
|
|
|
|
|
|
|
|
|
|
|
|
/* send program / shell */
|
|
|
|
/* send program / shell */
|
|
|
|
index = g_strlen(self->wm->client_info->program);
|
|
|
|
index = g_strlen(self->wm->client_info->program);
|
|
|
|
out_uint16_be(s, index);
|
|
|
|
out_uint16_be(s, index);
|
|
|
@ -177,11 +181,13 @@ xrdp_mm_send_login(struct xrdp_mm* self)
|
|
|
|
out_uint32_be(s, 0); /* version */
|
|
|
|
out_uint32_be(s, 0); /* version */
|
|
|
|
index = (int)(s->end - s->data);
|
|
|
|
index = (int)(s->end - s->data);
|
|
|
|
out_uint32_be(s, index); /* size */
|
|
|
|
out_uint32_be(s, index); /* size */
|
|
|
|
|
|
|
|
|
|
|
|
rv = trans_force_write(self->sesman_trans);
|
|
|
|
rv = trans_force_write(self->sesman_trans);
|
|
|
|
if (rv != 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
if (rv != 0) {
|
|
|
|
xrdp_wm_log_msg(self->wm, "xrdp_mm_send_login: xrdp_mm_send failed");
|
|
|
|
xrdp_wm_log_msg(self->wm, "xrdp_mm_send_login: xrdp_mm_send_login failed");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return rv;
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -217,6 +223,7 @@ xrdp_mm_get_value(struct xrdp_mm* self, char* aname, char* dest, int dest_len)
|
|
|
|
rv = 0;
|
|
|
|
rv = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return rv;
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -236,15 +243,17 @@ xrdp_mm_setup_mod1(struct xrdp_mm* self)
|
|
|
|
if (xrdp_mm_get_value(self, "lib", lib, 255) != 0)
|
|
|
|
if (xrdp_mm_get_value(self, "lib", lib, 255) != 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
g_snprintf(text, 255, "no library name specified in xrdp.ini, please add "
|
|
|
|
g_snprintf(text, 255, "no library name specified in xrdp.ini, please add "
|
|
|
|
"lib=libxrdp-vnc.so or similar");
|
|
|
|
"lib=libxrdp-vnc.so or similar");
|
|
|
|
xrdp_wm_log_msg(self->wm, text);
|
|
|
|
xrdp_wm_log_msg(self->wm, text);
|
|
|
|
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (lib[0] == 0)
|
|
|
|
if (lib[0] == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
g_snprintf(text, 255, "empty library name specified in xrdp.ini, please "
|
|
|
|
g_snprintf(text, 255, "empty library name specified in xrdp.ini, please "
|
|
|
|
"add lib=libxrdp-vnc.so or similar");
|
|
|
|
"add lib=libxrdp-vnc.so or similar");
|
|
|
|
xrdp_wm_log_msg(self->wm, text);
|
|
|
|
xrdp_wm_log_msg(self->wm, text);
|
|
|
|
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (self->mod_handle == 0)
|
|
|
|
if (self->mod_handle == 0)
|
|
|
@ -260,7 +269,7 @@ xrdp_mm_setup_mod1(struct xrdp_mm* self)
|
|
|
|
if (func == 0)
|
|
|
|
if (func == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
g_snprintf(text, 255, "error finding proc mod_init in %s, not a valid "
|
|
|
|
g_snprintf(text, 255, "error finding proc mod_init in %s, not a valid "
|
|
|
|
"xrdp backend", lib);
|
|
|
|
"xrdp backend", lib);
|
|
|
|
xrdp_wm_log_msg(self->wm, text);
|
|
|
|
xrdp_wm_log_msg(self->wm, text);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
self->mod_init = (struct xrdp_mod* (*)(void))func;
|
|
|
|
self->mod_init = (struct xrdp_mod* (*)(void))func;
|
|
|
@ -272,7 +281,7 @@ xrdp_mm_setup_mod1(struct xrdp_mm* self)
|
|
|
|
if (func == 0)
|
|
|
|
if (func == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
g_snprintf(text, 255, "error finding proc mod_exit in %s, not a valid "
|
|
|
|
g_snprintf(text, 255, "error finding proc mod_exit in %s, not a valid "
|
|
|
|
"xrdp backend", lib);
|
|
|
|
"xrdp backend", lib);
|
|
|
|
xrdp_wm_log_msg(self->wm, text);
|
|
|
|
xrdp_wm_log_msg(self->wm, text);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
self->mod_exit = (int (*)(struct xrdp_mod*))func;
|
|
|
|
self->mod_exit = (int (*)(struct xrdp_mod*))func;
|
|
|
@ -281,7 +290,7 @@ xrdp_mm_setup_mod1(struct xrdp_mm* self)
|
|
|
|
self->mod = self->mod_init();
|
|
|
|
self->mod = self->mod_init();
|
|
|
|
if (self->mod != 0)
|
|
|
|
if (self->mod != 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
g_writeln("loaded modual '%s' ok, interface size %d, version %d", lib,
|
|
|
|
g_writeln("loaded module '%s' ok, interface size %d, version %d", lib,
|
|
|
|
self->mod->size, self->mod->version);
|
|
|
|
self->mod->size, self->mod->version);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -289,7 +298,7 @@ xrdp_mm_setup_mod1(struct xrdp_mm* self)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
g_snprintf(text, 255, "error loading %s specified in xrdp.ini, please "
|
|
|
|
g_snprintf(text, 255, "error loading %s specified in xrdp.ini, please "
|
|
|
|
"add a valid entry like lib=libxrdp-vnc.so or similar", lib);
|
|
|
|
"add a valid entry like lib=libxrdp-vnc.so or similar", lib);
|
|
|
|
xrdp_wm_log_msg(self->wm, text);
|
|
|
|
xrdp_wm_log_msg(self->wm, text);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (self->mod != 0)
|
|
|
|
if (self->mod != 0)
|
|
|
@ -336,13 +345,14 @@ static int APP_CC
|
|
|
|
xrdp_mm_setup_mod2(struct xrdp_mm* self)
|
|
|
|
xrdp_mm_setup_mod2(struct xrdp_mm* self)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
char text[256];
|
|
|
|
char text[256];
|
|
|
|
char* name;
|
|
|
|
char* name = (char *)NULL;
|
|
|
|
char* value;
|
|
|
|
char* value = (char *)NULL;
|
|
|
|
int i;
|
|
|
|
int i = 0;
|
|
|
|
int rv;
|
|
|
|
int rv = 0;
|
|
|
|
int key_flags;
|
|
|
|
int key_flags = 0;
|
|
|
|
int device_flags;
|
|
|
|
int device_flags = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
g_memset(text,0,sizeof(char) * 256);
|
|
|
|
rv = 1;
|
|
|
|
rv = 1;
|
|
|
|
text[0] = 0;
|
|
|
|
text[0] = 0;
|
|
|
|
if (!g_is_wait_obj_set(self->wm->pro_layer->self_term_event))
|
|
|
|
if (!g_is_wait_obj_set(self->wm->pro_layer->self_term_event))
|
|
|
@ -434,13 +444,15 @@ xrdp_mm_setup_mod2(struct xrdp_mm* self)
|
|
|
|
static int APP_CC
|
|
|
|
static int APP_CC
|
|
|
|
xrdp_mm_trans_send_channel_setup(struct xrdp_mm* self, struct trans* trans)
|
|
|
|
xrdp_mm_trans_send_channel_setup(struct xrdp_mm* self, struct trans* trans)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int index;
|
|
|
|
int index = 0;
|
|
|
|
int chan_id;
|
|
|
|
int chan_id = 0;
|
|
|
|
int chan_flags;
|
|
|
|
int chan_flags = 0;
|
|
|
|
int size;
|
|
|
|
int size = 0;
|
|
|
|
struct stream* s;
|
|
|
|
struct stream* s = (struct stream *)NULL;
|
|
|
|
char chan_name[256];
|
|
|
|
char chan_name[256];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
g_memset(chan_name,0,sizeof(char) * 256);
|
|
|
|
|
|
|
|
|
|
|
|
s = trans_get_out_s(trans, 8192);
|
|
|
|
s = trans_get_out_s(trans, 8192);
|
|
|
|
if (s == 0)
|
|
|
|
if (s == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -479,7 +491,7 @@ static int APP_CC
|
|
|
|
xrdp_mm_trans_send_channel_data_response(struct xrdp_mm* self,
|
|
|
|
xrdp_mm_trans_send_channel_data_response(struct xrdp_mm* self,
|
|
|
|
struct trans* trans)
|
|
|
|
struct trans* trans)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
struct stream* s;
|
|
|
|
struct stream* s = (struct stream *)NULL;
|
|
|
|
|
|
|
|
|
|
|
|
s = trans_get_out_s(trans, 8192);
|
|
|
|
s = trans_get_out_s(trans, 8192);
|
|
|
|
if (s == 0)
|
|
|
|
if (s == 0)
|
|
|
@ -509,12 +521,12 @@ xrdp_mm_trans_process_init_response(struct xrdp_mm* self, struct trans* trans)
|
|
|
|
static int APP_CC
|
|
|
|
static int APP_CC
|
|
|
|
xrdp_mm_trans_process_channel_data(struct xrdp_mm* self, struct trans* trans)
|
|
|
|
xrdp_mm_trans_process_channel_data(struct xrdp_mm* self, struct trans* trans)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
struct stream* s;
|
|
|
|
struct stream* s = (struct stream *)NULL;
|
|
|
|
int size;
|
|
|
|
int size = 0;
|
|
|
|
int total_size;
|
|
|
|
int total_size = 0;
|
|
|
|
int chan_id;
|
|
|
|
int chan_id = 0;
|
|
|
|
int chan_flags;
|
|
|
|
int chan_flags = 0;
|
|
|
|
int rv;
|
|
|
|
int rv = 0;
|
|
|
|
|
|
|
|
|
|
|
|
s = trans_get_in_s(trans);
|
|
|
|
s = trans_get_in_s(trans);
|
|
|
|
if (s == 0)
|
|
|
|
if (s == 0)
|
|
|
@ -541,10 +553,10 @@ static int APP_CC
|
|
|
|
xrdp_mm_chan_process_msg(struct xrdp_mm* self, struct trans* trans,
|
|
|
|
xrdp_mm_chan_process_msg(struct xrdp_mm* self, struct trans* trans,
|
|
|
|
struct stream* s)
|
|
|
|
struct stream* s)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int rv;
|
|
|
|
int rv = 0;
|
|
|
|
int id;
|
|
|
|
int id = 0;
|
|
|
|
int size;
|
|
|
|
int size = 0;
|
|
|
|
char* next_msg;
|
|
|
|
char* next_msg = (char *)NULL;
|
|
|
|
|
|
|
|
|
|
|
|
rv = 0;
|
|
|
|
rv = 0;
|
|
|
|
while (s_check_rem(s, 8))
|
|
|
|
while (s_check_rem(s, 8))
|
|
|
@ -584,11 +596,11 @@ xrdp_mm_chan_process_msg(struct xrdp_mm* self, struct trans* trans,
|
|
|
|
static int APP_CC
|
|
|
|
static int APP_CC
|
|
|
|
xrdp_mm_chan_data_in(struct trans* trans)
|
|
|
|
xrdp_mm_chan_data_in(struct trans* trans)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
struct xrdp_mm* self;
|
|
|
|
struct xrdp_mm* self = (struct xrdp_mm *)NULL;
|
|
|
|
struct stream* s;
|
|
|
|
struct stream* s = (struct stream *)NULL;
|
|
|
|
int id;
|
|
|
|
int id = 0;
|
|
|
|
int size;
|
|
|
|
int size = 0;
|
|
|
|
int error;
|
|
|
|
int error = 0;
|
|
|
|
|
|
|
|
|
|
|
|
if (trans == 0)
|
|
|
|
if (trans == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -615,7 +627,7 @@ xrdp_mm_chan_data_in(struct trans* trans)
|
|
|
|
static int APP_CC
|
|
|
|
static int APP_CC
|
|
|
|
xrdp_mm_chan_send_init(struct xrdp_mm* self)
|
|
|
|
xrdp_mm_chan_send_init(struct xrdp_mm* self)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
struct stream* s;
|
|
|
|
struct stream* s = (struct stream *)NULL;
|
|
|
|
|
|
|
|
|
|
|
|
s = trans_get_out_s(self->chan_trans, 8192);
|
|
|
|
s = trans_get_out_s(self->chan_trans, 8192);
|
|
|
|
if (s == 0)
|
|
|
|
if (s == 0)
|
|
|
@ -634,21 +646,25 @@ xrdp_mm_chan_send_init(struct xrdp_mm* self)
|
|
|
|
static int APP_CC
|
|
|
|
static int APP_CC
|
|
|
|
xrdp_mm_process_login_response(struct xrdp_mm* self, struct stream* s)
|
|
|
|
xrdp_mm_process_login_response(struct xrdp_mm* self, struct stream* s)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int ok;
|
|
|
|
int ok = 0;
|
|
|
|
int display;
|
|
|
|
int display = 0;
|
|
|
|
int rv;
|
|
|
|
int rv = 0;
|
|
|
|
int index;
|
|
|
|
int index = 0;
|
|
|
|
char text[256];
|
|
|
|
char text[256];
|
|
|
|
char ip[256];
|
|
|
|
char ip[256];
|
|
|
|
char port[256];
|
|
|
|
char port[256];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
g_memset(text,0,sizeof(char) * 256);
|
|
|
|
|
|
|
|
g_memset(ip,0,sizeof(char) * 256);
|
|
|
|
|
|
|
|
g_memset(port,0,sizeof(char) * 256);
|
|
|
|
rv = 0;
|
|
|
|
rv = 0;
|
|
|
|
in_uint16_be(s, ok);
|
|
|
|
in_uint16_be(s, ok);
|
|
|
|
in_uint16_be(s, display);
|
|
|
|
in_uint16_be(s, display);
|
|
|
|
if (ok)
|
|
|
|
if (ok)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
self->display = display;
|
|
|
|
self->display = display;
|
|
|
|
g_snprintf(text, 255, "login successful for display %d", display);
|
|
|
|
g_snprintf(text, 255, "xrdp_mm_process_login_response: login successful "
|
|
|
|
|
|
|
|
"for display %d", display);
|
|
|
|
xrdp_wm_log_msg(self->wm, text);
|
|
|
|
xrdp_wm_log_msg(self->wm, text);
|
|
|
|
if (xrdp_mm_setup_mod1(self) == 0)
|
|
|
|
if (xrdp_mm_setup_mod1(self) == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -703,7 +719,8 @@ xrdp_mm_process_login_response(struct xrdp_mm* self, struct stream* s)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
xrdp_wm_log_msg(self->wm, "login failed");
|
|
|
|
xrdp_wm_log_msg(self->wm, "xrdp_mm_process_login_response: "
|
|
|
|
|
|
|
|
"login failed");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
self->delete_sesman_trans = 1;
|
|
|
|
self->delete_sesman_trans = 1;
|
|
|
|
self->connected_state = 0;
|
|
|
|
self->connected_state = 0;
|
|
|
@ -712,6 +729,7 @@ xrdp_mm_process_login_response(struct xrdp_mm* self, struct stream* s)
|
|
|
|
xrdp_wm_set_login_mode(self->wm, 11);
|
|
|
|
xrdp_wm_set_login_mode(self->wm, 11);
|
|
|
|
xrdp_mm_module_cleanup(self);
|
|
|
|
xrdp_mm_module_cleanup(self);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return rv;
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -719,14 +737,15 @@ xrdp_mm_process_login_response(struct xrdp_mm* self, struct stream* s)
|
|
|
|
static int
|
|
|
|
static int
|
|
|
|
xrdp_mm_get_sesman_port(char* port, int port_bytes)
|
|
|
|
xrdp_mm_get_sesman_port(char* port, int port_bytes)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int fd;
|
|
|
|
int fd = -1;
|
|
|
|
int error;
|
|
|
|
int error = 0;
|
|
|
|
int index;
|
|
|
|
int index = 0;
|
|
|
|
char* val;
|
|
|
|
char* val = 0;
|
|
|
|
char cfg_file[256];
|
|
|
|
char cfg_file[256];
|
|
|
|
struct list* names;
|
|
|
|
struct list* names = (struct list *)NULL;
|
|
|
|
struct list* values;
|
|
|
|
struct list* values = (struct list *)NULL;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
g_memset(cfg_file,0,sizeof(char) * 256);
|
|
|
|
/* default to port 3350 */
|
|
|
|
/* default to port 3350 */
|
|
|
|
g_strncpy(port, "3350", port_bytes - 1);
|
|
|
|
g_strncpy(port, "3350", port_bytes - 1);
|
|
|
|
/* see if port is in xrdp.ini file */
|
|
|
|
/* see if port is in xrdp.ini file */
|
|
|
@ -762,6 +781,7 @@ xrdp_mm_get_sesman_port(char* port, int port_bytes)
|
|
|
|
list_delete(values);
|
|
|
|
list_delete(values);
|
|
|
|
g_file_close(fd);
|
|
|
|
g_file_close(fd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -772,13 +792,13 @@ int APP_CC
|
|
|
|
xrdp_mm_process_channel_data(struct xrdp_mm* self, tbus param1, tbus param2,
|
|
|
|
xrdp_mm_process_channel_data(struct xrdp_mm* self, tbus param1, tbus param2,
|
|
|
|
tbus param3, tbus param4)
|
|
|
|
tbus param3, tbus param4)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
struct stream* s;
|
|
|
|
struct stream* s = (struct stream *)NULL;
|
|
|
|
int rv;
|
|
|
|
int rv = 0;
|
|
|
|
int length;
|
|
|
|
int length = 0;
|
|
|
|
int total_length;
|
|
|
|
int total_length = 0;
|
|
|
|
int flags;
|
|
|
|
int flags = 0;
|
|
|
|
int id;
|
|
|
|
int id = 0;
|
|
|
|
char* data;
|
|
|
|
char * data = (char *)NULL;
|
|
|
|
|
|
|
|
|
|
|
|
rv = 0;
|
|
|
|
rv = 0;
|
|
|
|
if ((self->chan_trans != 0) && self->chan_trans_up)
|
|
|
|
if ((self->chan_trans != 0) && self->chan_trans_up)
|
|
|
@ -793,7 +813,7 @@ xrdp_mm_process_channel_data(struct xrdp_mm* self, tbus param1, tbus param2,
|
|
|
|
total_length = param4;
|
|
|
|
total_length = param4;
|
|
|
|
if (total_length < length)
|
|
|
|
if (total_length < length)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
g_writeln("warning in xrdp_mm_process_channel_data total_len < length");
|
|
|
|
g_writeln("WARNING in xrdp_mm_process_channel_data(): total_len < length");
|
|
|
|
total_length = length;
|
|
|
|
total_length = length;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
out_uint32_le(s, 0); /* version */
|
|
|
|
out_uint32_le(s, 0); /* version */
|
|
|
@ -809,6 +829,7 @@ xrdp_mm_process_channel_data(struct xrdp_mm* self, tbus param1, tbus param2,
|
|
|
|
rv = trans_force_write(self->chan_trans);
|
|
|
|
rv = trans_force_write(self->chan_trans);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return rv;
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -816,12 +837,12 @@ xrdp_mm_process_channel_data(struct xrdp_mm* self, tbus param1, tbus param2,
|
|
|
|
static int APP_CC
|
|
|
|
static int APP_CC
|
|
|
|
xrdp_mm_sesman_data_in(struct trans* trans)
|
|
|
|
xrdp_mm_sesman_data_in(struct trans* trans)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
struct xrdp_mm* self;
|
|
|
|
struct xrdp_mm* self = (struct xrdp_mm *)NULL;
|
|
|
|
struct stream* s;
|
|
|
|
struct stream* s = (struct stream *)NULL;
|
|
|
|
int version;
|
|
|
|
int version = 0;
|
|
|
|
int size;
|
|
|
|
int size = 0;
|
|
|
|
int error;
|
|
|
|
int error = 0;
|
|
|
|
int code;
|
|
|
|
int code = 0;
|
|
|
|
|
|
|
|
|
|
|
|
if (trans == 0)
|
|
|
|
if (trans == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -849,6 +870,7 @@ xrdp_mm_sesman_data_in(struct trans* trans)
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return error;
|
|
|
|
return error;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -856,21 +878,25 @@ xrdp_mm_sesman_data_in(struct trans* trans)
|
|
|
|
int APP_CC
|
|
|
|
int APP_CC
|
|
|
|
xrdp_mm_connect(struct xrdp_mm* self)
|
|
|
|
xrdp_mm_connect(struct xrdp_mm* self)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
struct list* names;
|
|
|
|
struct list* names = (struct list *)NULL;
|
|
|
|
struct list* values;
|
|
|
|
struct list* values = (struct list *)NULL;
|
|
|
|
int index;
|
|
|
|
int index = 0;
|
|
|
|
int count;
|
|
|
|
int count = 0;
|
|
|
|
int use_sesman;
|
|
|
|
int use_sesman = 0;
|
|
|
|
int error;
|
|
|
|
int error = 0;
|
|
|
|
int ok;
|
|
|
|
int ok = 0;
|
|
|
|
int rv;
|
|
|
|
int rv = 0;
|
|
|
|
char* name;
|
|
|
|
char* name = (char *)NULL;
|
|
|
|
char* value;
|
|
|
|
char* value = (char *)NULL;
|
|
|
|
char ip[256];
|
|
|
|
char ip[256];
|
|
|
|
char errstr[256];
|
|
|
|
char errstr[256];
|
|
|
|
char text[256];
|
|
|
|
char text[256];
|
|
|
|
char port[8];
|
|
|
|
char port[8];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
g_memset(ip,0,sizeof(char) * 256);
|
|
|
|
|
|
|
|
g_memset(errstr,0,sizeof(char) * 256);
|
|
|
|
|
|
|
|
g_memset(text,0,sizeof(char) * 256);
|
|
|
|
|
|
|
|
g_memset(port,0,sizeof(char) * 8);
|
|
|
|
rv = 0;
|
|
|
|
rv = 0;
|
|
|
|
use_sesman = 0;
|
|
|
|
use_sesman = 0;
|
|
|
|
names = self->login_names;
|
|
|
|
names = self->login_names;
|
|
|
@ -950,6 +976,7 @@ xrdp_mm_connect(struct xrdp_mm* self)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
self->sesman_controlled = use_sesman;
|
|
|
|
self->sesman_controlled = use_sesman;
|
|
|
|
|
|
|
|
|
|
|
|
return rv;
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -959,7 +986,7 @@ xrdp_mm_get_wait_objs(struct xrdp_mm* self,
|
|
|
|
tbus* read_objs, int* rcount,
|
|
|
|
tbus* read_objs, int* rcount,
|
|
|
|
tbus* write_objs, int* wcount, int* timeout)
|
|
|
|
tbus* write_objs, int* wcount, int* timeout)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int rv;
|
|
|
|
int rv = 0;
|
|
|
|
|
|
|
|
|
|
|
|
if (self == 0)
|
|
|
|
if (self == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -982,6 +1009,7 @@ xrdp_mm_get_wait_objs(struct xrdp_mm* self,
|
|
|
|
write_objs, wcount, timeout);
|
|
|
|
write_objs, wcount, timeout);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return rv;
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -989,7 +1017,7 @@ xrdp_mm_get_wait_objs(struct xrdp_mm* self,
|
|
|
|
int APP_CC
|
|
|
|
int APP_CC
|
|
|
|
xrdp_mm_check_wait_objs(struct xrdp_mm* self)
|
|
|
|
xrdp_mm_check_wait_objs(struct xrdp_mm* self)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int rv;
|
|
|
|
int rv = 0;
|
|
|
|
|
|
|
|
|
|
|
|
if (self == 0)
|
|
|
|
if (self == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1031,6 +1059,7 @@ xrdp_mm_check_wait_objs(struct xrdp_mm* self)
|
|
|
|
self->chan_trans_up = 0;
|
|
|
|
self->chan_trans_up = 0;
|
|
|
|
self->delete_chan_trans = 0;
|
|
|
|
self->delete_chan_trans = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return rv;
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1038,13 +1067,14 @@ xrdp_mm_check_wait_objs(struct xrdp_mm* self)
|
|
|
|
int DEFAULT_CC
|
|
|
|
int DEFAULT_CC
|
|
|
|
server_begin_update(struct xrdp_mod* mod)
|
|
|
|
server_begin_update(struct xrdp_mod* mod)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
struct xrdp_wm* wm;
|
|
|
|
struct xrdp_wm* wm = (struct xrdp_wm *)NULL;
|
|
|
|
struct xrdp_painter* p;
|
|
|
|
struct xrdp_painter* p = (struct xrdp_painter *)NULL;
|
|
|
|
|
|
|
|
|
|
|
|
wm = (struct xrdp_wm*)(mod->wm);
|
|
|
|
wm = (struct xrdp_wm*)(mod->wm);
|
|
|
|
p = xrdp_painter_create(wm, wm->session);
|
|
|
|
p = xrdp_painter_create(wm, wm->session);
|
|
|
|
xrdp_painter_begin_update(p);
|
|
|
|
xrdp_painter_begin_update(p);
|
|
|
|
mod->painter = (long)p;
|
|
|
|
mod->painter = (long)p;
|
|
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1052,12 +1082,13 @@ server_begin_update(struct xrdp_mod* mod)
|
|
|
|
int DEFAULT_CC
|
|
|
|
int DEFAULT_CC
|
|
|
|
server_end_update(struct xrdp_mod* mod)
|
|
|
|
server_end_update(struct xrdp_mod* mod)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
struct xrdp_painter* p;
|
|
|
|
struct xrdp_painter* p = (struct xrdp_painter *)NULL;
|
|
|
|
|
|
|
|
|
|
|
|
p = (struct xrdp_painter*)(mod->painter);
|
|
|
|
p = (struct xrdp_painter*)(mod->painter);
|
|
|
|
xrdp_painter_end_update(p);
|
|
|
|
xrdp_painter_end_update(p);
|
|
|
|
xrdp_painter_delete(p);
|
|
|
|
xrdp_painter_delete(p);
|
|
|
|
mod->painter = 0;
|
|
|
|
mod->painter = 0;
|
|
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1078,8 +1109,8 @@ server_bell_trigger(struct xrdp_mod* mod)
|
|
|
|
int DEFAULT_CC
|
|
|
|
int DEFAULT_CC
|
|
|
|
server_fill_rect(struct xrdp_mod* mod, int x, int y, int cx, int cy)
|
|
|
|
server_fill_rect(struct xrdp_mod* mod, int x, int y, int cx, int cy)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
struct xrdp_wm* wm;
|
|
|
|
struct xrdp_wm* wm = (struct xrdp_wm *)NULL;
|
|
|
|
struct xrdp_painter* p;
|
|
|
|
struct xrdp_painter* p = (struct xrdp_painter *)NULL;
|
|
|
|
|
|
|
|
|
|
|
|
wm = (struct xrdp_wm*)(mod->wm);
|
|
|
|
wm = (struct xrdp_wm*)(mod->wm);
|
|
|
|
p = (struct xrdp_painter*)(mod->painter);
|
|
|
|
p = (struct xrdp_painter*)(mod->painter);
|
|
|
@ -1316,7 +1347,7 @@ server_draw_text(struct xrdp_mod* mod, int font,
|
|
|
|
int DEFAULT_CC
|
|
|
|
int DEFAULT_CC
|
|
|
|
server_reset(struct xrdp_mod* mod, int width, int height, int bpp)
|
|
|
|
server_reset(struct xrdp_mod* mod, int width, int height, int bpp)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
struct xrdp_wm* wm;
|
|
|
|
struct xrdp_wm* wm = (struct xrdp_wm *)NULL;
|
|
|
|
|
|
|
|
|
|
|
|
wm = (struct xrdp_wm*)(mod->wm);
|
|
|
|
wm = (struct xrdp_wm*)(mod->wm);
|
|
|
|
if (wm->client_info == 0)
|
|
|
|
if (wm->client_info == 0)
|
|
|
@ -1356,7 +1387,7 @@ int DEFAULT_CC
|
|
|
|
server_query_channel(struct xrdp_mod* mod, int index, char* channel_name,
|
|
|
|
server_query_channel(struct xrdp_mod* mod, int index, char* channel_name,
|
|
|
|
int* channel_flags)
|
|
|
|
int* channel_flags)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
struct xrdp_wm* wm;
|
|
|
|
struct xrdp_wm* wm = (struct xrdp_wm *)NULL;
|
|
|
|
|
|
|
|
|
|
|
|
wm = (struct xrdp_wm*)(mod->wm);
|
|
|
|
wm = (struct xrdp_wm*)(mod->wm);
|
|
|
|
if (wm->mm->sesman_controlled)
|
|
|
|
if (wm->mm->sesman_controlled)
|
|
|
@ -1372,7 +1403,7 @@ server_query_channel(struct xrdp_mod* mod, int index, char* channel_name,
|
|
|
|
int DEFAULT_CC
|
|
|
|
int DEFAULT_CC
|
|
|
|
server_get_channel_id(struct xrdp_mod* mod, char* name)
|
|
|
|
server_get_channel_id(struct xrdp_mod* mod, char* name)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
struct xrdp_wm* wm;
|
|
|
|
struct xrdp_wm* wm = (struct xrdp_wm *)NULL;
|
|
|
|
|
|
|
|
|
|
|
|
wm = (struct xrdp_wm*)(mod->wm);
|
|
|
|
wm = (struct xrdp_wm*)(mod->wm);
|
|
|
|
if (wm->mm->sesman_controlled)
|
|
|
|
if (wm->mm->sesman_controlled)
|
|
|
@ -1388,7 +1419,7 @@ server_send_to_channel(struct xrdp_mod* mod, int channel_id,
|
|
|
|
char* data, int data_len,
|
|
|
|
char* data, int data_len,
|
|
|
|
int total_data_len, int flags)
|
|
|
|
int total_data_len, int flags)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
struct xrdp_wm* wm;
|
|
|
|
struct xrdp_wm* wm = (struct xrdp_wm *)NULL;
|
|
|
|
|
|
|
|
|
|
|
|
wm = (struct xrdp_wm*)(mod->wm);
|
|
|
|
wm = (struct xrdp_wm*)(mod->wm);
|
|
|
|
if (wm->mm->sesman_controlled)
|
|
|
|
if (wm->mm->sesman_controlled)
|
|
|
|