From 560bfcdc021110172822bc1d9c6495b01cc3ff5d Mon Sep 17 00:00:00 2001 From: Mitchell Grenier Date: Tue, 31 Mar 2015 15:01:50 -0700 Subject: [PATCH] Adding the ability to get addons in Ubuntu I added a couple preprocessor macros so the table can be used under all linux distros as well --- osquery/tables/CMakeLists.txt | 2 +- .../tables/applications/{darwin => x}/browser_firefox.cpp | 7 ++++++- osquery/tables/specs/{darwin => x}/firefox_addons.table | 0 3 files changed, 7 insertions(+), 2 deletions(-) rename osquery/tables/applications/{darwin => x}/browser_firefox.cpp (96%) rename osquery/tables/specs/{darwin => x}/firefox_addons.table (100%) diff --git a/osquery/tables/CMakeLists.txt b/osquery/tables/CMakeLists.txt index bab0696c..84a580d2 100644 --- a/osquery/tables/CMakeLists.txt +++ b/osquery/tables/CMakeLists.txt @@ -7,7 +7,6 @@ if(APPLE) ADD_OSQUERY_LIBRARY(FALSE osquery_tables_darwin applications/darwin/browser_chrome.cpp - applications/darwin/browser_firefox.cpp applications/darwin/browser_safari.cpp events/darwin/passwd_changes.cpp events/darwin/file_changes.cpp @@ -109,6 +108,7 @@ else() endif() ADD_OSQUERY_LIBRARY(FALSE osquery_tables + applications/x/browser_firefox.cpp networking/etc_hosts.cpp networking/etc_services.cpp networking/interfaces.cpp diff --git a/osquery/tables/applications/darwin/browser_firefox.cpp b/osquery/tables/applications/x/browser_firefox.cpp similarity index 96% rename from osquery/tables/applications/darwin/browser_firefox.cpp rename to osquery/tables/applications/x/browser_firefox.cpp index 9fb67500..4a4da3a8 100644 --- a/osquery/tables/applications/darwin/browser_firefox.cpp +++ b/osquery/tables/applications/x/browser_firefox.cpp @@ -21,7 +21,12 @@ namespace osquery { namespace tables { /// Each home directory will include custom extensions. -#define kFirefoxPath "/Library/Application Support/Firefox/Profiles/" +#ifdef __APPLE__ + #define kFirefoxPath "/Library/Application Support/Firefox/Profiles/" +#else + #define kFirefoxPath "/.mozilla/firefox/" +#endif + #define kFirefoxExtensionsFile "/extensions.json" /// Not parsed, but may be helpful later. diff --git a/osquery/tables/specs/darwin/firefox_addons.table b/osquery/tables/specs/x/firefox_addons.table similarity index 100% rename from osquery/tables/specs/darwin/firefox_addons.table rename to osquery/tables/specs/x/firefox_addons.table