summarylogtreecommitdiffstats
path: root/arch-linux.patch
blob: 7b9137b934b048362058c2bcad60ba43ca027b91 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
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/osquery/extensions/CMakeLists.txt b/osquery/extensions/CMakeLists.txt
index 5147c1a9..1c072e4c 100644
--- a/osquery/extensions/CMakeLists.txt
+++ b/osquery/extensions/CMakeLists.txt
@@ -1,7 +1,7 @@
 # Generate the thrift intermediate/interface code.
 add_custom_command(
   COMMAND
-    ${THRIFT_COMPILER} --gen cpp:dense --gen py:dense "${CMAKE_SOURCE_DIR}/osquery.thrift"
+    ${THRIFT_COMPILER} --gen cpp --gen py "${CMAKE_SOURCE_DIR}/osquery.thrift"
   DEPENDS "${CMAKE_SOURCE_DIR}/osquery.thrift"
   WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/generated"
   OUTPUT ${OSQUERY_THRIFT_GENERATED_FILES}
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 <string>
 #include <vector>

-#if defined(__APPLE__) || defined(__FreeBSD__)
+#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__linux__)
 #include <boost/thread/shared_mutex.hpp>
+#include <boost/thread/recursive_mutex.hpp>
 #else
 #include <shared_mutex>
 #endif
@@ -182,7 +183,7 @@ inline bool isPlatform(PlatformType a, const PlatformType& t = kPlatformType) {
   return (static_cast<int>(t) & static_cast<int>(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<Mutex>;
 using ReadLock = MUTEX_IMPL::shared_lock<Mutex>;

 /// 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<std::recursive_mutex>;
+using RecursiveLock = MUTEX_IMPL::lock_guard<MUTEX_IMPL::recursive_mutex>;
 }
diff --git a/osquery/CMakeLists.txt b/osquery/CMakeLists.txt
index 4c8ac8ca..195450da 100644
--- a/osquery/CMakeLists.txt
+++ b/osquery/CMakeLists.txt
@@ -55,7 +55,7 @@ if(WINDOWS)
   ADD_OSQUERY_LINK_CORE("ssleay32")
   ADD_OSQUERY_LINK_CORE("eay32")
   ADD_OSQUERY_LINK_CORE("zlibstatic")
-
+
   # Enable control flow guard
   ADD_OSQUERY_LINK_CORE("-guard:cf")
 else()
@@ -69,10 +69,11 @@ endif()

 if(APPLE OR LINUX)
   ADD_OSQUERY_LINK_CORE("libdl")
-  ADD_OSQUERY_LINK_CORE("boost_system-mt")
-  ADD_OSQUERY_LINK_CORE("boost_filesystem-mt")
+  ADD_OSQUERY_LINK_CORE("boost_system")
+  ADD_OSQUERY_LINK_CORE("boost_filesystem")
+  ADD_OSQUERY_LINK_CORE("boost_thread")
   ADD_OSQUERY_LINK_ADDITIONAL("rocksdb_lite")
-  ADD_OSQUERY_LINK_ADDITIONAL("boost_regex-mt")
+  ADD_OSQUERY_LINK_ADDITIONAL("boost_regex")
 elseif(FREEBSD)
   ADD_OSQUERY_LINK_CORE("icuuc")
   ADD_OSQUERY_LINK_CORE("boost_system")
diff --git a/CMakeLists.txt b/CMakeLists.txt
index dfb9ccd7..6d9e257e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -392,7 +392,7 @@ elseif(OSQUERY_BUILD_PLATFORM STREQUAL "windows")
   LOG_PLATFORM("Windows")
 endif()

-if("${OSQUERY_BUILD_DISTRO}" MATCHES "^(centos|rhel|scientific|oracle)7$")
+if("${OSQUERY_BUILD_DISTRO}" MATCHES "^(centos|rhel|scientific|oracle)7$|arch")
   # Useful for libudev version detection.
   set(SYSTEMD TRUE)
 endif()
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