Skip to content

Commit

Permalink
deb_packages to ignore non existent admindirs (#8288)
Browse files Browse the repository at this point in the history
Fixes #8055 and _partly_ fixes #8286.

By "partly" I mean that with this change running `SELECT * FROM deb_packages;` doesn't generate an INFO error log because `/var/lib/dpkg` doesn't exist, #8286 has some other changes necessary to log errors properly.
  • Loading branch information
lucasmrod committed Mar 1, 2024
1 parent fdabe5a commit b9720d9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions osquery/tables/system/linux/deb_packages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include <osquery/core/system.h>
#include <osquery/core/tables.h>
#include <osquery/filesystem/filesystem.h>
#include <osquery/logger/logger.h>
#include <osquery/utils/linux/idpkgquery.h>
#include <osquery/worker/ipc/platform_table_container_ipc.h>
Expand Down Expand Up @@ -64,6 +65,9 @@ QueryData genDebPackagesImpl(QueryContext& context, Logger& logger) {
QueryData results;

for (const auto& admindir : admindir_list) {
if (!pathExists(admindir).ok()) {
continue;
}
auto dpkg_query_exp = IDpkgQuery::create(admindir);
if (dpkg_query_exp.isError()) {
logError(logger,
Expand Down

0 comments on commit b9720d9

Please sign in to comment.