summaryrefslogtreecommitdiffstats
path: root/libxrdp
diff options
context:
space:
mode:
Diffstat (limited to 'libxrdp')
-rw-r--r--libxrdp/libxrdp.c8
-rw-r--r--libxrdp/libxrdpinc.h2
-rw-r--r--libxrdp/xrdp_mcs.c2
-rw-r--r--libxrdp/xrdp_orders.c20
-rw-r--r--libxrdp/xrdp_rdp.c31
-rw-r--r--libxrdp/xrdp_sec.c2
6 files changed, 42 insertions, 23 deletions
diff --git a/libxrdp/libxrdp.c b/libxrdp/libxrdp.c
index 0b92668a..c3763bf5 100644
--- a/libxrdp/libxrdp.c
+++ b/libxrdp/libxrdp.c
@@ -485,12 +485,12 @@ libxrdp_send_bitmap(struct xrdp_session *session, int width, int height,
if (j > 32768)
{
- g_writeln("error, decompressed size too big, its %d", j);
+ g_writeln("error, decompressed size too big: %d bytes", j);
}
if (bufsize > 8192)
{
- g_writeln("error, compressed size too big, its %d", bufsize);
+ g_writeln("error, compressed size too big: %d bytes", bufsize);
}
s->p = s->end;
@@ -504,7 +504,7 @@ libxrdp_send_bitmap(struct xrdp_session *session, int width, int height,
if (total_bufsize > 8192)
{
- g_writeln("error, total compressed size too big, its %d",
+ g_writeln("error, total compressed size too big: %d bytes",
total_bufsize);
}
}
@@ -1077,7 +1077,7 @@ libxrdp_query_channel(struct xrdp_session *session, int index,
/* returns a zero based index of the channel, -1 if error or it doesn't
exist */
int EXPORT_CC
-libxrdp_get_channel_id(struct xrdp_session *session, char *name)
+libxrdp_get_channel_id(struct xrdp_session *session, const char *name)
{
int index = 0;
int count = 0;
diff --git a/libxrdp/libxrdpinc.h b/libxrdp/libxrdpinc.h
index b23fd340..275b674a 100644
--- a/libxrdp/libxrdpinc.h
+++ b/libxrdp/libxrdpinc.h
@@ -189,7 +189,7 @@ int DEFAULT_CC
libxrdp_query_channel(struct xrdp_session *session, int index,
char *channel_name, int *channel_flags);
int DEFAULT_CC
-libxrdp_get_channel_id(struct xrdp_session *session, char *name);
+libxrdp_get_channel_id(struct xrdp_session *session, const char *name);
int DEFAULT_CC
libxrdp_send_to_channel(struct xrdp_session *session, int channel_id,
char *data, int data_len,
diff --git a/libxrdp/xrdp_mcs.c b/libxrdp/xrdp_mcs.c
index 6f04e719..8ed821e9 100644
--- a/libxrdp/xrdp_mcs.c
+++ b/libxrdp/xrdp_mcs.c
@@ -1023,7 +1023,7 @@ xrdp_mcs_send(struct xrdp_mcs *self, struct stream *s, int chan)
if (len > 8192 * 2)
{
- g_writeln("error in xrdp_mcs_send, size too big, its %d", len);
+ g_writeln("error in xrdp_mcs_send, size too big: %d bytes", len);
}
//if (len > max_len)
diff --git a/libxrdp/xrdp_orders.c b/libxrdp/xrdp_orders.c
index 697d2a5a..18a5ad38 100644
--- a/libxrdp/xrdp_orders.c
+++ b/libxrdp/xrdp_orders.c
@@ -236,7 +236,7 @@ xrdp_orders_check(struct xrdp_orders *self, int max_size)
size = (int)(self->out_s->p - self->order_count_ptr);
if (size < 0)
{
- g_writeln("error in xrdp_orders_check, size too small, its %d", size);
+ g_writeln("error in xrdp_orders_check, size too small: %d bytes", size);
return 1;
}
if (size > max_packet_size)
@@ -244,7 +244,7 @@ xrdp_orders_check(struct xrdp_orders *self, int max_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, its %d", size);
+ 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
Which I suspect was because the sending of text did not include
@@ -507,7 +507,7 @@ xrdp_orders_rect(struct xrdp_orders *self, int x, int y, int cx, int cy,
if (rect != 0)
{
- /* if clip is present, still check if its needed */
+ /* if clip is present, still check if it's needed */
if (x < rect->left || y < rect->top ||
x + cx > rect->right || y + cy > rect->bottom)
{
@@ -678,7 +678,7 @@ xrdp_orders_screen_blt(struct xrdp_orders *self, int x, int y,
if (rect != 0)
{
- /* if clip is present, still check if its needed */
+ /* if clip is present, still check if it's needed */
if (x < rect->left || y < rect->top ||
x + cx > rect->right || y + cy > rect->bottom)
{
@@ -870,7 +870,7 @@ xrdp_orders_pat_blt(struct xrdp_orders *self, int x, int y,
if (rect != 0)
{
- /* if clip is present, still check if its needed */
+ /* if clip is present, still check if it's needed */
if (x < rect->left || y < rect->top ||
x + cx > rect->right || y + cy > rect->bottom)
{
@@ -1087,7 +1087,7 @@ xrdp_orders_dest_blt(struct xrdp_orders *self, int x, int y,
if (rect != 0)
{
- /* if clip is present, still check if its needed */
+ /* if clip is present, still check if it's needed */
if (x < rect->left || y < rect->top ||
x + cx > rect->right || y + cy > rect->bottom)
{
@@ -1258,7 +1258,7 @@ xrdp_orders_line(struct xrdp_orders *self, int mix_mode,
if (rect != 0)
{
- /* if clip is present, still check if its needed */
+ /* if clip is present, still check if it's needed */
if (MIN(endx, startx) < rect->left ||
MIN(endy, starty) < rect->top ||
MAX(endx, startx) >= rect->right ||
@@ -1460,7 +1460,7 @@ xrdp_orders_mem_blt(struct xrdp_orders *self, int cache_id,
if (rect != 0)
{
- /* if clip is present, still check if its needed */
+ /* if clip is present, still check if it's needed */
if (x < rect->left || y < rect->top ||
x + cx > rect->right || y + cy > rect->bottom)
{
@@ -1667,7 +1667,7 @@ xrdp_orders_composite_blt(struct xrdp_orders* self, int srcidx, int srcformat,
self->orders_state.last_order = RDP_ORDER_COMPOSITE;
if (rect != 0)
{
- /* if clip is present, still check if its needed */
+ /* if clip is present, still check if it's needed */
if (dstx < rect->left || dsty < rect->top ||
dstx + width > rect->right || dsty + height > rect->bottom)
{
@@ -1999,7 +1999,7 @@ xrdp_orders_text(struct xrdp_orders *self,
if (rect != 0)
{
- /* if clip is present, still check if its needed */
+ /* if clip is present, still check if it's needed */
if ((box_right - box_left > 1 &&
(box_left < rect->left ||
box_top < rect->top ||
diff --git a/libxrdp/xrdp_rdp.c b/libxrdp/xrdp_rdp.c
index fb3b4b51..852a50bf 100644
--- a/libxrdp/xrdp_rdp.c
+++ b/libxrdp/xrdp_rdp.c
@@ -184,12 +184,22 @@ xrdp_rdp_read_config(struct xrdp_client_info *client_info)
else if (g_strcasecmp(item, "certificate") == 0)
{
g_memset(client_info->certificate, 0, sizeof(char) * 1024);
- if (value[0] != '/')
+ if (g_strlen(value) == 0)
{
/* default certificate path */
g_snprintf(client_info->certificate, 1023, "%s/cert.pem", XRDP_CFG_PATH);
- log_message(LOG_LEVEL_ALWAYS,"WARNING: Invalid x.509 certificate path defined, "
- "default path will be used: %s", client_info->certificate);
+ log_message(LOG_LEVEL_INFO,
+ "Missing definition of X.509 certificate, use "
+ "default instead: %s", client_info->certificate);
+
+ }
+ else if (value[0] != '/')
+ {
+ /* default certificate path */
+ g_snprintf(client_info->certificate, 1023, "%s/cert.pem", XRDP_CFG_PATH);
+ log_message(LOG_LEVEL_WARNING,
+ "No absolute path to X.509 certificate, use "
+ "default instead: %s", client_info->certificate);
}
else
{
@@ -200,12 +210,21 @@ xrdp_rdp_read_config(struct xrdp_client_info *client_info)
else if (g_strcasecmp(item, "key_file") == 0)
{
g_memset(client_info->key_file, 0, sizeof(char) * 1024);
- if (value[0] != '/')
+ if (g_strlen(value) == 0)
+ {
+ /* default key_file path */
+ g_snprintf(client_info->key_file, 1023, "%s/key.pem", XRDP_CFG_PATH);
+ log_message(LOG_LEVEL_INFO,
+ "Missing definition of X.509 key file, use "
+ "default instead: %s", client_info->key_file);
+ }
+ else if (value[0] != '/')
{
/* default key_file path */
g_snprintf(client_info->key_file, 1023, "%s/key.pem", XRDP_CFG_PATH);
- log_message(LOG_LEVEL_WARNING,"Invalid X.509 certificate path defined, "
- "default path will be used: %s", client_info->key_file);
+ log_message(LOG_LEVEL_WARNING,
+ "No absolute path to X.509 key file, use"
+ "default instead: %s", client_info->key_file);
}
else
{
diff --git a/libxrdp/xrdp_sec.c b/libxrdp/xrdp_sec.c
index af0cedf2..a31190ca 100644
--- a/libxrdp/xrdp_sec.c
+++ b/libxrdp/xrdp_sec.c
@@ -2101,7 +2101,7 @@ xrdp_sec_in_mcs_data(struct xrdp_sec *self)
client_info = &(self->rdp_layer->client_info);
s = &(self->client_mcs_data);
- /* get hostname, its unicode */
+ /* get hostname, it's unicode */
s->p = s->data;
if (!s_check_rem(s, 47))
{