/[pdpsoft]/nl.nikhef.pdp.fetchcrl/trunk/CRLWriter.pm
ViewVC logotype

Diff of /nl.nikhef.pdp.fetchcrl/trunk/CRLWriter.pm

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

revision 2672 by davidg, Tue Sep 17 09:44:40 2013 UTC revision 3170 by davidg, Mon Mar 20 15:08:49 2017 UTC
# Line 123  sub updatefile($$%) { Line 123  sub updatefile($$%) {
123    };    };
124    
125    if ( open FH,'>',$file ) {    if ( open FH,'>',$file ) {
     if ($content !~ /\n$/sm) {  
       $content="$content\n";  
     }  
126      print FH $content or      print FH $content or
127        $::log->err("Write to $file: $!") and return undef;        $::log->err("Write to $file: $!") and return undef;
128      close FH or      close FH or
# Line 162  sub writePEM($$$$) { Line 159  sub writePEM($$$$) {
159    my %flags = ();    my %flags = ();
160    $::cnf->{_}->{"backups"} and $flags{"BACKUP"} = 1;    $::cnf->{_}->{"backups"} and $flags{"BACKUP"} = 1;
161    
162      if ($data !~ /\n$/sm) {
163        $::log->verb(5,"Appending newline to short PEM file",$filename);
164        $data="$data\n";
165      }
166    
167    $::log->verb(3,"Writing PEM file",$filename);    $::log->verb(3,"Writing PEM file",$filename);
168    &updatefile($filename,$data,%flags) or return 0;    &updatefile($filename,$data,%flags) or return 0;
169    return 1;    return 1;

Legend:
Removed from v.2672  
changed lines
  Added in v.3170

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