]> git.pld-linux.org Git - packages/fetch-crl.git/blob - no-modify-template.patch
4aacd9623fbe17ac9e8beaf35443d529663912b7
[packages/fetch-crl.git] / no-modify-template.patch
1 with Perl 5.12.3 we changed $self->{"nametemplate_pem"} via $file modification
2
3 with such config:
4 nametemplate_pem = @ALIAS@.r@R@.pem
5 infodir = /etc/pki/esteid
6 cadir = /etc/pki/esteid
7 output = /etc/pki/esteid/crl
8 formats = openssl, pem
9
10 it tried to:
11 VERBOSE(3) Writing PEM file /etc/pki/esteid/crl//etc/pki/esteid/crl/ESTEID-SK_2007.r0.pem
12 should had been:
13 VERBOSE(3) Writing PEM file /etc/pki/esteid/crl/ESTEID-SK_2007.r0.pem
14
15 16:21:09  SamChi> glen: foreach does not copy the value, it assigns each value of the list to the variable
16 16:21:31  SamChi> glen: unless it is not a valid lvalue, then it may have to be copied
17 16:22:12  SamChi> $ perl -le '@a = qw(a b); foreach (@a) { $_ .= "foobar" }; print "@a"'
18 16:22:12  SamChi> afoobar bfoobar
19 16:22:55  SamChi> glen: oh, I was wrong about the second part
20 16:23:03  SamChi> $ perl -le '@a = qw(a b); foreach my $v (@a, "c") { $v .= "foobar" }; print "@a"'
21 16:23:03  SamChi> Modification of a read-only value attempted at -e line 1.
22
23 --- fetch-crl-3.0.6/fetch-crl   2011-03-20 05:01:20.000000000 +0200
24 +++ fetch-crl-3.0.6/fetch-crl   2011-06-11 11:30:58.731040625 +0300
25 @@ -1873,13 +1879,14 @@
26             $::cnf->{_}->{"output_der"}, $::cnf->{_}->{"output_pem"},
27             $::cnf->{_}->{"output_nss"}, $::cnf->{_}->{"output_openssl"}) ) {
28          defined $output and $output or next;
29 -        foreach my $file (
30 +        foreach my $ref (
31                $self->{"nametemplate_der"},
32                $self->{"nametemplate_pem"},
33                $self->{"alias"}.".r\@R\@",
34                $self->{"anchorname"}.".r\@R\@",
35              ) {
36 -          next unless $file;
37 +          next unless $ref;
38 +          my $file = $ref; # copy, not to change original
39            $file =~ s/\@R\@/$i/g;
40            $file = join "/", $output, $file;
41            next if ! -e $file;
This page took 0.062385 seconds and 3 git commands to generate.