# Build log hardening check, checks build logs for missing hardening flags.
-# Copyright (C) 2012-2016 Simon Ruderich
+# Copyright (C) 2012-2017 Simon Ruderich
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
use Getopt::Long ();
use Text::ParseWords ();
-our $VERSION = '0.06';
+our $VERSION = '0.07';
# CONSTANTS/VARIABLES
}
if ($option_version) {
print <<"EOF";
-blhc $VERSION Copyright (C) 2012-2016 Simon Ruderich
+blhc $VERSION Copyright (C) 2012-2017 Simon Ruderich
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
# Option or auto detected.
if ($arch) {
- # The following was partially copied from dpkg-dev 1.18.10
+ # The following was partially copied from dpkg-dev 1.18.15
# (/usr/share/perl5/Dpkg/Vendor/Debian.pm, _add_hardening_flags()),
# copyright Raphaƫl Hertzog <hertzog@debian.org>, Kees Cook
# <kees@debian.org>, Canonical, Ltd. licensed under GPL version 2 or
# later. Keep it in sync.
require Dpkg::Arch;
- my ($abi, $os, $cpu) = Dpkg::Arch::debarch_to_debtriplet($arch);
+ my ($os, $cpu);
+ # Recent dpkg versions use a quadruplet for arch. Support both.
+ eval {
+ (undef, undef, $os, $cpu) = Dpkg::Arch::debarch_to_debtuple($arch);
+ };
+ if ($@) {
+ (undef, $os, $cpu) = Dpkg::Arch::debarch_to_debtriplet($arch);
+ }
# Disable unsupported hardening options.
if ($os !~ /^(?:linux|kfreebsd|knetbsd|hurd)$/
=head1 LICENSE AND COPYRIGHT
-Copyright (C) 2012-2016 by Simon Ruderich
+Copyright (C) 2012-2017 by Simon Ruderich
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by