/[pdpsoft]/nl.nikhef.pdp.fetchcrl/trunk/fetch-crl3.pl.cin
ViewVC logotype

Diff of /nl.nikhef.pdp.fetchcrl/trunk/fetch-crl3.pl.cin

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2305 by davidg, Sun Jun 12 20:59:58 2011 UTC revision 2605 by davidg, Mon Feb 25 15:27:32 2013 UTC
# Line 46  use vars qw/ $log $cnf /; Line 46  use vars qw/ $log $cnf /;
46  #  #
47  ($cnf,$log) = &init_configuration();  ($cnf,$log) = &init_configuration();
48    
49    # use Net::INET6Glue if so requested (is not a default module)
50    if ( $cnf->{_}->{inet6glue} ) {
51      eval { require Net::INET6Glue::INET_is_INET6 or die; };
52      $@ and die "Please install Net::INET6Glue before enabling inet6glue config\n";
53    }
54    
55  # verify local installation sanity for loaded modules  # verify local installation sanity for loaded modules
56  $::log->getverbose > 6 and ! $use_DataDumper and  $::log->getverbose > 6 and ! $use_DataDumper and
57    $::log->err("Cannot set verbosity higher than 6 without Data::Dumper") and    $::log->err("Cannot set verbosity higher than 6 without Data::Dumper") and
# Line 114  sub init_configuration() { Line 120  sub init_configuration() {
120    my $randomwait;    my $randomwait;
121    my $nosymlinks;    my $nosymlinks;
122    my $cfgdir;    my $cfgdir;
123      my $inet6glue=0;
124    
125    $log = FCLog->new("qualified");    $log = FCLog->new("qualified");
126    
# Line 134  sub init_configuration() { Line 141  sub init_configuration() {
141      "nosymlinks+" => \$nosymlinks,      "nosymlinks+" => \$nosymlinks,
142      "a|agingtolerance=i" => \$agingtolerance,      "a|agingtolerance=i" => \$agingtolerance,
143      "r|randomwait=i" => \$randomwait,      "r|randomwait=i" => \$randomwait,
144        "inet6glue+" => \$inet6glue,
145      ) or &help and exit(1);      ) or &help and exit(1);
146    
147    $help and &help and exit(0);    $help and &help and exit(0);
148    
149    $configfile ||= ( -e "/etc/fetch-crl.conf" and "/etc/fetch-crl.conf" );    $configfile ||= ( -e "/etc/fetch-crl.conf" and "/etc/fetch-crl.conf" );
150    $configfile ||= ( -e "/etc/fetch-crl.cnf" and "/etc/fetch-crl.cnf" );    $configfile ||= ( -e "/etc/fetch-crl.cnf" and "/etc/fetch-crl.cnf" );
   ($quiet > 0) and $verbosity = -$quiet;  
151    
152    $cnf = ConfigTiny->new();    $cnf = ConfigTiny->new();
153    $configfile and    $configfile and
# Line 170  sub init_configuration() { Line 177  sub init_configuration() {
177    $cnf->{_}->{parallelism}    = $parallelism if $parallelism;    $cnf->{_}->{parallelism}    = $parallelism if $parallelism;
178    $cnf->{_}->{randomwait}     = $randomwait if defined $randomwait;    $cnf->{_}->{randomwait}     = $randomwait if defined $randomwait;
179    $cnf->{_}->{nosymlinks}     = $nosymlinks if defined $nosymlinks;    $cnf->{_}->{nosymlinks}     = $nosymlinks if defined $nosymlinks;
180      $cnf->{_}->{inet6glue}      = $inet6glue if $inet6glue;
181    
182      # deal with interaction of verbosity in logfile and quiet option
183      # since a noquiet config option can cancel it
184      if ( not defined $cnf->{_}->{noquiet} ) {
185        if ( $quiet == 1) { $cnf->{_}->{verbosity} = -1; }
186      } else {
187        if ( $quiet >= 2) { $cnf->{_}->{verbosity} = -1; }
188      }
189    
190    # key default values    # key default values
191    defined $cnf->{_}->{version}  or $cnf->{_}->{version}    = "3+";    defined $cnf->{_}->{version}  or $cnf->{_}->{version}    = "3+";
# Line 196  sub init_configuration() { Line 212  sub init_configuration() {
212    $cnf->{_}->{nosymlinks}     ||= 0;    $cnf->{_}->{nosymlinks}     ||= 0;
213    $cnf->{_}->{verbosity}      ||= 0;    $cnf->{_}->{verbosity}      ||= 0;
214    $cnf->{_}->{debuglevel}     ||= 0;    $cnf->{_}->{debuglevel}     ||= 0;
215      $cnf->{_}->{inet6glue}      ||= 0;
216    
217    $cnf->{_}->{stateless} and delete $cnf->{_}->{statedir};    $cnf->{_}->{stateless} and delete $cnf->{_}->{statedir};
218    
# Line 289  sub process_metafiles(@) { Line 306  sub process_metafiles(@) {
306        $cnf->{_}->{"infodir"} and $ta->setInfodir($cnf->{_}->{"infodir"});        $cnf->{_}->{"infodir"} and $ta->setInfodir($cnf->{_}->{"infodir"});
307        $ta->loadAnchor($f) or next;        $ta->loadAnchor($f) or next;
308        $ta->saveLogMode() and $ta->setLogMode();        $ta->saveLogMode() and $ta->setLogMode();
       $ta->loadCAfiles() or next;  
309        $ta->loadState() or next;        $ta->loadState() or next;
310        $ta->retrieve or next;  
311          # using the HASH in the CA filename templates requires the CRL
312          # is retrieved first to determinte the hash
313          if ( $cnf->{_}->{"catemplate"} =~ /\@HASH\@/ ) {
314            $ta->retrieve or next;
315            $ta->loadCAfiles() or next;
316          } else {
317            $ta->loadCAfiles() or next;
318            $ta->retrieve or next;
319          }
320    
321        $ta->verifyAndConvertCRLs or next;        $ta->verifyAndConvertCRLs or next;
322            
323        my $writer = CRLWriter->new($ta);        my $writer = CRLWriter->new($ta);

Legend:
Removed from v.2305  
changed lines
  Added in v.2605

grid.support@nikhef.nl
ViewVC Help
Powered by ViewVC 1.1.28