Commit 956d8769 authored by Leigh B Stoller's avatar Leigh B Stoller

Tainted images cannot do tarballs, which breaks my recent cleanup of

execute services. So for tainted images use the older method.
parent 4c670299
#!/usr/bin/perl -wT #!/usr/bin/perl -wT
# #
# Copyright (c) 2008-2018 University of Utah and the Flux Group. # Copyright (c) 2008-2019 University of Utah and the Flux Group.
# #
# {{{GENIPUBLIC-LICENSE # {{{GENIPUBLIC-LICENSE
# #
...@@ -1749,13 +1749,13 @@ sub GetTicketAuxAux($) ...@@ -1749,13 +1749,13 @@ sub GetTicketAuxAux($)
"default_osid defined for it.\n"; "default_osid defined for it.\n";
} }
else { else {
my $default_osinfo = OSImage->Lookup($default_osid); $osinfo = OSImage->Lookup($default_osid);
if (!defined($default_osinfo)) { if (!defined($osinfo)) {
print STDERR "Blackbox node type $pctype but cannot ". print STDERR "Blackbox node type $pctype but cannot ".
"lookup default_osid defined for it.\n"; "lookup default_osid defined for it.\n";
} }
else { else {
$osname = $default_osinfo->osname() $osname = $osinfo->osname()
} }
} }
if (!defined($osname)) { if (!defined($osname)) {
...@@ -1783,9 +1783,9 @@ sub GetTicketAuxAux($) ...@@ -1783,9 +1783,9 @@ sub GetTicketAuxAux($)
# #
if (defined($node) && !defined($osname) && !$isbridge && !$isvhost) { if (defined($node) && !defined($osname) && !$isbridge && !$isvhost) {
if (defined($node->default_osid())) { if (defined($node->default_osid())) {
my $default_osinfo = OSImage->Lookup($node->default_osid()); $osinfo = OSImage->Lookup($node->default_osid());
$osname = $default_osinfo->osname() $osname = $osinfo->osname()
if (defined($default_osinfo)); if (defined($osinfo));
} }
} }
# The slot does not like to be NULL. # The slot does not like to be NULL.
...@@ -2009,19 +2009,29 @@ sub GetTicketAuxAux($) ...@@ -2009,19 +2009,29 @@ sub GetTicketAuxAux($)
# We cannot depend on NFS anymore, so package the startfile # We cannot depend on NFS anymore, so package the startfile
# into a little tarball and add to the tarfiles list. # into a little tarball and add to the tarfiles list.
# #
system("$TAR cf $tarfile -C $userdir $startname"); # OK, a tainted disk image is not allowed to download tarballs
if ($?) { # at least until the client side is fixed (perhaps to make root
$response = GeniResponse->Create(GENIRESPONSE_ERROR, undef, # unpacking an option). So if tainted we have to use NFS.
"Could not create startup tarfile for $node_nickname"); #
goto bad; if (defined($osinfo) &&
} !$osinfo->isImageAlias() && $osinfo->IsTainted()) {
if (exists($nodeblob->{'tarfiles'})) { $nodeblob->{'startupcmd'} = "$startfile";
$nodeblob->{'tarfiles'} .= ";/var/tmp $tarfile";
} }
else { else {
$nodeblob->{'tarfiles'} = "/var/tmp $tarfile"; system("$TAR cf $tarfile -C $userdir $startname");
if ($?) {
$response = GeniResponse->Create(GENIRESPONSE_ERROR,undef,
"Could not create startup tarfile for $node_nickname");
goto bad;
}
if (exists($nodeblob->{'tarfiles'})) {
$nodeblob->{'tarfiles'} .= ";/var/tmp $tarfile";
}
else {
$nodeblob->{'tarfiles'} = "/var/tmp $tarfile";
}
$nodeblob->{'startupcmd'} = "/var/tmp/$startname";
} }
$nodeblob->{'startupcmd'} = "/var/tmp/$startname";
} }
my $elabsettings = GeniXML::GetElabInElabSettings($ref); my $elabsettings = GeniXML::GetElabInElabSettings($ref);
......
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