Commit 4e221789 authored by Leigh B Stoller's avatar Leigh B Stoller

Merge branch 'master' of git-public.flux.utah.edu:/flux/git/emulab-devel

parents 152c60db 4cde32f8
......@@ -15,8 +15,8 @@ BINDIR= /usr/local/bin
#
WITH_EXTFS = 1
WITH_FFS = 1
WITH_FAT = 0
WITH_NTFS = 0
WITH_FAT = 1
WITH_NTFS = 1
WITH_EXT4FS = 0
PTHREADCFLAGS = -D_THREAD_SAFE -pthread
......@@ -31,27 +31,27 @@ LIBS = -lz $(PTHREADLIBS)
UNZIPCFLAGS = $(CFLAGS) -Wall
UNZIPLIBS = $(LIBS)
ifeq (WITH_EXTFS, 1)
ifeq ($(WITH_EXTFS), 1)
FSOBJS += extfs/extfs.o extfs/reloc_lilo.o
CFLAGS += -DWITH_EXTFS -Iextfs
endif
ifeq (WITH_EXT4FS, 1)
ifeq ($(WITH_EXT4FS), 1)
FSOBJS += ext4fs/ext4fs.o ext4fs/reloc_lilo.o
CFLAGS += -DWITH_EXT4FS -Iext4fs
endif
ifeq (WITH_FFS, 1)
ifeq ($(WITH_FFS), 1)
FSOBJS += ffs/ffs.o
CFLAGS += -DWITH_FFS -Iffs
endif
ifeq (WITH_FAT, 1)
ifeq ($(WITH_FAT), 1)
FSOBJS += fat/fat_fat.o fat/fat_boot.o fat/fat_glue.o
CFLAGS += -DWITH_FAT -Ifat
endif
ifeq (WITH_NTFS, 1)
ifeq ($(WITH_NTFS), 1)
FSOBJS += ntfs/ntfs_glue.o
FSLIBS += ntfs/libntfs/libntfs.a
CFLAGS += -DWITH_NTFS -DOLD_LIBNTFS -Intfs/libntfs/ntfsprogs-1.7.1.linux/include
......
......@@ -663,7 +663,7 @@ sub GetManifest($$)
return $manifest
if (!$asxml);
$xml = $manifest->toString();
$xml = $manifest->toStringC14N();
return $xml;
}
......
......@@ -691,7 +691,7 @@ sub GetTicketAuxAux($$$$$$$$)
}
}
print $rspec->toString();
print $rspec->toStringC14N();
foreach my $ref (GeniXML::FindNodes("n:node", $rspec)->get_nodelist()) {
my $resource_uuid = GeniXML::GetNodeId($ref);
......@@ -1150,7 +1150,7 @@ sub GetTicketAuxAux($$$$$$$$)
}
unlink($tmpfile);
print $solution->toString();
print $solution->toStringC14N();
foreach my $ref (GeniXML::FindNodes("n:node",
$solution)->get_nodelist()) {
......@@ -1211,12 +1211,18 @@ sub GetTicketAuxAux($$$$$$$$)
foreach my $iface_ref (@interfaces) {
my $virtual_node_id = GeniXML::GetText("virtual_node_id",
$iface_ref);
my $virtual_port_id = GeniXML::GetText("virtual_port_id",
my $virtual_port_id = GeniXML::GetText("virtual_interface_id",
$iface_ref) ||
GeniXML::GetText("virtual_port_id",
$iface_ref);
my $component_id = GeniXML::GetText("component_id",
$iface_ref);
if (!defined($virtual_node_id) || !defined($virtual_port_id)) {
$response = GeniResponse->Create(GENIRESPONSE_ERROR, undef,
"Virtual node ID or virtual interface ID missing on interface");
goto bad;
}
my $linkref = $vportmap{"$virtual_node_id:$virtual_port_id"};
$component_id = "lo0"
if (!defined($component_id));
if (! GeniXML::SetText("component_id", $linkref, $component_id)) {
......@@ -1233,7 +1239,7 @@ sub GetTicketAuxAux($$$$$$$$)
goto bad;
}
print $rspec->toString();
print $rspec->toStringC14N();
# Nalloc might fail if the node gets picked up by someone else.
if (@nodeids && !$impotent) {
......@@ -1267,7 +1273,8 @@ sub GetTicketAuxAux($$$$$$$$)
#
# Create a new ticket.
#
my $newticket = GeniTicket->Create($authority, $user, $rspecstr);
my $newticket = GeniTicket->Create($authority, $user,
$rspec->toStringC14N());
if (!defined($newticket)) {
$response =
GeniResponse->Create(GENIRESPONSE_ERROR, undef,
......@@ -1552,7 +1559,7 @@ sub SliverWorkAux($$$$$$$)
my @freelinks= ();
my $needplabslice = 0;
print $rspec->toString();
print $rspec->toStringC14N();
#
# Find current slivers and save.
......@@ -1719,7 +1726,7 @@ sub SliverWorkAux($$$$$$$)
foreach my $ref (GeniXML::FindNodes("n:node",
$rspec)->get_nodelist()) {
my $virtual_id = GeniXML::GetVirtualId($ref);
if ($nickname eq $virtual_id) {
if (defined($virtual_id) && $nickname eq $virtual_id) {
$needfree = 0;
last;
}
......@@ -1799,7 +1806,7 @@ sub SliverWorkAux($$$$$$$)
$rspec)->get_nodelist()) {
my $nickname = GeniXML::GetVirtualId($linkref);
if ($linkname eq $nickname) {
if (defined($nickname) && $linkname eq $nickname) {
$needfree = 0;
last;
}
......@@ -2014,7 +2021,8 @@ sub SliverWorkAux($$$$$$$)
#
# XXX Tunnels are a total kludge right now ...
#
if (GeniXML::GetText("link_type", $linkref) eq "tunnel") {
my $link_type = GeniXML::GetText("link_type", $linkref);
if (defined($link_type) && $link_type eq "tunnel") {
my $iface1ref = $interfaces[0];
my $iface2ref = $interfaces[1];
......@@ -2120,9 +2128,11 @@ sub SliverWorkAux($$$$$$$)
my $interface;
if ($iface_name ne "lo0") {
my ($authority, $short_node, $short_iface) =
GeniHRN::ParseInterface($iface_name);
$iface_name = $short_iface;
if (GeniHRN::IsValid($iface_name)) {
my ($authority, $short_node, $short_iface) =
GeniHRN::ParseInterface($iface_name);
$iface_name = $short_iface;
}
$interface = Interface->LookupByIface($nodeobject,$iface_name);
if (!defined($interface)) {
$message = "No such interface ".
......@@ -2255,7 +2265,7 @@ sub SliverWorkAux($$$$$$$)
}
# The Manifest.
my $manifest = $rspec->toString();
my $manifest = $rspec->toStringC14N();
#
# Move this elsewhere.
......@@ -2601,7 +2611,7 @@ sub StartSliver($)
}
if (defined($manifest)) {
print $manifest->toString();
print $manifest->toStringC14N();
#
# This is not signed, so have to be very careful about using
......@@ -3391,7 +3401,7 @@ sub SliverTicket($)
POSIX::strftime("20%y-%m-%dT%H:%M:%S",
gmtime(str2time($slice->expires()))));
my $rspec_xml = $rspec->toString();
my $rspec_xml = $rspec->toStringC14N();
#
# Create a new ticket.
......@@ -4051,7 +4061,10 @@ sub UpdateManifest($)
}
foreach my $linkref (GeniXML::FindNodes("n:link", $rspec)->get_nodelist()){
my $vname = GeniXML::GetVirtualId($linkref);
my $tag = (exists($vlantags{$vname}) ? $vlantags{$vname} : undef);
my $tag = undef;
if (defined($vname) && exists($vlantags{$vname})) {
$tag = $vlantags{$vname};
}
if (!defined($tag)) {
GeniXML::RemoveChild("vlantag", $linkref);
}
......@@ -4060,7 +4073,7 @@ sub UpdateManifest($)
}
}
my $manifest = $rspec->toString();
my $manifest = $rspec->toStringC14N();
#
# Move this elsewhere.
......
......@@ -408,7 +408,7 @@ sub DeleteSliver($)
$response = GeniResponse->Create(GENIRESPONSE_ERROR);
goto bad;
}
my $ticket = GeniTicket->Create($authority, $user, $manifest);
my $ticket = GeniTicket->Create($authority, $user, $manifest->toStringC14N());
if (!defined($ticket)) {
print STDERR "Could not create new ticket for $slice\n";
$response = GeniResponse->Create(GENIRESPONSE_ERROR);
......
......@@ -431,7 +431,7 @@ sub Sign($$)
if ($self->extensions()->size() > 0) {
$cap_xml .= "<extensions>\n";
foreach my $node ($self->extensions()->get_nodelist()) {
$cap_xml .= $node->toString();
$cap_xml .= $node->toStringC14N();
}
$cap_xml .= "</extensions>\n";
}
......
......@@ -320,7 +320,7 @@ sub UpdateManifest($$)
return -1;
}
my $manifest_idx = $self->manifest_idx();
my $manifest_string = $manifest->toString();
my $manifest_string = $manifest->toStringC14N();
my $query_result =
DBQueryWarn("update geni_manifests set ".
......@@ -363,7 +363,7 @@ sub GetTicket($$$$)
gmtime(time() + (3600*6))));
}
my $rspec_string = $rspec->toString();
my $rspec_string = $rspec->toStringC14N();
#
# Load the SA cert to act as caller context.
......
......@@ -197,7 +197,7 @@ sub Create($$$$$$$$$)
push(@insert_data, "slice_uuid='$slice_uuid'");
if (defined($rspec)) {
my $rspec_string = $rspec->toString();
my $rspec_string = $rspec->toStringC14N();
my $safe_rspec = DBQuoteSpecial($rspec_string);
push(@insert_data, "rspec_string=$safe_rspec");
......@@ -301,7 +301,7 @@ sub GetManifest($$)
return $manifest
if (!$asxml);
my $xml = $self->rspec()->toString();
my $xml = $self->rspec()->toStringC14N();
return $xml;
}
......@@ -665,9 +665,9 @@ sub Create($$$$$$)
#
# Add this stuff to the rspec (which becomes the manifest).
#
$rspec->setAttribute("sliver_uuid", $sliver_uuid);
$rspec->setAttribute("hostname", $hostname);
$rspec->setAttribute("sshdport", $sshdport) if (defined($sshdport));
GeniXML::SetText("sliver_uuid", $rspec, $sliver_uuid);
GeniXML::SetText("hostname", $rspec, $hostname);
GeniXML::SetText("sshdport", $rspec, $sshdport) if (defined($sshdport));
return GeniSliver->Create($slice, $user, $sliver_uuid, $resource_uuid,
"Node", $resource_id, $hrn, $nickname, $rspec);
......
......@@ -578,7 +578,7 @@ sub rspecXML($)
return undef
if (!defined($self->rspec()));
return $self->rspec()->toString();
return $self->rspec()->toStringC14N();
}
#
......@@ -710,7 +710,7 @@ sub RunSigner($$)
my $target_cert = $self->target_cert()->cert();
my $owner_cert = $self->owner_cert()->cert();
my $ticket_uuid = $self->{'ticket_uuid'};
my $rspec_xml = $self->rspec()->toString();
my $rspec_xml = $self->rspec()->toStringC14N();
# Convert to GMT.
$expires = POSIX::strftime("20%y-%m-%dT%H:%M:%S",
......@@ -803,7 +803,7 @@ sub Release($$)
my $resource_uuid = GeniXML::GetNodeId($ref);
if (!defined($resource_uuid)) {
print STDERR "No resource id for node in ticket\n";
print Dumper($ref);
print $ref->toStringC14N();
return -1;
}
......@@ -878,7 +878,7 @@ sub ReleaseHolding($$)
my $resource_uuid = GeniXML::GetNodeId($ref);
if (!defined($resource_uuid)) {
print STDERR "No resource id for node in ticket\n";
print Dumper($ref);
print $ref->toStringC14N();
return -1;
}
......
......@@ -68,7 +68,7 @@ sub NewSliver($$$$)
}
}
if (defined($sliver->rspec())) {
my $rspec_string = $sliver->rspec()->toString();
my $rspec_string = $sliver->rspec()->toStringC14N();
my $safe_rspec = DBQuoteSpecial($rspec_string);
push(@insert_data, "rspec_string=$safe_rspec");
......@@ -310,7 +310,7 @@ sub NewManifest($$$)
my @insert_data = ();
my $aggregate_uuid = $aggregate->uuid();
my $manifest_string = $manifest->toString();
my $manifest_string = $manifest->toStringC14N();
my $safe_manifest = DBQuoteSpecial($manifest_string);
# Insert into DB.
......
......@@ -36,7 +36,7 @@ sub Parse($)
$doc = $parser->parse_string($xml);
};
if ($@) {
carp("Failed to parse xml string: $@\n");
carp("Failed to parse xml string: $@\nXML: $xml\n\n");
return undef;
} else {
return $doc->documentElement();
......@@ -52,7 +52,7 @@ sub ParseFile($)
$doc = $parser->parse_file($file);
};
if ($@) {
carp("Failed to parse xml string: $@\n");
carp("Failed to parse xml string: $@");
return undef;
} else {
return $doc->documentElement();
......
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