Commit cbe641a1 authored by Leigh Stoller's avatar Leigh Stoller

Add option to get the sig file for an image instead of the ndz file.

parent c959bc9d
#!/usr/bin/perl -wT
#
# Copyright (c) 2000-2013 University of Utah and the Flux Group.
# Copyright (c) 2000-2015 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -38,9 +38,10 @@ sub usage()
"Spew an image file to a (widearea) node.\n";
exit(-1);
}
my $optlist = "t:k:h";
my $optlist = "t:k:hs";
my $debug = 0;
my $headonly = 0;
my $sigfile = 0;
my $access_key;
my $timestamp; # GM Time.
......@@ -98,6 +99,9 @@ if (! getopts($optlist, \%options)) {
if (defined($options{"h"})) {
$headonly = 1;
}
if (defined($options{"s"})) {
$sigfile = 1;
}
if (defined($options{"k"})) {
$access_key = $options{"k"};
......@@ -141,7 +145,8 @@ exit(0);
sub SpewImage()
{
my $file = $image->path();
$file .= ".sig" if ($sigfile);
open(FD, "< $file")
or fatal("Could not open $file!\n");
......@@ -205,6 +210,8 @@ sub VerifyImage()
# have provided proper access key.
#
my $file = $image->path();
$file .= ".sig" if ($sigfile);
if (! -r $file) {
if ($debug) {
print STDERR "Cannot read $file\n";
......
<?php
#
# Copyright (c) 2003-2014 University of Utah and the Flux Group.
# Copyright (c) 2003-2015 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -53,7 +53,8 @@ if (!isset($_SERVER["SSL_PROTOCOL"])) {
#
$reqargs = RequiredPageArguments("image", PAGEARG_IMAGE,
"access_key", PAGEARG_STRING);
$optargs = OptionalPageArguments("stamp", PAGEARG_INTEGER);
$optargs = OptionalPageArguments("stamp", PAGEARG_INTEGER,
"sigfile", PAGEARG_BOOLEAN);
#
# A cleanup function to keep the child from becoming a zombie, since
......@@ -80,7 +81,9 @@ register_shutdown_function("SPEWCLEANUP");
$imageid = $image->imageid();
$versid = $image->versid();
$access_key = escapeshellarg($access_key);
$arg = (isset($stamp) ? "-t " . escapeshellarg($stamp) : "");
$arg = "";
$arg .= (isset($stamp) ? "-t " . escapeshellarg($stamp) : "");
$arg .= (isset($sigfile) && $sigfile ? "-s " : "");
$group = $image->Group();
$pid = $group->pid();
$unix_gid = $group->unix_gid();
......
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