diff options
author | jsorg71 <jsorg71> | 2006-02-05 05:46:48 +0000 |
---|---|---|
committer | jsorg71 <jsorg71> | 2006-02-05 05:46:48 +0000 |
commit | 59fc01e215e88d36ba533d514b8e907a27a824bc (patch) | |
tree | 35b280203e27fc041815dbec32db79727aa1e293 /sesman/session.c | |
parent | 9554e8520322335dbf11e689268aff1706861d7c (diff) | |
download | xrdp-proprietary-59fc01e215e88d36ba533d514b8e907a27a824bc.tar.gz xrdp-proprietary-59fc01e215e88d36ba533d514b8e907a27a824bc.zip |
temp hack for starting Xrdp
Diffstat (limited to 'sesman/session.c')
-rw-r--r-- | sesman/session.c | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/sesman/session.c b/sesman/session.c index 826e4036..9b2965e1 100644 --- a/sesman/session.c +++ b/sesman/session.c @@ -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 @@ -105,7 +106,7 @@ session_start(int width, int height, int bpp, char* username, char* password, #ifndef OLDSESSION struct session_chain* temp; #endif - + /*THREAD-FIX lock to control g_session_count*/ /* check to limit concurrent sessions */ if (g_session_count >= g_cfg.sess.max_sessions) @@ -113,7 +114,7 @@ session_start(int width, int height, int bpp, char* username, char* password, log_message(LOG_LEVEL_INFO, "max concurrent session limit exceeded. login for user %s denied", username); return 0; } - + #ifndef OLDSESSION temp=malloc(sizeof(struct session_chain)); if (temp == 0) @@ -135,13 +136,13 @@ 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) - { - return 0; + if ((display - 10) > g_cfg.sess.max_sessions || display >= 50) + { + return 0; + } } wmpid = 0; pid = g_fork(); @@ -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); - g_execlp11("Xvnc", "Xvnc", screen, "-geometry", geometry, - "-depth", depth, "-bs", "-rfbauth", passwd_file, 0); - + 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); |