]> ruderich.org/simon Gitweb - blhc/blhc.git/commitdiff
Update Pod documentation.
authorSimon Ruderich <simon@ruderich.org>
Tue, 10 Apr 2012 22:30:01 +0000 (00:30 +0200)
committerSimon Ruderich <simon@ruderich.org>
Tue, 10 Apr 2012 22:30:01 +0000 (00:30 +0200)
bin/blhc

index 88d1346d3a490849816f61af038753fb507859f1..49640dd5eb379c70d1fce2d22c47751582a47be7 100755 (executable)
--- a/bin/blhc
+++ b/bin/blhc
@@ -963,8 +963,12 @@ B<blhc> [I<options>] I<E<lt>dpkg-buildpackage build log fileE<gt>..>
 
 =head1 DESCRIPTION
 
-blhc is a small tool which checks build logs for missing hardening flags and
-other important warnings. It's licensed under the GPL 3 or later.
+blhc is a small tool which checks build logs for missing hardening flags. It's
+licensed under the GPL 3 or later.
+
+It's designed to check build logs generated by Debian's dpkg-buildpackage (or
+tools using dpkg-buildpackage like pbuilder or the official buildd build logs)
+to help maintainers detect missing hardening flags in their packages.
 
 =head1 OPTIONS
 
@@ -994,8 +998,8 @@ changes are in effect:
 
 =item
 
-Print tags instead of normal warnings, see README file for a list of possible
-tags.
+Print tags instead of normal warnings, see L</"BUILDD TAGS"> for a list of
+possible tags.
 
 =item
 
@@ -1047,6 +1051,84 @@ Auto detection for B<--pie> and B<--bindnow> only works if at least one
 command uses the required hardening flag (e.g. -fPIE). Then it's required for
 all other commands as well.
 
+=head1 EXAMPLES
+
+Normal usage, parse a single log file.
+
+    blhc path/to/log/file
+
+Parse multiple log files. The exit code is ORed over all files.
+
+    blhc path/to/directory/with/log/files/*
+
+Don't treat missing C<-g> as error:
+
+    blhc --ignore-flag -g path/to/log/file
+
+Ignore lines consisting exactly of C<./script gcc file> which would cause a
+false positive.
+
+    blhc --ignore-line '\./script gcc file' path/to/log/file
+
+Ignore lines matching C<./script gcc file> somewhere in the line.
+
+    blhc --ignore-line '.*\./script gcc file.*' path/to/log/file
+
+Use blhc with pbuilder.
+
+    pbuilder path/to/package.dsc | tee path/log/file
+    blhc path/to/file || echo flags missing
+
+=head1 BUILDD TAGS
+
+The following tags are used in I<--buildd> mode. In braces the additional data
+which is displayed.
+
+=over 2
+
+=item
+
+B<I-hardening-wrapper-used>
+
+The package uses hardening-wrapper which intercepts calls to gcc and adds
+hardening flags. The build log doesn't contain any hardening flags and thus
+can't be checked by blhc.
+
+=item
+
+B<W-compiler-flags-hidden> (summary of hidden lines)
+
+Build log contains lines which hide the real compiler flags. For example:
+
+    CC test-a.c
+    CC test-b.c
+    CC test-c.c
+    LD test
+
+Most of the time either C<export V=1> or C<export verbose=1> in
+F<debian/rules> fixes builds with hidden compiler flags. Sometimes C<.SILENT>
+in a F<Makefile> must be removed. And as last resort the F<Makefile> must be
+patched to remove the C<@>s hiding the real compiler commands.
+
+=item
+
+B<W-dpkg-buildflags-missing> (summary of missing flags)
+
+CPPFLAGS, CFLAGS, CXXFLAGS, LDFLAGS missing.
+
+=item
+
+B<W-invalid-cmake-used> (version)
+
+=item
+
+B<W-no-compiler-commands>
+
+No compiler commands were detected. Either the log contains none or they were
+not correctly detected by blhc (please report the bug in this case).
+
+=back
+
 =head1 EXIT STATUS
 
 The exit status is a "bit mask", each listed status is ORed when the error
@@ -1084,6 +1166,9 @@ Hardening wrapper detected, no tests performed.
 
 Simon Ruderich, E<lt>simon@ruderich.orgE<gt>
 
+Thanks to to Bernhard R. Link E<lt>brlink@debian.orgE<gt> and Jaria Alto
+E<lt>jari.aalto@cante.netE<gt> for their valuable input and suggestions.
+
 =head1 COPYRIGHT AND LICENSE
 
 Copyright (C) 2012 by Simon Ruderich
@@ -1101,4 +1186,8 @@ GNU General Public License for more details.
 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+=head1 SEE ALSO
+
+L<hardening-check(1)>, L<dpkg-buildflags(1)>
+
 =cut