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