]> ruderich.org/simon Gitweb - blhc/blhc.git/blob - bin/blhc
Fix --arch, missing '=s' in GetOptions().
[blhc/blhc.git] / bin / blhc
1 #!/usr/bin/perl
2
3 # Build log hardening check, checks build logs for missing hardening flags.
4
5 # Copyright (C) 2012  Simon Ruderich
6 #
7 # This program is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
11 #
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 # GNU General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
20
21 use strict;
22 use warnings;
23
24 use Getopt::Long ();
25 use Term::ANSIColor ();
26 use Text::ParseWords ();
27
28 our $VERSION = '0.01';
29
30
31 # CONSTANTS/VARIABLES
32
33 # Regex to catch compiler commands.
34 my $cc_regex = qr/(?:[a-z0-9_]+-(?:linux-|kfreebsd-)?gnu(?:eabi|eabihf)?-)?
35                   (?<!\.)(?:cc|gcc|g\+\+|c\+\+)
36                   (?:-[\d.]+)?/x;
37 # Regex to catch (GCC) compiler warnings.
38 my $warning_regex = qr/^(.+?):([0-9]+):[0-9]+: warning: (.+?) \[(.+?)\]$/;
39
40 # Regex for source files which require preprocessing.
41 my $source_preprocess_compile_regex = qr/
42     # C
43       c
44     # Objective-C
45     | m
46     # C++
47     | cc | cp | cxx | cpp | CPP | c\+\+ | C
48     # Objective-C++
49     | mm | M
50     # Fortran
51     | F | FOR | fpp | FPP | FTN | F90 | F95 | F03 | F08
52     /x;
53 my $source_preprocess_no_compile_regex = qr/
54     # Assembly
55       s
56     /x;
57 my $source_preprocess_regex = qr/
58       $source_preprocess_compile_regex
59     | $source_preprocess_no_compile_regex
60     /x;
61 # Regex for source files which don't require preprocessing.
62 my $source_no_preprocess_compile_regex = qr/
63     # C
64       i
65     # C++
66     | ii
67     # Objective-C
68     | mi
69     # Objective-C++
70     | mii
71     # Fortran
72     | f | for | ftn | f90 | f95 | f03 | f08
73     /x;
74 my $source_no_preprocess_no_compile_regex = qr/
75     # Assembly
76       S | sx
77     /x;
78 my $source_no_preprocess_regex = qr/
79       $source_no_preprocess_compile_regex
80     | $source_no_preprocess_no_compile_regex
81     /x;
82 # Regex for header files which require preprocessing.
83 my $header_preprocess_regex = qr/
84     # C, C++, Objective-C, Objective-C++
85       h
86     # C++
87     | hh | H | hp | hxx | hpp | HPP | h\+\+ | tcc
88     /x;
89 # Regexps to match files with the given characteristics.
90 my $file_no_preprocess_regex = qr/
91     $cc_regex.+?
92     \.(?: $source_no_preprocess_regex)\b
93     /x;
94 my $file_preprocess_regex = qr/
95     $cc_regex.+?
96     \.(?: $header_preprocess_regex
97         | $source_preprocess_regex)\b
98     /x;
99 my $file_compile_link_regex = qr/
100     $cc_regex.+?
101     \.(?: $source_preprocess_regex
102         | $source_no_preprocess_regex)\b
103     /x;
104 my $file_compile_regex = qr/
105     $cc_regex.+?
106     \.(?: $source_preprocess_compile_regex
107         | $source_no_preprocess_compile_regex)\b
108     /x;
109 my $file_no_compile_regex = qr/
110     $cc_regex.+
111     \.(?: $source_preprocess_no_compile_regex
112         | $source_no_preprocess_no_compile_regex)\b
113     /x;
114
115 # Expected (hardening) flags. All flags are used as regexps.
116 my @cflags = (
117     '-g',
118     '-O(?:2|3)',
119 );
120 my @cflags_format = (
121     '-Wformat',
122     '-Wformat-security',
123     '-Werror=format-security',
124 );
125 my @cflags_fortify = (
126     # fortify needs at least -O1, but -O2 is recommended anyway
127 );
128 my @cflags_stack = (
129     '-fstack-protector',
130     '--param=ssp-buffer-size=4',
131 );
132 my @cflags_pie = (
133     '-fPIE',
134 );
135 my @cppflags = ();
136 my @cppflags_fortify = (
137     '-D_FORTIFY_SOURCE=2',
138 );
139 my @ldflags = ();
140 my @ldflags_relro = (
141     '-Wl,(-z,)?relro',
142 );
143 my @ldflags_bindnow = (
144     '-Wl,(-z,)?now',
145 );
146 my @ldflags_pie = (
147     '-fPIE',
148     '-pie',
149 );
150 # Renaming rules for the output so the regex parts are not visible.
151 my %flag_renames = (
152     '-O(?:2|3)'       => '-O2',
153     '-Wl,(-z,)?relro' => '-Wl,-z,relro',
154     '-Wl,(-z,)?now'   => '-Wl,-z,now',
155 );
156
157 # Use colored (ANSI) output?
158 my $option_color;
159
160
161 # FUNCTIONS
162
163 sub error_flags {
164     my ($message, $missing_flags_ref, $flag_renames_ref, $line) = @_;
165
166     # Rename flags if requested.
167     my @missing_flags = map {
168         (exists $flag_renames_ref->{$_})
169             ? $flag_renames_ref->{$_}
170             : $_
171     } @{$missing_flags_ref};
172
173     my $flags = join ' ', @missing_flags;
174     printf "%s (%s)%s %s",
175            error_color($message, 'red'), $flags, error_color(':', 'yellow'),
176            $line;
177 }
178 sub error_non_verbose_build {
179     my ($line) = @_;
180
181     printf "%s%s %s",
182            error_color('NONVERBOSE BUILD', 'red'),
183            error_color(':', 'yellow'),
184            $line;
185 }
186 sub error_hardening_wrapper {
187     printf "%s%s %s\n",
188             error_color('HARDENING WRAPPER', 'red'),
189             error_color(':', 'yellow'),
190             'no checks possible, aborting';
191 }
192 sub error_color {
193     my ($message, $color) = @_;
194
195     if ($option_color) {
196         return Term::ANSIColor::colored($message, $color);
197     } else {
198         return $message;
199     }
200 }
201
202 sub any_flags_used {
203     my ($line, @flags) = @_;
204
205     foreach my $flag (@flags) {
206         return 1 if $line =~ /\s$flag(?:\s|\\)/;
207     }
208
209     return 0;
210 }
211 sub all_flags_used {
212     my ($line, $missing_flags_ref, @flags) = @_;
213
214     my @missing_flags = ();
215     foreach my $flag (@flags) {
216         if ($line !~ /\s$flag(?:\s|\\)/) {
217             push @missing_flags, $flag;
218         }
219     }
220
221     return 1 if scalar @missing_flags == 0;
222
223     @{$missing_flags_ref} = @missing_flags;
224     return 0;
225 }
226
227 # Modifies $missing_flags_ref array.
228 sub pic_pie_conflict {
229     my ($line, $pie, $missing_flags_ref, @flags_pie) = @_;
230
231     return 0 if not $pie;
232     return 0 if not any_flags_used($line, ('-fPIC', '-fpic'));
233
234     my %flags = map { $_ => 1 } @flags_pie;
235
236     # Remove all PIE flags from @missing_flags as they are not required with
237     # -fPIC.
238     my @result = grep {
239         not exists $flags{$_}
240     } @{$missing_flags_ref};
241     @{$missing_flags_ref} = @result;
242
243     # We got a conflict when no flags are left, thus only PIE flags were
244     # missing. If other flags were missing abort because the conflict is not
245     # the problem.
246     return scalar @result == 0;
247 }
248
249 sub is_non_verbose_build {
250     my ($line, $next_line, $skip_ref) = @_;
251
252     if (not ($line =~ /^checking if you want to see long compiling messages\.\.\. no/
253                 or $line =~ /^\s*\[?(?:CC|CCLD|CXX|CXXLD|LD|LINK)\]?\s+(.+?)$/
254                 or $line =~ /^\s*(?:C|c)ompiling\s+(.+?)(?:\.\.\.)?$/
255                 or $line =~ /^\s*(?:B|b)uilding (?:program|shared library)\s+(.+?)$/
256                 or $line =~ /^\s*\[[\d ]+%\] Building (?:C|CXX) object (.+?)$/)) {
257         return 0;
258     }
259
260     my $file = $1;
261
262     # On the first pass we only check if this line is verbose or not.
263     return 1 if not defined $next_line;
264
265     # Second pass, we have access to the next line.
266     ${$skip_ref} = 0;
267
268     # CMake and other build systems print the non-verbose messages also when
269     # building verbose. If a compiler and the file name occurs in the next
270     # line, treat it as verbose build.
271     if (defined $file) {
272         # Get filename, we can't use the complete path as only parts of it are
273         # used in the real compiler command.
274         $file =~ m{/([a-zA-Z0-9._-]+)$};
275         $file = $1;
276
277         if ($next_line =~ /\Q$file\E/ and $next_line =~ /$cc_regex/) {
278             # We still have to skip the current line as it doesn't contain any
279             # compiler commands.
280             ${$skip_ref} = 1;
281             return 0;
282         }
283     }
284
285     return 1;
286 }
287
288
289 # MAIN
290
291 # Hardening options. Not all architectures support all hardening options.
292 my $harden_format  = 1;
293 my $harden_fortify = 1;
294 my $harden_stack   = 1;
295 my $harden_relro   = 1;
296 my $harden_bindnow = 0;
297 my $harden_pie     = 0;
298
299 # Parse command line arguments.
300 my $option_help    = 0;
301 my $option_version = 0;
302 my $option_all     = 0;
303 my $option_arch    = undef;
304 my $option_buildd  = 0;
305    $option_color   = 0;
306 if (not Getopt::Long::GetOptions(
307             'help|h|?' => \$option_help,
308             'version'  => \$option_version,
309             # Hardening options.
310             'pie'      => \$harden_pie,
311             'bindnow'  => \$harden_bindnow,
312             'all'      => \$option_all,
313             # Misc.
314             'color'    => \$option_color,
315             'arch=s'   => \$option_arch,
316             'buildd'   => \$option_buildd,
317         )) {
318     require Pod::Usage;
319     Pod::Usage::pod2usage(2);
320 }
321 if ($option_help) {
322     require Pod::Usage;
323     Pod::Usage::pod2usage(1);
324 }
325 if ($option_version) {
326     print "blhc $VERSION  Copyright (C) 2012  Simon Ruderich
327
328 This program is free software: you can redistribute it and/or modify
329 it under the terms of the GNU General Public License as published by
330 the Free Software Foundation, either version 3 of the License, or
331 (at your option) any later version.
332
333 This program is distributed in the hope that it will be useful,
334 but WITHOUT ANY WARRANTY; without even the implied warranty of
335 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
336 GNU General Public License for more details.
337
338 You should have received a copy of the GNU General Public License
339 along with this program.  If not, see <http://www.gnu.org/licenses/>.
340 ";
341     exit 0;
342 }
343
344 if ($option_all) {
345     $harden_pie     = 1;
346     $harden_bindnow = 1;
347 }
348
349 # Final exit code.
350 my $exit = 0;
351
352 # Input lines, contain only the lines with compiler commands.
353 my @input = ();
354
355 my $start = 0;
356 my $continuation = 0;
357 my $complete_line = undef;
358 while (my $line = <>) {
359     # dpkg-buildflags only provides hardening flags since 1.16.1, don't check
360     # for hardening flags in buildd mode if an older dpkg-dev is used. Default
361     # flags (-g -O2) are still checked.
362     #
363     # Packages which were built before 1.16.1 but used their own hardening
364     # flags are not checked.
365     if ($option_buildd and not $start
366             and $line =~ /^Toolchain package versions: /) {
367         require Dpkg::Version;
368         if ($line !~ /dpkg-dev_(\S+)/
369                 or Dpkg::Version::version_compare($1, '1.16.1') < 0) {
370             $harden_format  = 0;
371             $harden_fortify = 0;
372             $harden_stack   = 0;
373             $harden_relro   = 0;
374             $harden_bindnow = 0;
375             $harden_pie     = 0;
376         }
377     }
378
379     # If hardening wrapper is used (wraps calls to gcc and adds hardening
380     # flags automatically) we can't perform any checks, abort.
381     if (not $start and $line =~ /^Build-Depends: .*\bhardening-wrapper\b/) {
382         error_hardening_wrapper();
383         $exit |= 1 << 4;
384         exit $exit;
385     }
386
387     # We skip over unimportant lines at the beginning of the log to prevent
388     # false positives.
389     $start = 1 if $line =~ /^dpkg-buildpackage:/;
390     next if not $start;
391     # And stop at the end of the build log. Package details (reported by the
392     # buildd logs) are not important for us. This also prevents false
393     # positives.
394     last if $line =~ /^Build finished at \d{8}-\d{4}$/;
395
396     # Detect architecture automatically unless overridden.
397     if (not $option_arch
398             and $line =~ /^dpkg-buildpackage: host architecture (.+)$/) {
399         $option_arch = $1;
400     }
401
402     # Ignore compiler warnings for now.
403     next if $line =~ /$warning_regex/;
404
405     # Remove all ANSI color sequences which are sometimes used in non-verbose
406     # builds.
407     $line = Term::ANSIColor::colorstrip($line);
408     # Also strip '\0xf' (delete previous character), used by Elinks' build
409     # system.
410     $line =~ s/\x0f//g;
411     # And "ESC(B" which seems to be used on armhf and hurd (not sure what it
412     # does).
413     $line =~ s/\033\(B//g;
414
415     # Check if this line indicates a non verbose build.
416     my $non_verbose = is_non_verbose_build($line);
417
418     # One line may contain multiple commands (";"). Treat each one as single
419     # line. parse_line() is slow, only use it when necessary.
420     my @line = (not $line =~ /;/)
421              ? ($line)
422              : Text::ParseWords::parse_line(';', 1, $line);
423     foreach $line (@line) {
424         # Add newline, drop all other whitespace at the end of a line.
425         $line =~ s/\s+$//;
426         $line .= "\n";
427
428         if ($continuation) {
429             $continuation = 0;
430
431             # Join lines, but leave the "\" in place so it's clear where the
432             # original line break was.
433             chomp $complete_line;
434             $complete_line .= ' ' . $line;
435         }
436         # Line continuation, line ends with "\".
437         if ($line =~ /\\\s*$/) {
438             $continuation = 1;
439             # Start line continuation.
440             if (not defined $complete_line) {
441                 $complete_line = $line;
442             }
443             next;
444         }
445
446         if (not $continuation) {
447             # Use the complete line if a line continuation occurred.
448             if (defined $complete_line) {
449                 $line = $complete_line;
450                 $complete_line = undef;
451             }
452
453             # Ignore lines with no compiler commands.
454             next if $line !~ /\b$cc_regex(?:\s|\\)/ and not $non_verbose;
455
456             # Ignore false positives.
457             #
458             # `./configure` output.
459             next if not $non_verbose
460                     and $line =~ /^(?:checking|(?:C|c)onfigure:) /;
461             next if $line =~ /^\s*(?:Host\s+)?(?:C\s+)?
462                                (?:C|c)ompiler[\s.]*:?\s+
463                                $cc_regex
464                                (?:\s-std=[a-z0-9:+]+)?\s*$
465                              /x
466                     or $line =~ /^\s*(?:- )?(?:HOST_)?(?:CC|CXX)\s*=\s*$cc_regex\s*$/
467                     or $line =~ /^\s*-- Check for working (?:C|CXX) compiler: /
468                     or $line =~ /^\s*(?:echo )?Using [A-Z_]+\s*=\s*/;
469             # `make` output.
470             next if $line =~ /^Making [a-z]+ in \S+/; # e.g. "[...] in c++"
471
472             # Check if additional hardening options were used. Used to ensure
473             # they are used for the complete build.
474             $harden_pie     = 1 if any_flags_used($line, @cflags_pie, @ldflags_pie);
475             $harden_bindnow = 1 if any_flags_used($line, @ldflags_bindnow);
476
477             push @input, $line;
478         }
479     }
480 }
481
482 if (scalar @input == 0) {
483     print "No compiler commands!\n";
484     $exit |= 1;
485     exit $exit;
486 }
487
488 # Option or auto detected.
489 if ($option_arch) {
490     # The following was partially copied from dpkg-dev 1.16.1.2
491     # (/usr/share/perl5/Dpkg/Vendor/Debian.pm, add_hardening_flags()),
492     # copyright RaphaĆ«l Hertzog <hertzog@debian.org>, Kees Cook
493     # <kees@debian.org>, Canonical, Ltd. licensed under GPL version 2 or
494     # later. Keep it in sync.
495
496     require Dpkg::Arch;
497     my ($abi, $os, $cpu) = Dpkg::Arch::debarch_to_debtriplet($option_arch);
498
499     # Disable unsupported hardening options.
500     if ($cpu =~ /^(ia64|alpha|mips|mipsel|hppa)$/ or $option_arch eq 'arm') {
501         $harden_stack = 0;
502     }
503     if ($cpu =~ /^(ia64|hppa|avr32)$/) {
504         $harden_relro   = 0;
505         $harden_bindnow = 0;
506     }
507 }
508
509 # Check the specified hardening options, same order as dpkg-buildflags.
510 if ($harden_pie) {
511     @cflags  = (@cflags,  @cflags_pie);
512     @ldflags = (@ldflags, @ldflags_pie);
513 }
514 if ($harden_stack) {
515     @cflags = (@cflags, @cflags_stack);
516 }
517 if ($harden_fortify) {
518     @cflags   = (@cflags,   @cflags_fortify);
519     @cppflags = (@cppflags, @cppflags_fortify);
520 }
521 if ($harden_format) {
522     @cflags = (@cflags, @cflags_format);
523 }
524 if ($harden_relro) {
525     @ldflags = (@ldflags, @ldflags_relro);
526 }
527 if ($harden_bindnow) {
528     @ldflags = (@ldflags, @ldflags_bindnow);
529 }
530
531 for (my $i = 0; $i < scalar @input; $i++) {
532     my $line = $input[$i];
533
534     my $skip = 0;
535     if (is_non_verbose_build($line, $input[$i + 1], \$skip)) {
536         error_non_verbose_build($line);
537         $exit |= 1 << 2;
538         next;
539     }
540     # Even if it's a verbose build, we might have to skip this line.
541     next if $skip;
542
543     # Skip unnecessary tests when only preprocessing.
544     my $flag_preprocess = 0;
545
546     my $preprocess = 0;
547     my $compile    = 0;
548     my $link       = 0;
549
550     # Preprocess, compile, assemble.
551     if ($line =~ /$cc_regex.*?\s(-E|-S|-c)\b/) {
552         $preprocess      = 1;
553         $flag_preprocess = 1 if $1 eq '-E';
554         $compile         = 1 if $1 eq '-S' or $1 eq '-c';
555     # Otherwise assume we are linking.
556     } else {
557         $link = 1;
558     }
559
560     # These file types don't require preprocessing.
561     if ($line =~ /$file_no_preprocess_regex/) {
562         $preprocess = 0;
563     }
564     # These file types require preprocessing.
565     if ($line =~ /$file_preprocess_regex/) {
566         $preprocess = 1;
567     }
568
569     # If there are source files then it's compiling/linking in one step and we
570     # must check both. We only check for source files here, because header
571     # files cause too many false positives.
572     if (not $flag_preprocess and $line =~ /$file_compile_link_regex/) {
573         # Assembly files don't need CFLAGS.
574         if (not $line =~ /$file_compile_regex/
575                 and $line =~ /$file_no_compile_regex/) {
576             $compile = 0;
577         # But the rest does.
578         } else {
579             $compile = 1;
580         }
581     }
582
583     # Check hardening flags.
584     my @missing;
585     if ($compile and not all_flags_used($line, \@missing, @cflags)
586             # Libraries linked with -fPIC don't have to (and can't) be linked
587             # with -fPIE as well. It's no error if only PIE flags are missing.
588             and not pic_pie_conflict($line, $harden_pie, \@missing, @cflags_pie)
589             # Assume dpkg-buildflags returns the correct flags.
590             and not $line =~ /`dpkg-buildflags --get (?:CFLAGS|CXXFLAGS)`/) {
591         error_flags('CFLAGS missing', \@missing, \%flag_renames, $line);
592         $exit |= 1 << 3;
593     }
594     if ($preprocess and not all_flags_used($line, \@missing, @cppflags)
595             # Assume dpkg-buildflags returns the correct flags.
596             and not $line =~ /`dpkg-buildflags --get CPPFLAGS`/) {
597         error_flags('CPPFLAGS missing', \@missing, \%flag_renames, $line);
598         $exit |= 1 << 3;
599     }
600     if ($link and not all_flags_used($line, \@missing, @ldflags)
601             # Same here, -fPIC conflicts with -fPIE.
602             and not pic_pie_conflict($line, $harden_pie, \@missing, @ldflags_pie)
603             # Assume dpkg-buildflags returns the correct flags.
604             and not $line =~ /`dpkg-buildflags --get LDFLAGS`/) {
605         error_flags('LDFLAGS missing', \@missing, \%flag_renames, $line);
606         $exit |= 1 << 3;
607     }
608 }
609
610 exit $exit;
611
612
613 __END__
614
615 =head1 NAME
616
617 blhc - build log hardening check, checks build logs for missing hardening flags
618
619 =head1 SYNOPSIS
620
621 B<blhc> [options] <dpkg-buildpackage build log file>
622
623     --all                   force +all (+pie, +bindnow) check
624     --arch                  set architecture (autodetected)
625     --bindnow               force +bindbow check
626     --buildd                parser mode for buildds
627     --color                 use colored output
628     --pie                   force +pie check
629     --help                  available options
630     --version               version number and license
631
632 =head1 DESCRIPTION
633
634 blhc is a small tool which checks build logs for missing hardening flags and
635 other important warnings. It's licensed under the GPL 3 or later.
636
637 =head1 OPTIONS
638
639 =over 8
640
641 =item B<--all>
642
643 Force check for all +all (+pie, +bindnow) hardening flags. By default it's
644 auto detected.
645
646 =item B<--arch>
647
648 Set the specific architecture (e.g. amd64, armel, etc.), automatically
649 disables hardening flags not available on this architecture. Is detected
650 automatically if dpkg-buildpackage is used.
651
652 =item B<--bindnow>
653
654 Force check for all +bindnow hardening flags. By default it's auto detected.
655
656 =item B<--buildd>
657
658 Special mode for buildds when automatically parsing log files. The following
659 changes are in effect:
660
661 =over 2
662
663 =item
664
665 Don't check hardening flags in old log files (if dpkg-dev << 1.16.1 is
666 detected).
667
668 =back
669
670 =item B<--color>
671
672 Use colored (ANSI) output for warning messages.
673
674 =item B<--pie>
675
676 Force check for all +pie hardening flags. By default it's auto detected.
677
678 =item B<-h -? --help>
679
680 Print available options.
681
682 =item B<--version>
683
684 Print version number and license.
685
686 =back
687
688 Auto detection for B<--pie> and B<--bindnow> only works if at least one
689 command uses the required hardening flag (e.g. -fPIE). Then it's required for
690 all other commands as well.
691
692 =head1 EXIT STATUS
693
694 The exit status is a "bit mask", each listed status is ORed when the error
695 condition occurs to get the result.
696
697 =over 4
698
699 =item B<0>
700
701 Success.
702
703 =item B<1>
704
705 No compiler commands were found.
706
707 =item B<2>
708
709 Invalid arguments/options given to blhc.
710
711 =item B<4>
712
713 Non verbose build.
714
715 =item B<8>
716
717 Missing hardening flags.
718
719 =item B<16>
720
721 Hardening wrapper detected, no tests performed.
722
723 =back
724
725 =head1 AUTHOR
726
727 Simon Ruderich, E<lt>simon@ruderich.orgE<gt>
728
729 =head1 COPYRIGHT AND LICENSE
730
731 Copyright (C) 2012 by Simon Ruderich
732
733 This program is free software: you can redistribute it and/or modify
734 it under the terms of the GNU General Public License as published by
735 the Free Software Foundation, either version 3 of the License, or
736 (at your option) any later version.
737
738 This program is distributed in the hope that it will be useful,
739 but WITHOUT ANY WARRANTY; without even the implied warranty of
740 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
741 GNU General Public License for more details.
742
743 You should have received a copy of the GNU General Public License
744 along with this program.  If not, see <http://www.gnu.org/licenses/>.
745
746 =cut