Merge pull request #1595 from matt335672/reset-improvements
Prevent chansrv input channels being scanned during a server reset
This commit is contained in:
commit
1c99d0a366
@ -47,6 +47,7 @@ libxrdp_init(tbus id, struct trans *trans)
|
||||
session->rdp = xrdp_rdp_create(session, trans);
|
||||
session->orders = xrdp_orders_create(session, (struct xrdp_rdp *)session->rdp);
|
||||
session->client_info = &(((struct xrdp_rdp *)session->rdp)->client_info);
|
||||
session->check_for_app_input = 1;
|
||||
return session;
|
||||
}
|
||||
|
||||
@ -1078,7 +1079,12 @@ libxrdp_reset(struct xrdp_session *session,
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* shut down the rdp client */
|
||||
/* shut down the rdp client
|
||||
*
|
||||
* When resetting the lib, disable application input checks, as
|
||||
* otherwise we can send a channel message to the other end while
|
||||
* the channels are inactive ([MS-RDPBCGR] 3.2.5.5.1 */
|
||||
session->check_for_app_input = 0;
|
||||
if (xrdp_rdp_send_deactivate((struct xrdp_rdp *)session->rdp) != 0)
|
||||
{
|
||||
return 1;
|
||||
@ -1090,6 +1096,9 @@ libxrdp_reset(struct xrdp_session *session,
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Re-enable application input checks */
|
||||
session->check_for_app_input = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -66,6 +66,7 @@ struct xrdp_session
|
||||
struct trans *trans;
|
||||
int (*callback)(intptr_t id, int msg, intptr_t param1, intptr_t param2,
|
||||
intptr_t param3, intptr_t param4);
|
||||
int check_for_app_input;
|
||||
void *rdp;
|
||||
void *orders;
|
||||
struct xrdp_client_info *client_info;
|
||||
|
@ -146,7 +146,10 @@ xrdp_fastpath_send(struct xrdp_fastpath *self, struct stream *s)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
xrdp_fastpath_session_callback(self, 0x5556, 0, 0, 0, 0);
|
||||
if (self->session->check_for_app_input)
|
||||
{
|
||||
xrdp_fastpath_session_callback(self, 0x5556, 0, 0, 0, 0);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -997,8 +997,11 @@ xrdp_mcs_call_callback(struct xrdp_mcs *self)
|
||||
{
|
||||
if (session->callback != 0)
|
||||
{
|
||||
/* in xrdp_wm.c */
|
||||
rv = session->callback(session->id, 0x5556, 0, 0, 0, 0);
|
||||
if (session->check_for_app_input)
|
||||
{
|
||||
/* in xrdp_wm.c */
|
||||
rv = session->callback(session->id, 0x5556, 0, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user