From 3317ad864c997f4897756c0a2989c4199e9cda62 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 15 Jul 2017 14:12:50 +0200 Subject: use FileFd to parse all apt configuration files Using different ways of opening files means we have different behaviour and error messages for them, so by the same for all we can have more uniformity for users and apt developers alike. --- apt-pkg/policy.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'apt-pkg/policy.cc') diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc index 008c98ecb..69c1fbe10 100644 --- a/apt-pkg/policy.cc +++ b/apt-pkg/policy.cc @@ -343,8 +343,11 @@ bool ReadPinFile(pkgPolicy &Plcy,string File) if (RealFileExists(File) == false) return true; - - FileFd Fd(File,FileFd::ReadOnly); + + FileFd Fd; + if (OpenConfigurationFileFd(File, Fd) == false) + return false; + pkgTagFile TF(&Fd, pkgTagFile::SUPPORT_COMMENTS); if (Fd.IsOpen() == false || Fd.Failed()) return false; -- cgit v1.2.3