From f359b7e8c03884cd9f097d4b3ff8b8b8be8053ba Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 1 Dec 2015 14:09:23 +0100 Subject: require explicit paths to dsc/control as we do for deb files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise a user is subject to unexpected content-injection depending on which directory she happens to start apt in. This also cleans up the code requiring less implementation details in build-dep which is always good. Technically, this is an ABI break as we override virtual methods, but that they weren't overridden was a mistake resulting in pure classes, which shouldn't be pure, so they were unusable – and as they are new in 1.1 nobody is using them yet (and hopefully ever as they are borderline implementation details). Closes: 806693 --- apt-pkg/sourcelist.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'apt-pkg/sourcelist.cc') diff --git a/apt-pkg/sourcelist.cc b/apt-pkg/sourcelist.cc index 1e6b831be..6773b069f 100644 --- a/apt-pkg/sourcelist.cc +++ b/apt-pkg/sourcelist.cc @@ -544,11 +544,17 @@ void pkgSourceList::AddVolatileFile(pkgIndexFile * const File) /*{{{*/ /*}}}*/ bool pkgSourceList::AddVolatileFile(std::string const &File) /*{{{*/ { + // Note: FileExists matches directories and links, too! if (File.empty() || FileExists(File) == false) return false; - if (flExtension(File) == "deb") + std::string const ext = flExtension(File); + if (ext == "deb") AddVolatileFile(new debDebPkgFileIndex(File)); + else if (ext == "dsc") + AddVolatileFile(new debDscFileIndex(File)); + else if (FileExists(flCombine(File, "debian/control"))) + AddVolatileFile(new debDscFileIndex(flCombine(File, "debian/control"))); else return false; -- cgit v1.2.3