Commit ebd4759e authored by Leigh Stoller's avatar Leigh Stoller

Remove hardwired number of days for extension credential, compute it

instead.
parent 9025021d
......@@ -27,6 +27,7 @@ use strict;
use Carp;
use English;
use Data::Dumper;
use Date::Parse;
use POSIX qw(tmpnam);
use Exporter;
use vars qw(@ISA @EXPORT $AUTOLOAD
......@@ -1696,7 +1697,12 @@ sub Extend($$$)
$certfile = $certificate->WriteToFile();
$userarg = "-c $certfile";
}
system("$GENEXTENDCRED -a -o $credname -s $slice_urn -t 180 $userarg");
#
# How many days do we need in the credential.
#
my $days = ((str2time($new_expires) - time()) / (24 * 3600)) + 1;
system("$GENEXTENDCRED ".
" -a -o $credname -s $slice_urn -t $days $userarg");
if ($?) {
print STDERR "Could not create extended credential\n";
return undef;
......
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