temp hack for starting Xrdp

ulab-original
jsorg71 19 years ago
parent 9554e85203
commit 59fc01e215

@ -37,6 +37,7 @@ struct session_item g_session_items[100]; /* sesman.h */
extern int g_session_count;
#endif
struct config_sesman g_cfg; /* config.h */
int g_server_type = 0; /* Xvnc 0 Xrdp 10 */
/**
*
@ -134,8 +135,9 @@ sesman_main_loop()
if (version == 0)
{
in_uint16_be(in_s, code);
if (code == 0) /* check username - password, start session */
{
if (code == 0 || code == 10) /* check username - password, */
{ /* start session */
g_server_type = code;
in_uint16_be(in_s, i);
in_uint8a(in_s, user, i);
user[i] = 0;

@ -27,6 +27,7 @@
extern unsigned char g_fixedkey[8];
extern struct config_sesman g_cfg; /* config.h */
extern int g_server_type;
#ifdef OLDSESSION
extern struct session_item g_session_items[100]; /* sesman.h */
#else
@ -135,14 +136,14 @@ session_start(int width, int height, int bpp, char* username, char* password,
/*while (x_server_running(display) && display < 50)*/
/* we search for a free display up to max_sessions */
/* we should need no more displays than this */
while (x_server_running(display) && (display <= g_cfg.sess.max_sessions))
while (x_server_running(display))
{
display++;
}
if (display >= 50)
if ((display - 10) > g_cfg.sess.max_sessions || display >= 50)
{
return 0;
}
}
wmpid = 0;
pid = g_fork();
if (pid == -1)
@ -198,9 +199,16 @@ session_start(int width, int height, int bpp, char* username, char* password,
{
env_set_user(username, passwd_file, display);
env_check_password_file(passwd_file, password);
if (g_server_type == 0)
{
g_execlp11("Xvnc", "Xvnc", screen, "-geometry", geometry,
"-depth", depth, "-bs", "-rfbauth", passwd_file, 0);
}
else if (g_server_type == 10)
{
g_execlp11("Xrdp", "Xrdp", screen, "-geometry", geometry,
"-depth", depth, "-bs", 0, 0, 0);
}
/* should not get here */
log_message(LOG_LEVEL_ALWAYS,"error doing execve for user %s - pid %d",username,g_getpid());
g_exit(0);

Loading…
Cancel
Save