Commit 88f7403c authored by Mike Gabriel's avatar Mike Gabriel
Browse files

finalize teki integration

parent 80b09869
......@@ -240,20 +240,22 @@ sub db_createsession
my $gr_port=shift or die"argument \"gr_port\" missed";
my $snd_port=shift or die"argument \"snd_port\" missed";
my $fs_port=shift or die"argument \"fs_port\" missed";
my $tekictrl_port=shift or die"argument \"tekictrl_port\" missed";
my $tekidata_port=shift or die"argument \"tekidata_port\" missed";
my $sid=shift or die "argument \"session_id\" missed";
if ($backend eq 'postgres')
{
X2Go::Server::DB::PostgreSQL::db_createsession($cookie, $pid, $client, $gr_port, $snd_port, $fs_port, $sid);
X2Go::Server::DB::PostgreSQL::db_createsession($cookie, $pid, $client, $gr_port, $snd_port, $fs_port, $tekictrl_port, $tekidata_port, $sid);
}
if ($backend eq 'sqlite')
{
my $err= system_capture_merged_output("$x2go_lib_path/libx2go-server-db-sqlite3-wrapper", "createsession", "$cookie", "$pid", "$client", "$gr_port", "$snd_port", "$fs_port", "$sid");
my $err= system_capture_merged_output("$x2go_lib_path/libx2go-server-db-sqlite3-wrapper", "createsession", "$cookie", "$pid", "$client", "$gr_port", "$snd_port", "$fs_port", "$tekictrl_port", "$tekidata_port", "$sid");
if ($err ne "ok")
{
die $err;
}
}
syslog('debug', "db_createsession called, session ID: $sid, cookie: $cookie, client: $client, pid: $pid, graphics port: $gr_port, sound port: $snd_port, file sharing port: $fs_port");
syslog('debug', "db_createsession called, session ID: $sid, cookie: $cookie, client: $client, pid: $pid, graphics port: $gr_port, sound port: $snd_port, file sharing port: $fs_port. telekinesis ctrl port: $tekictrl_port, telekinesis data port: $tekidata_port");
}
sub db_createshadowsession
......@@ -325,15 +327,17 @@ sub db_resume
my $gr_port=shift or die "argument \"gr_port\" missed";
my $snd_port=shift or die "argument \"snd_port\" missed";
my $fs_port=shift or die "argument \"fs_port\" missed";
my $tekictrl_port=shift or die"argument \"tekictrl_port\" missed";
my $tekidata_port=shift or die"argument \"tekidata_port\" missed";
if ($backend eq 'postgres')
{
X2Go::Server::DB::PostgreSQL::db_resume($client, $sid, $gr_port, $snd_port, $fs_port);
X2Go::Server::DB::PostgreSQL::db_resume($client, $sid, $gr_port, $snd_port, $fs_port, $tekictrl_port, $tekidata_port);
}
if ($backend eq 'sqlite')
{
system_capture_merged_output("$x2go_lib_path/libx2go-server-db-sqlite3-wrapper", "resume", "$client", "$sid", "$gr_port", "$snd_port", "$fs_port");
system_capture_merged_output("$x2go_lib_path/libx2go-server-db-sqlite3-wrapper", "resume", "$client", "$sid", "$gr_port", "$snd_port", "$fs_port", "$tekictrl_port", "$tekidata_port");
}
syslog('debug', "db_resume called, session ID: $sid, client: $client, gr_port: $gr_port, sound_port: $snd_port, fs_port: $fs_port");
syslog('debug', "db_resume called, session ID: $sid, client: $client, gr_port: $gr_port, sound_port: $snd_port, fs_port: $fs_port, telekinesis ctrl port: $tekictrl_port, telekinesis data port: $tekidata_port");
}
sub db_changestatus
......
......@@ -261,10 +261,10 @@ sub db_createsession
$snd_port = sanitizer('num', $snd_port) or die "argument \"snd_port\" malformed";
my $fs_port=shift or die"argument \"fs_port\" missed";
$fs_port = sanitizer('num', $fs_port) or die "argument \"fs_port\" malformed";
my $tekictrl_port=shift or die"argument \"tekictrl_port\" missed";
$tekictrl_port = sanitizer('num', $tekictrl_port) or die "argument \"tekictrl_port\" malformed";
my $tekidata_port=shift or die"argument \"tekidata_port\" missed";
$tekidata_port = sanitizer('num', $tekidata_port) or die "argument \"tekidata_port\" malformed";
my $tekictrl_port=shift or die "argument \"tekictrl_port\" missed";
$tekictrl_port = sanitizer('pnnum', $tekictrl_port) or die "argument \"tekictrl_port\" malformed";
my $tekidata_port=shift or die "argument \"tekidata_port\" missed";
$tekidata_port = sanitizer('pnnum', $tekidata_port) or die "argument \"tekidata_port\" malformed";
my $sid=shift or die "argument \"session_id\" missed";
$sid = sanitizer('pnixusername', $sid) or die "argument \"session_id\" malformed";
check_user($sid);
......@@ -363,9 +363,9 @@ sub db_resume
my $fs_port=shift or die "argument \"fs_port\" missed";
$fs_port = sanitizer('num', $fs_port) or die "argument \"fs_port\" malformed";
my $tekictrl_port=shift or die"argument \"tekictrl_port\" missed";
$tekictrl_port = sanitizer('num', $tekictrl_port) or die "argument \"tekictrl_port\" malformed";
$tekictrl_port = sanitizer('pnnum', $tekictrl_port) or die "argument \"tekictrl_port\" malformed";
my $tekidata_port=shift or die"argument \"tekidata_port\" missed";
$tekidata_port = sanitizer('num', $tekidata_port) or die "argument \"tekidata_port\" malformed";
$tekidata_port = sanitizer('pnnum', $tekidata_port) or die "argument \"tekidata_port\" malformed";
check_user($sid);
my $sth=$dbh->prepare("update sessions set last_time=datetime('now','localtime'),status='R',
client=?,gr_port=?,sound_port=?,fs_port=?,tekictrl_port=?,tekidata_port=? where session_id = ? and uname=?");
......
......@@ -106,6 +106,12 @@ sub sanitizer {
$string = $1;
return $string;
} else {return 0;}
} elsif ($type eq "pnnum") {
$string =~ s/[^0-9\+\-]//g;
if ($string =~ /^([0-9\+\-]*)$/) {
$string = $1;
return $string;
} else {return 0;}
} elsif ($type eq "anumazcsdaus") {
$string =~ s/[^a-zA-Z0-9\_\-]//g;
if ($string =~ /^([a-zA-Z0-9\_\-]*)$/) {
......
......@@ -188,8 +188,8 @@ while [ "$OUTPUT" != "inserted" ]; do
done
if [ "x$X2GO_TELEKINESIS_ENABLED" == "x0" ]; then
TEKICTRL_PORT="0"
TEKIDATA_PORT="0"
TEKICTRL_PORT="-1"
TEKIDATA_PORT="-1"
fi
while [ "$GR_PORT" == "" ] || [ "$SOUND_PORT" == "" ] || [ "$FS_PORT" == "" ] || [ "$TEKICTRL_PORT" == "" ] || [ "$TEKIDATA_PORT" == "" ]; do
......
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