Merge branch 'devel' into v0.9

This commit is contained in:
Koichiro IWAO 2017-07-13 14:35:21 +09:00
commit 28a1e42f98
5 changed files with 59 additions and 23 deletions

View File

@ -1,14 +1,18 @@
# Release notes for xrdp v0.9.3 (2017/07/07)
# Release notes for xrdp v0.9.3 (2017/07/15)
## New features
* Log user-friendly messages when certificate/privkey is inaccessible
## Bugfixes
* Now sesman sets mandatory LOGNAME environment variable #725
* Now sesman ensures socket directory present #801
* Exit with failure status if port already in use #644
* Eliminate some hard coded paths
* Fix a glitch with IPv4 struct initialization #803
* Fix some keyboard layout integration (UK, Spanish)
* Fix handle OS when IPv6 disabled #714
* Fix issues around systemd session #778
* Fix protocol error when 32 bit color and non RemoteFX session #737 #804
* Fix sesadmin shows error when no sessions #797
* Fix TLS spins 100% CPU #728
* Fix Xvnc backend disconnects when some data copied to clipboard #755
@ -19,6 +23,9 @@
* Optimize startwm.sh for SUSE
* Several cleanups and optimizations
## Known issues
* Windows 10 (1703) shows black blank screen in RemoteFX mode
-----------------------
# Release notes for xrdp v0.9.2 (2017/03/30)

View File

