Commit 58e8ff58 authored by Leigh Stoller's avatar Leigh Stoller

Bug fixes.

parent 9a8cf2f8
......@@ -111,15 +111,6 @@ if (defined($options{"d"})) {
if (@ARGV < 2) {
usage();
}
# The web interface (and in the future the xmlrpc interface) sets this.
my $this_user = User->ImpliedUser();
if (! defined($this_user)) {
$this_user = User->ThisUser();
if (!defined($this_user)) {
fatal("You ($UID) do not exist!");
}
}
my $action = shift(@ARGV);
my $uuid = shift(@ARGV);
my $instance = APT_Instance->Lookup($uuid);
......@@ -168,6 +159,15 @@ sub DoSnapshot()
if (!defined($slice)) {
fatal("No slice for quick VM: $uuid");
}
# The web interface (and in the future the xmlrpc interface) sets this.
my $this_user = User->ImpliedUser();
if (! defined($this_user)) {
$this_user = User->ThisUser();
if (!defined($this_user)) {
fatal("You ($UID) do not exist!");
}
}
#
# If we get an imagename on the command line, the caller is
......
......@@ -132,8 +132,14 @@ $canclone = (($profile->published() && isset($this_user) &&
$snapping = 0;
$oneonly = (isset($oneonly) && $oneonly ? 1 : 0);
$isadmin = (ISADMIN() ? 1 : 0);
$dossh = (isset($this_user) &&
$this_user->SameUser($creator) ? 1 : 0);
#
# We give ssh to the creator (real user or guest user).
#
$dossh =
(((isset($this_user) && $this_user->SameUser($creator)) ||
(isset($_COOKIE['quickvm_user']) &&
$_COOKIE['quickvm_user'] == $creator->uuid())) ? 1 : 0);
#
# See if we have a task running in the background for this instance.
......
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