and dpkg-buildpackage is never run; therefore a minor issue.
- Fix false positive when "compiling" python files (Debian bug #714630),
reported by Matthias Klose.
+- Don't check for hardening flags in non-verbose compiler commands spanning
+ multiple lines.
- Sync architecture specific hardening support with dpkg 1.17.1.
my $continuation = 0;
my $complete_line = undef;
+ my $non_verbose;
while (my $line = <$fh>) {
# And stop at the end of the build log. Package details (reported by
# the buildd logs) are not important for us. This also prevents false
last if index($line, 'Build finished at ') == 0
and $line =~ /^Build finished at \d{8}-\d{4}$/;
+ if (not $continuation) {
+ $non_verbose = 0;
+ }
+
# Detect architecture automatically unless overridden.
if (not $arch
and index($line, 'dpkg-buildpackage: host architecture ') == 0) {
}
# Check if this line indicates a non verbose build.
- my $non_verbose = is_non_verbose_build($line);
+ $non_verbose |= is_non_verbose_build($line);
# One line may contain multiple commands (";"). Treat each one as
# single line. parse_line() is slow, only use it when necessary.
[ 83%] Building C object src/CMakeFiles/test-verbose-c.dir/verbose-c.c.o
cd /tmp/test/src && /usr/bin/gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -o CMakeFiles/test-verbose-c.dir/verbose-c.c.o -c -D_FORTIFY_SOURCE=2 /tmp/test/src/test-verbose-c/verbose-c.c
+# Multi-line non-verbose-build.
+Compiling test.c \
+ gcc test.c
+
# False positives.
Compiling Test properties
Compiling Test sources
NONVERBOSE BUILD: [ 82%] Building C object src/CMakeFiles/test/test.c.o
CXXFLAGS missing (-Wformat): cd /tmp/test/src && /usr/bin/c++ -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat-security -Werror=format-security -o CMakeFiles/test-verbose.dir/verbose.cpp.o -c -D_FORTIFY_SOURCE=2 /tmp/test/src/test-verbose/verbose.cpp
CFLAGS missing (-Werror=format-security): cd /tmp/test/src && /usr/bin/gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -o CMakeFiles/test-verbose-c.dir/verbose-c.c.o -c -D_FORTIFY_SOURCE=2 /tmp/test/src/test-verbose-c/verbose-c.c
+NONVERBOSE BUILD: Compiling test.c \ gcc test.c
';