summaryrefslogtreecommitdiffstats
path: root/sesman/session.c
diff options
context:
space:
mode:
authorjsorg71 <jsorg71>2009-08-19 07:27:35 +0000
committerjsorg71 <jsorg71>2009-08-19 07:27:35 +0000
commitdf8527b2517dd3fc6794666a859d2453951d03ad (patch)
tree27afe2746450f919dba1a7682e3469eef9596a88 /sesman/session.c
parent3fd42d808adf82bd910c3e51b4dc89b3d35107fa (diff)
downloadxrdp-proprietary-df8527b2517dd3fc6794666a859d2453951d03ad.tar.gz
xrdp-proprietary-df8527b2517dd3fc6794666a859d2453951d03ad.zip
pass domain, program, and directory to sesman and use directory and program
Diffstat (limited to 'sesman/session.c')
-rw-r--r--sesman/session.c32
1 files changed, 29 insertions, 3 deletions
diff --git a/sesman/session.c b/sesman/session.c
index 29caeac4..92224a17 100644
--- a/sesman/session.c
+++ b/sesman/session.c
@@ -42,6 +42,9 @@ static int g_sync_height;
static int g_sync_bpp;
static char* g_sync_username;
static char* g_sync_password;
+static char* g_sync_domain;
+static char* g_sync_program;
+static char* g_sync_directory;
static tbus g_sync_data;
static tui8 g_sync_type;
static int g_sync_result;
@@ -256,7 +259,8 @@ session_get_aval_display_from_chain(void)
/* called with the main thread */
static int APP_CC
session_start_fork(int width, int height, int bpp, char* username,
- char* password, tbus data, tui8 type)
+ char* password, tbus data, tui8 type, char* domain,
+ char* program, char* directory)
{
int display;
int pid;
@@ -340,6 +344,23 @@ session_start_fork(int width, int height, int bpp, char* username,
if (x_server_running(display))
{
auth_set_env(data);
+ if (directory != 0)
+ {
+ if (directory[0] != 0)
+ {
+ g_set_current_dir(directory);
+ }
+ }
+ if (program != 0)
+ {
+ if (program[0] != 0)
+ {
+ g_execlp3(program, program, 0);
+ log_message(&(g_cfg->log), LOG_LEVEL_ALWAYS,
+ "error starting program %s for user %s - pid %d",
+ program, username, g_getpid());
+ }
+ }
/* try to execute user window manager if enabled */
if (g_cfg->enable_user_wm)
{
@@ -521,7 +542,8 @@ session_start_fork(int width, int height, int bpp, char* username,
and wait till done */
int DEFAULT_CC
session_start(int width, int height, int bpp, char* username, char* password,
- long data, unsigned char type)
+ long data, tui8 type, char* domain, char* program,
+ char* directory)
{
int display;
@@ -533,6 +555,9 @@ session_start(int width, int height, int bpp, char* username, char* password,
g_sync_bpp = bpp;
g_sync_username = username;
g_sync_password = password;
+ g_sync_domain = domain;
+ g_sync_program = program;
+ g_sync_directory = directory;
g_sync_data = data;
g_sync_type = type;
/* set event for main thread to see */
@@ -553,7 +578,8 @@ session_sync_start(void)
{
g_sync_result = session_start_fork(g_sync_width, g_sync_height, g_sync_bpp,
g_sync_username, g_sync_password,
- g_sync_data, g_sync_type);
+ g_sync_data, g_sync_type, g_sync_domain,
+ g_sync_program, g_sync_directory);
lock_sync_sem_release();
return 0;
}