Commit 1ac9f9bb authored by Leigh B Stoller's avatar Leigh B Stoller

Minor fix for expired speaksfor credential; we were failing to terminate

a couple of expired experiments.
parent 7f55b65d
...@@ -80,7 +80,7 @@ sub GenCredentials($$;$$) ...@@ -80,7 +80,7 @@ sub GenCredentials($$;$$)
# #
if (ref($target) eq "GeniSlice" && $target->IsExpired()) { if (ref($target) eq "GeniSlice" && $target->IsExpired()) {
$oldexpires = $target->expires(); $oldexpires = $target->expires();
$target->SetExpiration(time() + 600); $target->SetExpiration(time() + (24 * 3600));
delete($credcache{$cachetag}) delete($credcache{$cachetag})
if (exists($credcache{$cachetag})); if (exists($credcache{$cachetag}));
} }
...@@ -106,7 +106,7 @@ sub GenCredentials($$;$$) ...@@ -106,7 +106,7 @@ sub GenCredentials($$;$$)
goto bad; goto bad;
} }
if ($wantspeaksfor) { if ($wantspeaksfor) {
$speaksfor = GeniCredential->CreateFromSigned($speaksfor_string); $speaksfor = GeniCredential->CreateFromSigned($speaksfor_string, 1);
if (!defined($speaksfor)) { if (!defined($speaksfor)) {
print STDERR "Could not create speaksfor credential\n"; print STDERR "Could not create speaksfor credential\n";
goto bad; goto bad;
...@@ -122,6 +122,9 @@ sub GenCredentials($$;$$) ...@@ -122,6 +122,9 @@ sub GenCredentials($$;$$)
print STDERR "speaksfor credential for $geniuser has expired\n"; print STDERR "speaksfor credential for $geniuser has expired\n";
goto bad goto bad
if (!$allowexpiredspeaksfor); if (!$allowexpiredspeaksfor);
# Be careful not to return this.
$speaksfor = undef;
print STDERR "-> Generating an SA credential instead\n"; print STDERR "-> Generating an SA credential instead\n";
$credential = APT_Geni::GenAuthCredential($target, $privs); $credential = APT_Geni::GenAuthCredential($target, $privs);
......
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