Commit c2182644 authored by Mihai Moldovan's avatar Mihai Moldovan
Browse files

x2goserver/sbin/x2gocleansessions: replace time check with PID validity check...

x2goserver/sbin/x2gocleansessions: replace time check with PID validity check in check_pid and calls.

The time check was really just a workaround to allow the agent to start
up after a session was formally created, but we already have such a
check in another place.

Instead, treat a missing PID, which can only happen during session
startup, as a success.
parent 1a0fc87a
......@@ -178,6 +178,12 @@ x2goserver (4.1.0.4-0x2go1.2) UNRELEASED; urgency=medium
session without an agent PID entry actually means and use the value from
x2gocleansessions.agent-startup-time (if valid) instead of a hardcoded
value.
- x2goserver/sbin/x2gocleansessions: replace time check with PID validity
check in check_pid and calls. The time check was really just a
workaround to allow the agent to start up after a session was formally
created, but we already have such a check in another place. Instead,
treat a missing PID, which can only happen during session startup, as a
success.
* debian/control:
+ Build-depend upon lsb-release for distro version detection.
* debian/x2goserver.manpages:
......
......@@ -61,8 +61,7 @@ sub check_pid
{
my $pid=shift;
my $sess=shift;
my $sec=shift;
if ($sec < 30)
if (!$pid)
{
return 1;
}
......@@ -252,7 +251,7 @@ elsif ($pid == 0 )
if (@sinfo[4] eq 'F')
{
if (!check_pid (@sinfo[0], @sinfo[1], 100)) {
if (!check_pid (@sinfo[0], @sinfo[1])) {
# No clean up necessary, as the agent is dead.
# Removing sockets again would only lead to potentially
# overwriting the socket another session claimed in-between.
......@@ -304,7 +303,7 @@ elsif ($pid == 0 )
system("su", "@sinfo[11]", "-s", "/bin/sh", "-c", "$x2go_lib_path/x2gormforward @sinfo[1]");
}
}
elsif (! check_pid (@sinfo[0],@sinfo[1],@sinfo[12]))
elsif (! check_pid (@sinfo[0],@sinfo[1]))
{
$user = @sinfo[11];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment