From bc66cbdac2625fcee5709b76aadf393303fd563c Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: May 13 2020 15:57:06 +0000 Subject: Verbosely fail checksec. --- diff --git a/ruby.spec b/ruby.spec index 4cd8c85..ba0f521 100644 --- a/ruby.spec +++ b/ruby.spec @@ -768,7 +768,11 @@ rm -rf %{buildroot}%{gem_dir}/gems/rake-%{rake_version}/.github %if 0%{?with_hardening_test} # Check Ruby hardening. checksec --file=libruby.so.%{ruby_version} | \ - grep "Full RELRO.*Canary found.*NX enabled.*DSO.*No RPATH.*No RUNPATH.*Yes.*\d*.*\d*.*libruby.so.%{ruby_version}" + grep "Full RELRO.*Canary found.*NX enabled.*DSO.*No RPATH.*No RUNPATH.*Yes.*\d*.*\d*.*libruby.so.%{ruby_version}" || \ + { + checksec --file=libruby.so.%{ruby_version} + exit 1 + } %endif # Check RubyGems version.