t: Add missing tag in Test-For field

Signed-off-by: Niels Thykier <niels@thykier.net>
c/changes-file: Accept "<dist>-backports-sloppy" as valid dist

Signed-off-by: Niels Thykier <niels@thykier.net>
c/md5sums: Skip check if the md5sums file is a symlink

Signed-off-by: Niels Thykier <niels@thykier.net>
c/debconf: Check the sanity of the Binaries field

Do a very strict check of the contents of the Binaries field, before
using any of the "package names" listed in it as partial filenames.

Signed-off-by: Niels Thykier <niels@thykier.net>
c/debconf: Before opening files, check they are not symlinks

Signed-off-by: Niels Thykier <niels@thykier.net>
c/init.d: Guard against possible symlink traversals

Signed-off-by: Niels Thykier <niels@thykier.net>
c/menus: Skip maintscripts that are symlink

Signed-off-by: Niels Thykier <niels@thykier.net>
c/shared-libs: Ignore maintscript that are symlinks

Signed-off-by: Niels Thykier <niels@thykier.net>
L::Util: Add is_ancestor_of function

This function can test if a given path is "contained" within a given
dir (or is the dir itself).

Signed-off-by: Niels Thykier <niels@thykier.net>
coll/changelog-file: Check usr/share/doc/<pkg> is safe

At the same time, stop looking at files in usr/doc/<pkg>.

Signed-off-by: Niels Thykier <niels@thykier.net>
coll/debian-readme: Check that usr/share/doc/<pkg> is safe

At the same time, stop looking at files in usr/doc/<pkg>.

Signed-off-by: Niels Thykier <niels@thykier.net>
coll/*: Fix traversal via symlink in multiple collections

Signed-off-by: Niels Thykier <niels@thykier.net>
checks/*: Check for symlinks before opening files

Signed-off-by: Niels Thykier <niels@thykier.net>
checks/po-debconf: Set INTLTOOL_EXTRACT unconditionally

Signed-off-by: Niels Thykier <niels@thykier.net>
L::Util: Fix bug in resolve_pkg_path

Fix a bug in resolve_pkg_path that caused it to reolve some paths
wrong.

Signed-off-by: Niels Thykier <niels@thykier.net>
L::C::Package: Check filenames for possible traversals

Make _fetch_extracted_dir verify that input filename will not escape
the "root" dir it is serving from.  Particularly, this protects checks
that naively passes filenames to unpacked, debfiles or/and control.

This check only catches poor input filenames; it cannot prevent the
check from reading across an unsafe symlink.

Signed-off-by: Niels Thykier <niels@thykier.net>
c/{cruft,symlinks}: Check for unsafe symlinks

Signed-off-by: Niels Thykier <niels@thykier.net>
L::{Util,Path}: Recommend the use of is_ancestor_of

For testing if a symlink is safe to open, recommend is_ancestor_of
over "link_resolved" (Lintian::Path) and "resolve_pkg_path"
(Lintian::Util).  The latter two generally needs a loop to test that
the link is safe, is_ancestor_of tests it in one go.

Signed-off-by: Niels Thykier <niels@thykier.net>
d/changelog: Add CVE-2013-1429 reference and bump urgency

Signed-off-by: Niels Thykier <niels@thykier.net>
d/changelog: Fix typo of ambiguous

Signed-off-by: Niels Thykier <niels@thykier.net>