kill disconencted, make work like man page and update man page
This commit is contained in:
parent
069838f355
commit
6700eb18d7
@ -98,9 +98,8 @@ If unset or set to \fI0\fR, unlimited session are allowed.
|
|||||||
|
|
||||||
.TP
|
.TP
|
||||||
\fBKillDisconnected\fR=\fI[0|1]\fR
|
\fBKillDisconnected\fR=\fI[0|1]\fR
|
||||||
If set to \fB1\fR, \fBtrue\fR or \fByes\fR, every session will be killed when the user disconnects.
|
If set to \fB1\fR, \fBtrue\fR or \fByes\fR, every session will be killed within 60 seconds when the user disconnects.
|
||||||
.br
|
.br
|
||||||
\fI\-this option is currently ignored!\-\fR
|
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
\fBIdleTimeLimit\fR=\fI<number>\fR
|
\fBIdleTimeLimit\fR=\fI<number>\fR
|
||||||
@ -112,11 +111,10 @@ If set to \fI0\fR, automatic disconnection is disabled.
|
|||||||
|
|
||||||
.TP
|
.TP
|
||||||
\fBDisconnectedTimeLimit\fR=\fI<number>\fR
|
\fBDisconnectedTimeLimit\fR=\fI<number>\fR
|
||||||
Sets the the time limit before a disconnected session is killed.
|
Sets the the time(in seconds) limit before a disconnected session is killed.
|
||||||
.br
|
.br
|
||||||
If set to \fI0\fR, automatic killing is disabled.
|
If set to \fI0\fR, automatic killing is disabled.
|
||||||
.br
|
.br
|
||||||
\fI\-this option is currently ignored!\-\fR
|
|
||||||
|
|
||||||
.SH "SECURITY"
|
.SH "SECURITY"
|
||||||
The following parameters can be used in the \fB[Sessions]\fR section:
|
The following parameters can be used in the \fB[Sessions]\fR section:
|
||||||
|
@ -17,8 +17,13 @@ AlwaysGroupCheck = false
|
|||||||
[Sessions]
|
[Sessions]
|
||||||
X11DisplayOffset=10
|
X11DisplayOffset=10
|
||||||
MaxSessions=10
|
MaxSessions=10
|
||||||
|
# if 1, true, or yes, kill session after 60 seconds
|
||||||
KillDisconnected=0
|
KillDisconnected=0
|
||||||
|
# if not zero, the seconds without mouse or keyboard input before disconnect
|
||||||
|
# not complete yet
|
||||||
IdleTimeLimit=0
|
IdleTimeLimit=0
|
||||||
|
# if not zero, the seconds before a disconnected session is killed
|
||||||
|
# min 60 seconds
|
||||||
DisconnectedTimeLimit=0
|
DisconnectedTimeLimit=0
|
||||||
|
|
||||||
[Logging]
|
[Logging]
|
||||||
|
@ -137,14 +137,14 @@ static int g_rdp_opcodes[16] =
|
|||||||
static int g_do_kill_disconnected = 0; /* turn on or off */
|
static int g_do_kill_disconnected = 0; /* turn on or off */
|
||||||
static OsTimerPtr g_dis_timer = 0;
|
static OsTimerPtr g_dis_timer = 0;
|
||||||
static int g_disconnect_scheduled = 0;
|
static int g_disconnect_scheduled = 0;
|
||||||
static CARD32 g_disconnect_timeout = 60 * 1000; /* 60 seconds */
|
static CARD32 g_disconnect_timeout_s = 60; /* 60 seconds */
|
||||||
static CARD32 g_disconnect_time = 0; /* time of disconnect */
|
static CARD32 g_disconnect_time_ms = 0; /* time of disconnect in milliseconds */
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
static CARD32
|
static CARD32
|
||||||
rdpDeferredDisconnectCallback(OsTimerPtr timer, CARD32 now, pointer arg)
|
rdpDeferredDisconnectCallback(OsTimerPtr timer, CARD32 now, pointer arg)
|
||||||
{
|
{
|
||||||
CARD32 lnow;
|
CARD32 lnow_ms;
|
||||||
|
|
||||||
LLOGLN(10, ("rdpDeferredDisconnectCallback"));
|
LLOGLN(10, ("rdpDeferredDisconnectCallback"));
|
||||||
if (g_connected)
|
if (g_connected)
|
||||||
@ -165,8 +165,8 @@ rdpDeferredDisconnectCallback(OsTimerPtr timer, CARD32 now, pointer arg)
|
|||||||
{
|
{
|
||||||
LLOGLN(10, ("rdpDeferredDisconnectCallback: not connected"));
|
LLOGLN(10, ("rdpDeferredDisconnectCallback: not connected"));
|
||||||
}
|
}
|
||||||
lnow = GetTimeInMillis();
|
lnow_ms = GetTimeInMillis();
|
||||||
if (lnow - g_disconnect_time > g_disconnect_timeout)
|
if (lnow_ms - g_disconnect_time_ms > g_disconnect_timeout_s * 1000)
|
||||||
{
|
{
|
||||||
LLOGLN(0, ("rdpDeferredDisconnectCallback: exit X11rdp"));
|
LLOGLN(0, ("rdpDeferredDisconnectCallback: exit X11rdp"));
|
||||||
kill(getpid(), SIGTERM);
|
kill(getpid(), SIGTERM);
|
||||||
@ -192,7 +192,7 @@ rdpup_disconnect(void)
|
|||||||
rdpDeferredDisconnectCallback, 0);
|
rdpDeferredDisconnectCallback, 0);
|
||||||
g_disconnect_scheduled = 1;
|
g_disconnect_scheduled = 1;
|
||||||
}
|
}
|
||||||
g_disconnect_time = GetTimeInMillis();
|
g_disconnect_time_ms = GetTimeInMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
RemoveEnabledDevice(g_sck);
|
RemoveEnabledDevice(g_sck);
|
||||||
@ -1063,20 +1063,31 @@ rdpup_init(void)
|
|||||||
ptext = getenv("XRDP_SESMAN_MAX_DISC_TIME");
|
ptext = getenv("XRDP_SESMAN_MAX_DISC_TIME");
|
||||||
if (ptext != 0)
|
if (ptext != 0)
|
||||||
{
|
{
|
||||||
g_disconnect_timeout = atoi(ptext);
|
i = atoi(ptext);
|
||||||
|
if (i > 0)
|
||||||
|
{
|
||||||
|
g_do_kill_disconnected = 1;
|
||||||
|
g_disconnect_timeout_s = atoi(ptext);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ptext = getenv("XRDP_SESMAN_KILL_DISCONNECTED");
|
ptext = getenv("XRDP_SESMAN_KILL_DISCONNECTED");
|
||||||
if (ptext != 0)
|
if (ptext != 0)
|
||||||
{
|
{
|
||||||
g_do_kill_disconnected = atoi(ptext);
|
i = atoi(ptext);
|
||||||
|
if (i != 0)
|
||||||
|
{
|
||||||
|
g_do_kill_disconnected = 1;
|
||||||
|
g_disconnect_timeout_s = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_disconnect_timeout == 0)
|
if (g_do_kill_disconnected && (g_disconnect_timeout_s < 60))
|
||||||
{
|
{
|
||||||
g_do_kill_disconnected = 0;
|
g_disconnect_timeout_s = 60;
|
||||||
}
|
}
|
||||||
rdpLog("kill disconencted [%d] timeout [%d]\n", g_do_kill_disconnected,
|
|
||||||
g_disconnect_timeout);
|
rdpLog("kill disconencted [%d] timeout [%d] sec\n", g_do_kill_disconnected,
|
||||||
|
g_disconnect_timeout_s);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user