|
|
@ -62,11 +62,11 @@ static int g_sync_cmd;
|
|
|
|
char *APP_CC
|
|
|
|
char *APP_CC
|
|
|
|
dumpItemsToString(struct list *self, char *outstr, int len)
|
|
|
|
dumpItemsToString(struct list *self, char *outstr, int len)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
g_memset(outstr, 0, len);
|
|
|
|
|
|
|
|
int index;
|
|
|
|
int index;
|
|
|
|
tbus item;
|
|
|
|
tbus item;
|
|
|
|
int totalLen = 0;
|
|
|
|
int totalLen = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
g_memset(outstr, 0, len);
|
|
|
|
if (self->count == 0)
|
|
|
|
if (self->count == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
g_writeln("List is empty");
|
|
|
|
g_writeln("List is empty");
|
|
|
@ -385,6 +385,7 @@ session_start_fork(int width, int height, int bpp, char *username,
|
|
|
|
int display = 0;
|
|
|
|
int display = 0;
|
|
|
|
int pid = 0;
|
|
|
|
int pid = 0;
|
|
|
|
int wmpid = 0;
|
|
|
|
int wmpid = 0;
|
|
|
|
|
|
|
|
int pampid = 0;
|
|
|
|
int xpid = 0;
|
|
|
|
int xpid = 0;
|
|
|
|
int i = 0;
|
|
|
|
int i = 0;
|
|
|
|
char geometry[32];
|
|
|
|
char geometry[32];
|
|
|
@ -453,24 +454,27 @@ session_start_fork(int width, int height, int bpp, char *username,
|
|
|
|
{
|
|
|
|
{
|
|
|
|
g_tcp_close(g_sck);
|
|
|
|
g_tcp_close(g_sck);
|
|
|
|
g_tcp_close(g_thread_sck);
|
|
|
|
g_tcp_close(g_thread_sck);
|
|
|
|
auth_start_session(data, display);
|
|
|
|
|
|
|
|
g_sprintf(geometry, "%dx%d", width, height);
|
|
|
|
g_sprintf(geometry, "%dx%d", width, height);
|
|
|
|
g_sprintf(depth, "%d", bpp);
|
|
|
|
g_sprintf(depth, "%d", bpp);
|
|
|
|
g_sprintf(screen, ":%d", display);
|
|
|
|
g_sprintf(screen, ":%d", display);
|
|
|
|
wmpid = g_fork();
|
|
|
|
wmpid = g_fork();
|
|
|
|
|
|
|
|
|
|
|
|
if (wmpid == -1)
|
|
|
|
if (wmpid == -1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (wmpid == 0) /* child (child sesman) xserver */
|
|
|
|
else if (wmpid == 0) /* child (child sesman) xserver */
|
|
|
|
{
|
|
|
|
{
|
|
|
|
wait_for_xserver(display);
|
|
|
|
wait_for_xserver(display);
|
|
|
|
|
|
|
|
auth_start_session(data, display);
|
|
|
|
|
|
|
|
pampid = g_fork();
|
|
|
|
|
|
|
|
if (pampid == -1)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (pampid == 0) /* child: X11/client */
|
|
|
|
|
|
|
|
{
|
|
|
|
env_set_user(username, 0, display);
|
|
|
|
env_set_user(username, 0, display);
|
|
|
|
|
|
|
|
|
|
|
|
if (x_server_running(display))
|
|
|
|
if (x_server_running(display))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
auth_set_env(data);
|
|
|
|
auth_set_env(data);
|
|
|
|
|
|
|
|
|
|
|
|
if (directory != 0)
|
|
|
|
if (directory != 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (directory[0] != 0)
|
|
|
|
if (directory[0] != 0)
|
|
|
@ -478,7 +482,6 @@ session_start_fork(int width, int height, int bpp, char *username,
|
|
|
|
g_set_current_dir(directory);
|
|
|
|
g_set_current_dir(directory);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (program != 0)
|
|
|
|
if (program != 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (program[0] != 0)
|
|
|
|
if (program[0] != 0)
|
|
|
@ -489,12 +492,10 @@ session_start_fork(int width, int height, int bpp, char *username,
|
|
|
|
program, username, g_getpid());
|
|
|
|
program, username, g_getpid());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* try to execute user window manager if enabled */
|
|
|
|
/* try to execute user window manager if enabled */
|
|
|
|
if (g_cfg->enable_user_wm)
|
|
|
|
if (g_cfg->enable_user_wm)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
g_sprintf(text, "%s/%s", g_getenv("HOME"), g_cfg->user_wm);
|
|
|
|
g_sprintf(text, "%s/%s", g_getenv("HOME"), g_cfg->user_wm);
|
|
|
|
|
|
|
|
|
|
|
|
if (g_file_exist(text))
|
|
|
|
if (g_file_exist(text))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
g_execlp3(text, g_cfg->user_wm, 0);
|
|
|
|
g_execlp3(text, g_cfg->user_wm, 0);
|
|
|
@ -511,7 +512,6 @@ session_start_fork(int width, int height, int bpp, char *username,
|
|
|
|
g_cfg->user_wm);
|
|
|
|
g_cfg->user_wm);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* if we're here something happened to g_execlp3
|
|
|
|
/* if we're here something happened to g_execlp3
|
|
|
|
so we try running the default window manager */
|
|
|
|
so we try running the default window manager */
|
|
|
|
g_sprintf(text, "%s/%s", XRDP_CFG_PATH, g_cfg->default_wm);
|
|
|
|
g_sprintf(text, "%s/%s", XRDP_CFG_PATH, g_cfg->default_wm);
|
|
|
@ -547,6 +547,13 @@ session_start_fork(int width, int height, int bpp, char *username,
|
|
|
|
log_message(LOG_LEVEL_DEBUG, "aborting connection...");
|
|
|
|
log_message(LOG_LEVEL_DEBUG, "aborting connection...");
|
|
|
|
g_exit(0);
|
|
|
|
g_exit(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
g_waitpid(pampid);
|
|
|
|
|
|
|
|
auth_stop_session(data);
|
|
|
|
|
|
|
|
g_exit(0);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else /* parent (child sesman) */
|
|
|
|
else /* parent (child sesman) */
|
|
|
|
{
|
|
|
|
{
|
|
|
|
xpid = g_fork();
|
|
|
|
xpid = g_fork();
|
|
|
|