diff --git a/protogeni/scripts/addauthority.in b/protogeni/scripts/addauthority.in index 6e9703b458539154ba805439795de238a55eeb9d..521fd65468665cdde40c0d2668188cc132a99e56 100644 --- a/protogeni/scripts/addauthority.in +++ b/protogeni/scripts/addauthority.in @@ -1,7 +1,7 @@ #!/usr/bin/perl -w # # GENIPUBLIC-COPYRIGHT -# Copyright (c) 2008-2010 University of Utah and the Flux Group. +# Copyright (c) 2008-2011 University of Utah and the Flux Group. # All rights reserved. # use strict; @@ -18,10 +18,11 @@ sub usage() print "Usage: addauthority [-c] [-a] [-n] [url]\n"; exit(1); } -my $optlist = "acn"; +my $optlist = "acnf"; my $asch = 0; my $asam = 0; my $disable = 0; +my $force = 0; # # Check args. @@ -39,6 +40,9 @@ if (defined($options{"c"})) { if (defined($options{"a"})) { $asam = 1; } +if (defined($options{"f"})) { + $force = 1; +} usage() if (@ARGV < 2 || @ARGV > 3); @@ -73,7 +77,7 @@ if (!defined($url)) { die("Certificate does not have a URI extension"); } } -if (GeniAuthority->CheckExisting($certificate)) { +if (!$force && GeniAuthority->CheckExisting($certificate)) { die("$certfile is already registered in the DB\n"); } my $authority = GeniAuthority->Create($certificate, $url, lc($type)); diff --git a/protogeni/scripts/fixcerts.in b/protogeni/scripts/fixcerts.in index 0a265079d1f1255cce6b6fcbe12f2976f3518fc5..a9445104af3773af9d23b3569939b27d4dc7ce94 100644 --- a/protogeni/scripts/fixcerts.in +++ b/protogeni/scripts/fixcerts.in @@ -97,7 +97,7 @@ if ($asch) { system("$UPDATECERT $CHCERT") == 0 or fatal("Could not update $CHCERT"); - system("$ADDAUTHORITY -c $CHCERT ma") == 0 + system("$ADDAUTHORITY -f -c $CHCERT ma") == 0 or fatal("Could not add CH certificate to CH DB"); }