diff --git a/tools/provision.sh b/tools/provision.sh index c363196..31019ff 100755 --- a/tools/provision.sh +++ b/tools/provision.sh @@ -83,6 +83,8 @@ function main() { log "your $OS does not use a provision script" fi + exit + # The dependency directory (DEPS_DIR) will contain our legacy runtime glibc # and various compilers/library dependencies. if [[ ! -d "$DEPS_DIR" ]]; then diff --git a/specs/windows/services.table b/specs/windows/services.table index 3acf0c5..bd7612b 100644 --- a/specs/windows/services.table +++ b/specs/windows/services.table @@ -12,7 +12,7 @@ schema([ Column("path", TEXT, "Path to Service Executable"), Column("module_path", TEXT, "Path to ServiceDll"), Column("description", TEXT, "Service Description"), - Column("user_account", TEXT, "The name of the account that the service process will be logged on as when it runs. This name can be of the form Domain\UserName. If the account belongs to the built-in domain, the name can be of the form .\UserName."), + Column("user_account", TEXT, "The name of the account that the service process will be logged on as when it runs. This name can be of the form Domain\\UserName. If the account belongs to the built-in domain, the name can be of the form .\\UserName."), ]) implementation("system/windows/services@genServices") examples([ diff --git a/include/osquery/core.h b/include/osquery/core.h index a367f913..c522d558 100644 --- a/include/osquery/core.h +++ b/include/osquery/core.h @@ -15,8 +15,9 @@ #include #include -#if defined(__APPLE__) || defined(__FreeBSD__) +#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__linux__) #include +#include #else #include #endif @@ -182,7 +183,7 @@ inline bool isPlatform(PlatformType a, const PlatformType& t = kPlatformType) { return (static_cast(t) & static_cast(a)) != 0; } -#if defined(__APPLE__) || defined(__FreeBSD__) +#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__linux__) #define MUTEX_IMPL boost #else #define MUTEX_IMPL std @@ -198,8 +199,8 @@ using WriteLock = MUTEX_IMPL::unique_lock; using ReadLock = MUTEX_IMPL::shared_lock; /// Helper alias for defining recursive mutexes. -using RecursiveMutex = std::recursive_mutex; +using RecursiveMutex = MUTEX_IMPL::recursive_mutex; /// Helper alias for write locking a recursive mutex. -using RecursiveLock = std::lock_guard; +using RecursiveLock = MUTEX_IMPL::lock_guard; } diff --git a/Makefile b/Makefile index 2e2bd13c..c5ae915a 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,7 @@ endif PATH_SET := PATH="$(DEPS_DIR)/bin:/usr/local/bin:$(PATH)" CMAKE := $(PATH_SET) CXXFLAGS="-L$(DEPS_DIR)/lib" cmake ../../ CTEST := $(PATH_SET) ctest ../../ -FORMAT_COMMAND := python tools/formatting/git-clang-format.py \ +FORMAT_COMMAND := python2 tools/formatting/git-clang-format.py \ "--commit" "master" "-f" "--style=file" ANALYSIS := ${SOURCE_DIR}/tools/analysis diff --git a/CMakeLists.txt b/CMakeLists.txt index 4444a9a2..b9c2640d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -393,6 +393,8 @@ endif() if(APPLE) LOG_PLATFORM("OS X") +elseif(OSQUERY_BUILD_PLATFORM STREQUAL "arch") + LOG_PLATFORM("Arch Linux") elseif(OSQUERY_BUILD_PLATFORM STREQUAL "debian") LOG_PLATFORM("Debian") elseif(OSQUERY_BUILD_PLATFORM STREQUAL "ubuntu") diff --git a/osquery/tables/CMakeLists.txt b/osquery/tables/CMakeLists.txt index 8efb6202..7f9d64aa 100644 --- a/osquery/tables/CMakeLists.txt +++ b/osquery/tables/CMakeLists.txt @@ -66,8 +66,10 @@ endif() if(LINUX) set(TABLE_PLATFORM "linux") + include_directories("/usr/include/libxml2") + ADD_OSQUERY_LINK_ADDITIONAL("libresolv.so") - ADD_OSQUERY_LINK_ADDITIONAL("cryptsetup devmapper lvm2app lvm-internal daemonclient") + ADD_OSQUERY_LINK_ADDITIONAL("cryptsetup devmapper lvm2app") ADD_OSQUERY_LINK_ADDITIONAL("gcrypt gpg-error") ADD_OSQUERY_LINK_ADDITIONAL("blkid") ADD_OSQUERY_LINK_ADDITIONAL("ip4tc") diff --git a/osquery/tables/system/linux/tests/md_tables_tests.cpp b/osquery/tables/system/linux/tests/md_tables_tests.cpp index bfe71092..2415ae1f 100644 --- a/osquery/tables/system/linux/tests/md_tables_tests.cpp +++ b/osquery/tables/system/linux/tests/md_tables_tests.cpp @@ -72,7 +72,7 @@ void GetDrivesForArrayTestHarness(std::string arrayName, EXPECT_CALL(md, getArrayInfo(arrayDevPath, _)) .WillOnce(DoAll(SetArgReferee<1>(arrayInfo), Return(true))); - Sequence::Sequence s1; + Sequence s1; for (int i = 0; i < MD_SB_DISKS; i++) { mdu_disk_info_t diskInfo; diskInfo.number = i; diff --git a/osquery/devtools/shell.cpp b/osquery/devtools/shell.cpp index 84507f66..7811b9c8 100644 --- a/osquery/devtools/shell.cpp +++ b/osquery/devtools/shell.cpp @@ -1185,7 +1185,7 @@ inline void meta_show(struct callback_data* p) { { fprintf(p->out, "\nNon-default flags/options:\n"); - auto results = osquery::SQL::SQL( + auto results = osquery::SQL( "select * from osquery_flags where default_value <> value"); for (const auto& flag : results.rows()) { fprintf(p->out,