summaryrefslogtreecommitdiffstats
path: root/xrdp
diff options
context:
space:
mode:
authorJay Sorg <jay.sorg@gmail.com>2012-03-16 17:57:44 -0700
committerJay Sorg <jay.sorg@gmail.com>2012-03-16 17:57:44 -0700
commitb1246126750f0a8e8c502611f82d503555d0bf94 (patch)
tree33e150cada9dcbf6f9aaf6d79af5d70230932032 /xrdp
parent238d14b60a278c76d0ba983aea290e64c17e652d (diff)
downloadxrdp-proprietary-b1246126750f0a8e8c502611f82d503555d0bf94.tar.gz
xrdp-proprietary-b1246126750f0a8e8c502611f82d503555d0bf94.zip
xrdp: added xrdp.ini options to auto execute a modules and hide log window
Diffstat (limited to 'xrdp')
-rw-r--r--xrdp/xrdp.h2
-rw-r--r--xrdp/xrdp.ini2
-rw-r--r--xrdp/xrdp_mm.c2
-rw-r--r--xrdp/xrdp_types.h1
-rw-r--r--xrdp/xrdp_wm.c58
5 files changed, 52 insertions, 13 deletions
diff --git a/xrdp/xrdp.h b/xrdp/xrdp.h
index 094fd4bd..409a2ace 100644
--- a/xrdp/xrdp.h
+++ b/xrdp/xrdp.h
@@ -91,7 +91,7 @@ xrdp_wm_send_palette(struct xrdp_wm* self);
int APP_CC
xrdp_wm_send_bell(struct xrdp_wm* self);
int APP_CC
-xrdp_wm_load_static_colors(struct xrdp_wm* self);
+xrdp_wm_load_static_colors_plus(struct xrdp_wm* self, char* autorun_name);
int APP_CC
xrdp_wm_load_static_pointers(struct xrdp_wm* self);
int APP_CC
diff --git a/xrdp/xrdp.ini b/xrdp/xrdp.ini
index 433aaa7d..ee4652a9 100644
--- a/xrdp/xrdp.ini
+++ b/xrdp/xrdp.ini
@@ -15,6 +15,8 @@ max_bpp=24
#red=ff0000
#green=00ff00
#background=626c72
+#autorun=xrdp7
+#hidelogwindow=yes
[xrdp1]
name=sesman-Xvnc
diff --git a/xrdp/xrdp_mm.c b/xrdp/xrdp_mm.c
index 29c777ce..055d0f91 100644
--- a/xrdp/xrdp_mm.c
+++ b/xrdp/xrdp_mm.c
@@ -1522,7 +1522,7 @@ server_reset(struct xrdp_mod* mod, int width, int height, int bpp)
xrdp_bitmap_resize(wm->screen, wm->client_info->width,
wm->client_info->height);
/* load some stuff */
- xrdp_wm_load_static_colors(wm);
+ xrdp_wm_load_static_colors_plus(wm, 0);
xrdp_wm_load_static_pointers(wm);
return 0;
}
diff --git a/xrdp/xrdp_types.h b/xrdp/xrdp_types.h
index 3187225a..79ca7acb 100644
--- a/xrdp/xrdp_types.h
+++ b/xrdp/xrdp_types.h
@@ -266,6 +266,7 @@ struct xrdp_wm
struct xrdp_mm* mm;
struct xrdp_font* default_font;
struct xrdp_keymap keymap;
+ int hide_log_window;
};
/* rdp process */
diff --git a/xrdp/xrdp_wm.c b/xrdp/xrdp_wm.c
index ca8e5ce9..8029d517 100644
--- a/xrdp/xrdp_wm.c
+++ b/xrdp/xrdp_wm.c
@@ -309,7 +309,7 @@ unsigned int xrdp_wm_htoi (const char *ptr)
/*****************************************************************************/
int APP_CC
-xrdp_wm_load_static_colors(struct xrdp_wm* self)
+xrdp_wm_load_static_colors_plus(struct xrdp_wm* self, char* autorun_name)
{
int bindex;
int gindex;
@@ -322,6 +322,11 @@ xrdp_wm_load_static_colors(struct xrdp_wm* self)
struct list* values;
char cfg_file[256];
+ if (autorun_name != 0)
+ {
+ autorun_name[0] = 0;
+ }
+
/* initialize with defaults */
self->black = HCOLOR(self->screen->bpp,0x000000);
self->grey = HCOLOR(self->screen->bpp,0xc0c0c0);
@@ -394,6 +399,24 @@ xrdp_wm_load_static_colors(struct xrdp_wm* self)
val = (char*)list_get_item(values, index);
self->background = HCOLOR(self->screen->bpp,xrdp_wm_htoi(val));
}
+ else if (g_strcasecmp(val, "autorun") == 0)
+ {
+ val = (char*)list_get_item(values, index);
+ if (autorun_name != 0)
+ {
+ g_strncpy(autorun_name, val, 255);
+ }
+ }
+ else if (g_strcasecmp(val, "hidelogwindow") == 0)
+ {
+ val = (char*)list_get_item(values, index);
+ if ((g_strcasecmp(val, "yes") == 0) ||
+ (g_strcasecmp(val, "1") == 0) ||
+ (g_strcasecmp(val, "true") == 0))
+ {
+ self->hide_log_window = 1;
+ }
+ }
}
}
}
@@ -462,11 +485,12 @@ xrdp_wm_init(struct xrdp_wm* self)
char* r;
char section_name[256];
char cfg_file[256];
+ char autorun_name[256];
- xrdp_wm_load_static_colors(self);
+ xrdp_wm_load_static_colors_plus(self, autorun_name);
xrdp_wm_load_static_pointers(self);
self->screen->bg_color = self->background;
- if (self->session->client_info->rdp_autologin)
+ if (self->session->client_info->rdp_autologin || (autorun_name[0] != 0))
{
g_snprintf(cfg_file, 255, "%s/xrdp.ini", XRDP_CFG_PATH);
fd = g_file_open(cfg_file); /* xrdp.ini */
@@ -479,18 +503,26 @@ xrdp_wm_init(struct xrdp_wm* self)
g_strncpy(section_name, self->session->client_info->domain, 255);
if (section_name[0] == 0)
{
- /* if no doamin is passed, use the first item in the xrdp.ini
- file thats not named 'globals' */
- file_read_sections(fd, names);
- for (index = 0; index < names->count; index++)
+ if (autorun_name[0] == 0)
{
- q = (char*)list_get_item(names, index);
- if (g_strncasecmp("globals", q, 8) != 0)
+ /* if no doamin is passed, and no autorun in xrdp.ini,
+ use the first item in the xrdp.ini
+ file thats not named 'globals' */
+ file_read_sections(fd, names);
+ for (index = 0; index < names->count; index++)
{
- g_strncpy(section_name, q, 255);
- break;
+ q = (char*)list_get_item(names, index);
+ if (g_strncasecmp("globals", q, 8) != 0)
+ {
+ g_strncpy(section_name, q, 255);
+ break;
+ }
}
}
+ else
+ {
+ g_strncpy(section_name, autorun_name, 255);
+ }
}
list_clear(names);
if (file_read_section(fd, section_name, names, values) == 0)
@@ -1526,6 +1558,10 @@ xrdp_wm_log_msg(struct xrdp_wm* self, char* msg)
int xoffset;
int yoffset;
+ if (self->hide_log_window)
+ {
+ return 0;
+ }
list_add_item(self->log, (long)g_strdup(msg));
if (self->log_wnd == 0)
{