@ -118,7 +118,8 @@ g_mk_temp_dir(const char *app_name)
/* if failed, still check if it got created by someone else */
if (!g_directory_exist(XRDP_SOCKET_PATH))
{
printf("g_mk_temp_dir: g_create_dir(%s) failed\n",
log_message(LOG_LEVEL_ERROR,
"g_mk_temp_dir: g_create_dir(%s) failed",
XRDP_SOCKET_PATH);
return 1;
}
@ -1012,7 +1013,7 @@ bind_loopback(int sck, const char *port)
errno6 = errno;
// else IPv4
g_memset(&sa, 0, sizeof(s));
g_memset(&s, 0, sizeof(s));
s.sin_family = AF_INET;
s.sin_addr.s_addr = htonl(INADDR_LOOPBACK); // IPv4 127.0.0.1
s.sin_port = htons((tui16)atoi(port));

View File

@ -38,7 +38,8 @@
} \
}
#define MAX_ORDERS_SIZE (16 * 1024 - 256)
#define MAX_ORDERS_SIZE(_client_info) \
(MAX((_client_info)->max_fastpath_frag_bytes, 16 * 1024) - 256);
/*****************************************************************************/
struct xrdp_orders *
@ -220,13 +221,15 @@ int
xrdp_orders_check(struct xrdp_orders *self, int max_size)
{
int size;
int max_packet_size;
int max_order_size;
struct xrdp_client_info *ci;
max_packet_size = MAX_ORDERS_SIZE;
ci = &(self->rdp_layer->client_info);
max_order_size = MAX_ORDERS_SIZE(ci);
if (self->order_level < 1)
{
if (max_size > max_packet_size)
if (max_size > max_order_size)
{
return 1;
}
@ -243,14 +246,14 @@ xrdp_orders_check(struct xrdp_orders *self, int max_size)
g_writeln("error in xrdp_orders_check, size too small: %d bytes", size);
return 1;
}
if (size > max_packet_size)
if (size > max_order_size)
{
/* this suggests someone calls this function without passing the
correct max_size so we end up putting more into the buffer
than we indicate we can */
g_writeln("error in xrdp_orders_check, size too big: %d bytes", size);
/* We where getting called with size already greater than
max_packet_size
max_order_size
Which I suspect was because the sending of text did not include
the text len to check the buffer size. So attempt to send the data
anyway.
@ -258,7 +261,7 @@ xrdp_orders_check(struct xrdp_orders *self, int max_size)
/* return 1; */
}
if ((size + max_size + 100) > max_packet_size)
if ((size + max_size + 100) > max_order_size)
{
xrdp_orders_force_send(self);
xrdp_orders_init(self);
@ -2217,6 +2220,8 @@ xrdp_orders_send_raw_bitmap(struct xrdp_orders *self,
int j = 0;
int pixel = 0;
int e = 0;
int max_order_size;
struct xrdp_client_info *ci;
if (width > 64)
{
@ -2239,7 +2244,9 @@ xrdp_orders_send_raw_bitmap(struct xrdp_orders *self,
Bpp = (bpp + 7) / 8;
bufsize = (width + e) * height * Bpp;
while (bufsize + 16 > MAX_ORDERS_SIZE)
ci = &(self->rdp_layer->client_info);
max_order_size = MAX_ORDERS_SIZE(ci);
while (bufsize + 16 > max_order_size)
{
height--;
bufsize = (width + e) * height * Bpp;
@ -2339,6 +2346,8 @@ xrdp_orders_send_bitmap(struct xrdp_orders *self,
struct stream *s = NULL;
struct stream *temp_s = NULL;
char *p = NULL;
int max_order_size;
struct xrdp_client_info *ci;
if (width > 64)
{
@ -2352,6 +2361,9 @@ xrdp_orders_send_bitmap(struct xrdp_orders *self,
return 1;
}
ci = &(self->rdp_layer->client_info);
max_order_size = MAX_ORDERS_SIZE(ci);
e = width % 4;
if (e != 0)
@ -2368,13 +2380,13 @@ xrdp_orders_send_bitmap(struct xrdp_orders *self,
if (bpp > 24)
{
lines_sending = xrdp_bitmap32_compress(data, width, height, s,
bpp, MAX_ORDERS_SIZE,
bpp, max_order_size,
i - 1, temp_s, e, 0x10);
}
else
{
lines_sending = xrdp_bitmap_compress(data, width, height, s,
bpp, MAX_ORDERS_SIZE,
bpp, max_order_size,
i - 1, temp_s, e);
}
@ -2490,8 +2502,9 @@ xrdp_orders_send_raw_bitmap2(struct xrdp_orders *self,
int j = 0;
int pixel = 0;
int e = 0;
int max_order_size;
struct xrdp_client_info *ci;
g_writeln("xrdp_orders_send_raw_bitmap2:");
if (width > 64)
{
g_writeln("error, width > 64");
@ -2504,6 +2517,9 @@ xrdp_orders_send_raw_bitmap2(struct xrdp_orders *self,
return 1;
}
ci = &(self->rdp_layer->client_info);
max_order_size = MAX_ORDERS_SIZE(ci);
e = width % 4;
if (e != 0)
@ -2513,7 +2529,7 @@ xrdp_orders_send_raw_bitmap2(struct xrdp_orders *self,
Bpp = (bpp + 7) / 8;
bufsize = (width + e) * height * Bpp;
while (bufsize + 14 > MAX_ORDERS_SIZE)
while (bufsize + 14 > max_order_size)
{
height--;
bufsize = (width + e) * height * Bpp;
@ -2614,6 +2630,8 @@ xrdp_orders_send_bitmap2(struct xrdp_orders *self,
struct stream *s = NULL;
struct stream *temp_s = NULL;
char *p = NULL;
int max_order_size;
struct xrdp_client_info *ci;
if (width > 64)
{
@ -2627,6 +2645,9 @@ xrdp_orders_send_bitmap2(struct xrdp_orders *self,
return 1;
}
ci = &(self->rdp_layer->client_info);
max_order_size = MAX_ORDERS_SIZE(ci);
e = width % 4;
if (e != 0)
@ -2643,13 +2664,13 @@ xrdp_orders_send_bitmap2(struct xrdp_orders *self,
if (bpp > 24)
{
lines_sending = xrdp_bitmap32_compress(data, width, height, s,
bpp, MAX_ORDERS_SIZE,
bpp, max_order_size,
i - 1, temp_s, e, 0x10);
}
else
{
lines_sending = xrdp_bitmap_compress(data, width, height, s,
bpp, MAX_ORDERS_SIZE,
bpp, max_order_size,
i - 1, temp_s, e);
}

View File

@ -417,7 +417,10 @@ main(int argc, char **argv)
log_message(LOG_LEVEL_INFO,
"starting xrdp-sesman with pid %d", g_pid);
/* make sure the /tmp/.X11-unix directory exist */
/* make sure the socket directory exists */
g_mk_temp_dir("xrdp-sesman");
/* make sure the /tmp/.X11-unix directory exists */
if (!g_directory_exist("/tmp/.X11-unix"))
{
if (!g_create_dir("/tmp/.X11-unix"))

View File

@ -457,7 +457,6 @@ session_start_fork(tbus data, tui8 type, struct SCP_CONNECTION *c,
return 0;
}
auth_start_session(data, display);
pid = g_fork(); /* parent is fork from tcp accept,
child forks X and wm, then becomes scp */
@ -466,6 +465,9 @@ session_start_fork(tbus data, tui8 type, struct SCP_CONNECTION *c,
}
else if (pid == 0)
{
log_message(LOG_LEVEL_INFO, "calling auth_start_session from pid %d",
g_getpid());
auth_start_session(data, display);
g_delete_wait_obj(g_term_event);
g_tcp_close(g_sck);
g_tcp_close(c->in_sck);
@ -788,6 +790,10 @@ session_start_fork(tbus data, tui8 type, struct SCP_CONNECTION *c,
g_waitpid(window_manager_pid);
log_message(LOG_LEVEL_ALWAYS, "window manager (pid %d) did "
"exit, cleaning up session", window_manager_pid);
log_message(LOG_LEVEL_INFO, "calling auth_stop_session and "
"auth_end from pid %d", g_getpid());
auth_stop_session(data);
auth_end(data);
g_sigterm(display_pid);
g_sigterm(chansrv_pid);
g_deinit();
@ -917,8 +923,6 @@ session_kill(int pid)
if (tmp->item->pid == pid)
{
auth_stop_session(tmp->item->data);
auth_end(tmp->item->data);
/* deleting the session */
log_message(LOG_LEVEL_INFO, "++ terminated session: username %s, display :%d.0, session_pid %d, ip %s", tmp->item->name, tmp->item->display, tmp->item->pid, tmp->item->client_ip);
g_free(tmp->item);