summaryrefslogtreecommitdiffstats
path: root/sesman
diff options
context:
space:
mode:
authorLaxmikant Rashinkar <LK.Rashinkar@gmail.com>2013-08-25 18:02:36 -0700
committerLaxmikant Rashinkar <LK.Rashinkar@gmail.com>2013-08-25 18:02:36 -0700
commit829c494fb9b62c68d1079251ca1c97de84c09c70 (patch)
treeafd76b7fd9cf58b1760cb9bf0b4b85776bcab221 /sesman
parentf8f648c57432a3238a17dc70909947a30ccaebae (diff)
parent1a616a1b469a00279ac6d42cffcd2b23da492c60 (diff)
downloadxrdp-proprietary-829c494fb9b62c68d1079251ca1c97de84c09c70.tar.gz
xrdp-proprietary-829c494fb9b62c68d1079251ca1c97de84c09c70.zip
Merge branch 'master' of github.com:neutrinolabs/xrdp
Diffstat (limited to 'sesman')
-rw-r--r--sesman/chansrv/chansrv.c14
-rw-r--r--sesman/chansrv/chansrv.h3
-rw-r--r--sesman/chansrv/smartcard_pcsc.c4
-rw-r--r--sesman/chansrv/sound.c3
-rw-r--r--sesman/config.c10
-rw-r--r--sesman/sesman.ini5
-rw-r--r--sesman/session.c7
7 files changed, 37 insertions, 9 deletions
diff --git a/sesman/chansrv/chansrv.c b/sesman/chansrv/chansrv.c
index 388d0273..26d4182e 100644
--- a/sesman/chansrv/chansrv.c
+++ b/sesman/chansrv/chansrv.c
@@ -77,6 +77,13 @@ int g_exec_pid = 0;
tui32 g_dvc_chan_id = 100;
/*****************************************************************************/
+int DEFAULT_CC
+g_is_term(void)
+{
+ return g_is_wait_obj_set(g_term_event);
+}
+
+/*****************************************************************************/
/* add data to chan_item, on its way to the client */
/* returns error */
static int APP_CC
@@ -844,13 +851,15 @@ setup_listen(void)
if (g_use_unix_socket)
{
- g_lis_trans = trans_create(2, 8192, 8192);
+ g_lis_trans = trans_create(TRANS_MODE_UNIX, 8192, 8192);
+ g_lis_trans->is_term = g_is_term;
g_snprintf(port, 255, "/tmp/.xrdp/xrdp_chansrv_socket_%d",
7200 + g_display_num);
}
else
{
- g_lis_trans = trans_create(1, 8192, 8192);
+ g_lis_trans = trans_create(TRANS_MODE_TCP, 8192, 8192);
+ g_lis_trans->is_term = g_is_term;
g_snprintf(port, 255, "%d", 7200 + g_display_num);
}
@@ -875,6 +884,7 @@ setup_api_listen(void)
int error = 0;
g_api_lis_trans = trans_create(TRANS_MODE_UNIX, 8192 * 4, 8192 * 4);
+ g_api_lis_trans->is_term = g_is_term;
g_snprintf(port, 255, "/tmp/.xrdp/xrdpapi_%d", g_display_num);
g_api_lis_trans->trans_conn_in = my_api_trans_conn_in;
error = trans_listen(g_api_lis_trans, port);
diff --git a/sesman/chansrv/chansrv.h b/sesman/chansrv/chansrv.h
index bca30ca4..12162dd1 100644
--- a/sesman/chansrv/chansrv.h
+++ b/sesman/chansrv/chansrv.h
@@ -54,6 +54,9 @@ struct xrdp_api_data
int is_connected;
};
+int DEFAULT_CC
+g_is_term(void);
+
int APP_CC send_channel_data(int chan_id, char *data, int size);
int APP_CC main_cleanup(void);
int APP_CC find_empty_slot_in_dvc_channels();
diff --git a/sesman/chansrv/smartcard_pcsc.c b/sesman/chansrv/smartcard_pcsc.c
index a3a269d7..909c7df3 100644
--- a/sesman/chansrv/smartcard_pcsc.c
+++ b/sesman/chansrv/smartcard_pcsc.c
@@ -24,6 +24,7 @@
#define PCSC_STANDIN 1
+#include "chansrv.h"
#include "os_calls.h"
#include "smartcard.h"
#include "log.h"
@@ -258,7 +259,8 @@ scard_pcsc_init(void)
if (g_lis == 0)
{
- g_lis = trans_create(2, 8192, 8192);
+ g_lis = trans_create(TRANS_MODE_UNIX, 8192, 8192);
+ g_lis->is_term = g_is_term;
g_snprintf(g_pcsc_directory, 255, "/tmp/.xrdp/pcsc%d", g_display_num);
if (g_directory_exist(g_pcsc_directory))
{
diff --git a/sesman/chansrv/sound.c b/sesman/chansrv/sound.c
index 9ee3c8c3..2e85f1f2 100644
--- a/sesman/chansrv/sound.c
+++ b/sesman/chansrv/sound.c
@@ -551,7 +551,8 @@ sound_init(void)
LOG(0, ("sound_init:"));
sound_send_server_formats();
- g_audio_l_trans = trans_create(2, 128 * 1024, 8192);
+ g_audio_l_trans = trans_create(TRANS_MODE_UNIX, 128 * 1024, 8192);
+ g_audio_l_trans->is_term = g_is_term;
g_snprintf(port, 255, CHANSRV_PORT_STR, g_display_num);
g_audio_l_trans->trans_conn_in = sound_trans_audio_conn_in;
error = trans_listen(g_audio_l_trans, port);
diff --git a/sesman/config.c b/sesman/config.c
index c7c3de24..877a949c 100644
--- a/sesman/config.c
+++ b/sesman/config.c
@@ -130,7 +130,7 @@ config_read_globals(int file, struct config_sesman *cf, struct list *param_n,
}
else if (0 == g_strcasecmp(buf, SESMAN_CFG_ENABLE_USERWM))
{
- cf->enable_user_wm = text2bool((char *)list_get_item(param_v, i));
+ cf->enable_user_wm = g_text2bool((char *)list_get_item(param_v, i));
}
else if (0 == g_strcasecmp(buf, SESMAN_CFG_PORT))
{
@@ -212,7 +212,7 @@ config_read_logging(int file, struct log_config* lc, struct list* param_n,
}
if (0 == g_strcasecmp(buf, SESMAN_CFG_LOG_ENABLE_SYSLOG))
{
- lc->enable_syslog = text2bool((char*)list_get_item(param_v, i));
+ lc->enable_syslog = g_text2bool((char*)list_get_item(param_v, i));
}
if (0 == g_strcasecmp(buf, SESMAN_CFG_LOG_SYSLOG_LEVEL))
{
@@ -261,7 +261,7 @@ config_read_security(int file, struct config_security *sc,
if (0 == g_strcasecmp(buf, SESMAN_CFG_SEC_ALLOW_ROOT))
{
- sc->allow_root = text2bool((char *)list_get_item(param_v, i));
+ sc->allow_root = g_text2bool((char *)list_get_item(param_v, i));
}
if (0 == g_strcasecmp(buf, SESMAN_CFG_SEC_LOGIN_RETRY))
@@ -288,7 +288,7 @@ config_read_security(int file, struct config_security *sc,
}
if (0 == g_strcasecmp(buf, SESMAN_CFG_SEC_ALWAYSGROUPCHECK))
{
- sc->ts_always_group_check = text2bool((char *)list_get_item(param_v, i));
+ sc->ts_always_group_check = g_text2bool((char *)list_get_item(param_v, i));
}
}
@@ -355,7 +355,7 @@ config_read_sessions(int file, struct config_sessions *se, struct list *param_n,
if (0 == g_strcasecmp(buf, SESMAN_CFG_SESS_KILL_DISC))
{
- se->kill_disconnected = text2bool((char *)list_get_item(param_v, i));
+ se->kill_disconnected = g_text2bool((char *)list_get_item(param_v, i));
}
if (0 == g_strcasecmp(buf, SESMAN_CFG_SESS_IDLE_LIMIT))
diff --git a/sesman/sesman.ini b/sesman/sesman.ini
index 571e063b..02fef5ba 100644
--- a/sesman/sesman.ini
+++ b/sesman/sesman.ini
@@ -17,8 +17,13 @@ AlwaysGroupCheck = false
[Sessions]
X11DisplayOffset=10
MaxSessions=10
+# if 1, true, or yes, kill session after 60 seconds
KillDisconnected=0
+# if not zero, the seconds without mouse or keyboard input before disconnect
+# not complete yet
IdleTimeLimit=0
+# if not zero, the seconds before a disconnected session is killed
+# min 60 seconds
DisconnectedTimeLimit=0
[Logging]
diff --git a/sesman/session.c b/sesman/session.c
index 888604da..c21ecb6a 100644
--- a/sesman/session.c
+++ b/sesman/session.c
@@ -559,6 +559,13 @@ session_start_fork(int width, int height, int bpp, char *username,
env_set_user(username, passwd_file, display);
env_check_password_file(passwd_file, password);
+ g_snprintf(text, 255, "%d", g_cfg->sess.max_idle_time);
+ g_setenv("XRDP_SESMAN_MAX_IDLE_TIME", text, 1);
+ g_snprintf(text, 255, "%d", g_cfg->sess.max_disc_time);
+ g_setenv("XRDP_SESMAN_MAX_DISC_TIME", text, 1);
+ g_snprintf(text, 255, "%d", g_cfg->sess.kill_disconnected);
+ g_setenv("XRDP_SESMAN_KILL_DISCONNECTED", text, 1);
+
if (type == SESMAN_SESSION_TYPE_XVNC)
{
xserver_params = list_create();