Commit 556e884f authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

Some not very pretty hacks to allow paperbag to invokde the xmlrpc

server, turning xmlrpc/module into "program module".

I view this as temporary; paperbag exists and allows me to quickly export
the server. Long term, we need a different solution.
parent cd57c6ee
...@@ -42,6 +42,7 @@ my $USERNODE = "@USERNODE@"; ...@@ -42,6 +42,7 @@ my $USERNODE = "@USERNODE@";
"swapexp" => "$TB/bin/swapexp", "swapexp" => "$TB/bin/swapexp",
"endexp" => "$TB/bin/endexp", "endexp" => "$TB/bin/endexp",
"tbreport" => "$TB/bin/tbreport", "tbreport" => "$TB/bin/tbreport",
"xmlrpc/experiment" => "$TB/sbin/sshxmlrpc_server.py",
); );
# #
...@@ -137,8 +138,16 @@ do {{ ...@@ -137,8 +138,16 @@ do {{
} }
} }
# Strip off all path information from the command # xmlrpc is special for now, while we use paperbag for it.
$command =~ /([^\/]+)$/; $command = $1; # Pass the second token as the first arg to the server.
if ($command =~ /^xmlrpc\/(\w*)$/) {
unshift(@args, $1);
$command = "xmlrpc/$1";
}
else {
# Strip off all path information from the command
$command =~ /([^\/]+)$/; $command = $1;
}
next unless $command; # Don't complain if they leave a blank command next unless $command; # Don't complain if they leave a blank command
&debug("Command = $command, @args = " . join ",",@args . "\n"); &debug("Command = $command, @args = " . join ",",@args . "\n");
...@@ -152,7 +161,6 @@ do {{ ...@@ -152,7 +161,6 @@ do {{
} }
next; next;
} }
if (!$allowed{$command}) { if (!$allowed{$command}) {
print "$command is not in the allowed list, sorry\n"; print "$command is not in the allowed list, sorry\n";
} else { } else {
......
...@@ -42,6 +42,7 @@ my $USERNODE = "@USERNODE@"; ...@@ -42,6 +42,7 @@ my $USERNODE = "@USERNODE@";
"swapexp" => "$TB/bin/swapexp", "swapexp" => "$TB/bin/swapexp",
"endexp" => "$TB/bin/endexp", "endexp" => "$TB/bin/endexp",
"tbreport" => "$TB/bin/tbreport", "tbreport" => "$TB/bin/tbreport",
"xmlrpc/experiment" => "$TB/sbin/sshxmlrpc_server.py",
); );
# #
...@@ -137,8 +138,16 @@ do {{ ...@@ -137,8 +138,16 @@ do {{
} }
} }
# Strip off all path information from the command # xmlrpc is special for now, while we use paperbag for it.
$command =~ /([^\/]+)$/; $command = $1; # Pass the second token as the first arg to the server.
if ($command =~ /^xmlrpc\/(\w*)$/) {
unshift(@args, $1);
$command = "xmlrpc/$1";
}
else {
# Strip off all path information from the command
$command =~ /([^\/]+)$/; $command = $1;
}
next unless $command; # Don't complain if they leave a blank command next unless $command; # Don't complain if they leave a blank command
&debug("Command = $command, @args = " . join ",",@args . "\n"); &debug("Command = $command, @args = " . join ",",@args . "\n");
...@@ -152,7 +161,6 @@ do {{ ...@@ -152,7 +161,6 @@ do {{
} }
next; next;
} }
if (!$allowed{$command}) { if (!$allowed{$command}) {
print "$command is not in the allowed list, sorry\n"; print "$command is not in the allowed list, sorry\n";
} else { } else {
......
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