From 7b41275b9da31d6c87bbaa0c9115e224e47b15e1 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Wed, 13 Dec 2023 17:55:11 +0100 Subject: Do not silently ignore directories for reserved file names Files with reserved extensions like .list, .sources, .conf, and .pref should receive notices in their respective directories even if they are directories. --- apt-pkg/contrib/fileutl.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc index fad51ded1..99b1df3ff 100644 --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@ -486,12 +486,14 @@ std::vector GetListOfFilesInDir(string const &Dir, std::vector c { if (RealFileExists(File) == false) { + string d_ext = flExtension(Ent->d_name); // do not show ignoration warnings for directories - if ( + if (( #ifdef _DIRENT_HAVE_D_TYPE - Ent->d_type == DT_DIR || + Ent->d_type == DT_DIR || #endif - DirectoryExists(File) == true) + DirectoryExists(File) == true) && + (d_ext.empty() || std::find(Ext.begin(), Ext.end(), d_ext) == Ext.end())) continue; if (SilentIgnore.Match(Ent->d_name) == false) _error->Notice(_("Ignoring '%s' in directory '%s' as it is not a regular file"), Ent->d_name, Dir.c_str()); -- cgit v1.2.3-70-g09d2