[arch-commits] Commit in osquery/repos (4 files)

Anatol Pomozov anatolik at gemini.archlinux.org
Tue Sep 21 19:10:54 UTC 2021


    Date: Tuesday, September 21, 2021 @ 19:10:54
  Author: anatolik
Revision: 1020723

archrelease: copy trunk to community-testing-x86_64

Added:
  osquery/repos/community-testing-x86_64/
  osquery/repos/community-testing-x86_64/PKGBUILD
    (from rev 1020721, osquery/trunk/PKGBUILD)
  osquery/repos/community-testing-x86_64/libaudit.patch
    (from rev 1020721, osquery/trunk/libaudit.patch)
  osquery/repos/community-testing-x86_64/osquery.patch
    (from rev 1020721, osquery/trunk/osquery.patch)

----------------+
 PKGBUILD       |   48 ++++++++++++++
 libaudit.patch |   12 +++
 osquery.patch  |  179 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 239 insertions(+)

Copied: osquery/repos/community-testing-x86_64/PKGBUILD (from rev 1020721, osquery/trunk/PKGBUILD)
===================================================================
--- community-testing-x86_64/PKGBUILD	                        (rev 0)
+++ community-testing-x86_64/PKGBUILD	2021-09-21 19:10:54 UTC (rev 1020723)
@@ -0,0 +1,48 @@
+# Maintainer: Anatol Pomozov
+
+pkgname=osquery
+pkgver=5.0.1
+pkgrel=1
+pkgdesc='SQL powered operating system instrumentation, monitoring, and analytics'
+arch=(x86_64)
+url='https://osquery.io'
+license=(Apache GPL2)
+depends=(zlib)
+makedepends=(cmake ninja clang python gcc-libs git libunwind)
+options=(!strip)
+source=(git+https://github.com/osquery/osquery.git#tag=$pkgver
+        osquery.patch
+        libaudit.patch)
+sha256sums=('SKIP'
+            '5b73f732648752c7adf374a9d088d1486129eb6a41664ecd48634ecf1d6f91c7'
+            '96218ef5b7d6d6deb3a7b4b3dfed8068b7e4d10acd5b19372b9882f89d4478a8')
+
+prepare() {
+  cd $srcdir/osquery
+  patch -p1 < $srcdir/osquery.patch
+}
+
+build() {
+  cd osquery
+
+  CC=clang CXX=clang++ cmake \
+      -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DOSQUERY_VERSION=$pkgver \
+      -DOSQUERY_IGNORE_CMAKE_MAX_VERSION_CHECK=TRUE \
+      -G Ninja -S . -B build
+
+  # submodules are checked out by cmake, patch it after it were checked out
+  (cd $srcdir/osquery/libraries/cmake/source/libaudit/src && git reset --hard && patch -p1 < $srcdir/libaudit.patch)
+
+  ninja -C build
+}
+
+package() {
+  cd osquery
+
+  DESTDIR="${pkgdir}" ninja -C build install
+  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+  install -Dm644 tools/deployment/osquery.example.conf "$pkgdir/etc/osquery/osquery.conf"
+  install -Dm644 tools/deployment/linux_packaging/osqueryd.sysconfig "$pkgdir/etc/sysconfig/osqueryd"
+  install -Dm644 tools/deployment/linux_packaging/rpm/osqueryd.service "$pkgdir/usr/lib/systemd/system/osqueryd.service"
+  rm -r $pkgdir/control
+}

Copied: osquery/repos/community-testing-x86_64/libaudit.patch (from rev 1020721, osquery/trunk/libaudit.patch)
===================================================================
--- community-testing-x86_64/libaudit.patch	                        (rev 0)
+++ community-testing-x86_64/libaudit.patch	2021-09-21 19:10:54 UTC (rev 1020723)
@@ -0,0 +1,12 @@
+diff --git a/lib/libaudit.h b/lib/libaudit.h
+index 05ee91e..2ee3842 100644
+--- a/lib/libaudit.h
++++ b/lib/libaudit.h
+@@ -260,7 +260,6 @@ extern "C" {
+ #define AUDIT_KEY_SEPARATOR 0x01
+ 
+ /* These are used in filter control */
+-#define AUDIT_FILTER_EXCLUDE	AUDIT_FILTER_TYPE
+ #define AUDIT_FILTER_MASK	0x07	/* Mask to get actual filter */
+ #define AUDIT_FILTER_UNSET	0x80	/* This value means filter is unset */
+ 

Copied: osquery/repos/community-testing-x86_64/osquery.patch (from rev 1020721, osquery/trunk/osquery.patch)
===================================================================
--- community-testing-x86_64/osquery.patch	                        (rev 0)
+++ community-testing-x86_64/osquery.patch	2021-09-21 19:10:54 UTC (rev 1020723)
@@ -0,0 +1,179 @@
+commit 4e9200ae92bf4d873ec7ba4309f8c718fa029bc7
+Author: Anatol Pomozov <anatol.pomozov at gmail.com>
+Date:   Tue Sep 21 09:46:53 2021 -0700
+
+    Arch Linux specific fixes
+
+diff --git a/cmake/flags.cmake b/cmake/flags.cmake
+index e046e8b8d..76e7f20c1 100644
+--- a/cmake/flags.cmake
++++ b/cmake/flags.cmake
+@@ -79,11 +79,9 @@ function(setupBuildFlags)
+       -Woverloaded-virtual
+       -Wnon-virtual-dtor
+       -Weffc++
+-      -stdlib=libc++
+     )
+ 
+     set(posix_cxx_link_options
+-      -stdlib=libc++
+       -ldl
+     )
+ 
+@@ -131,7 +129,6 @@ function(setupBuildFlags)
+       )
+ 
+       set(linux_cxx_link_libraries
+-        c++abi
+         rt
+         dl
+       )
+@@ -157,7 +154,6 @@ function(setupBuildFlags)
+       )
+ 
+       set(macos_cxx_link_options
+-        -stdlib=libc++
+         -lresolv
+       )
+ 
+@@ -166,7 +162,6 @@ function(setupBuildFlags)
+         cups
+         bsm
+         xar
+-        c++abi
+         "-framework AppKit"
+         "-framework Foundation"
+         "-framework CoreServices"
+diff --git a/libraries/cmake/source/libmagic/config/linux/config.h b/libraries/cmake/source/libmagic/config/linux/config.h
+index 42be099c8..7054c73b9 100644
+--- a/libraries/cmake/source/libmagic/config/linux/config.h
++++ b/libraries/cmake/source/libmagic/config/linux/config.h
+@@ -247,9 +247,6 @@
+ /* Define to 1 if `vfork' works. */
+ #define HAVE_WORKING_VFORK 1
+ 
+-/* Define to 1 if you have the <xlocale.h> header file. */
+-#define HAVE_XLOCALE_H 1
+-
+ /* Define to 1 if you have the <zlib.h> header file. */
+ #define HAVE_ZLIB_H 1
+ 
+diff --git a/libraries/cmake/source/lldpd/config/x86_64/linux/libevent/event2/event-config.h b/libraries/cmake/source/lldpd/config/x86_64/linux/libevent/event2/event-config.h
+index 7041c46fb..9288df900 100644
+--- a/libraries/cmake/source/lldpd/config/x86_64/linux/libevent/event2/event-config.h
++++ b/libraries/cmake/source/lldpd/config/x86_64/linux/libevent/event2/event-config.h
+@@ -300,9 +300,6 @@
+ /* Define to 1 if you have the <sys/stat.h> header file. */
+ #define _EVENT_HAVE_SYS_STAT_H 1
+ 
+-/* Define to 1 if you have the <sys/sysctl.h> header file. */
+-#define _EVENT_HAVE_SYS_SYSCTL_H 1
+-
+ /* Define to 1 if you have the <sys/time.h> header file. */
+ #define _EVENT_HAVE_SYS_TIME_H 1
+ 
+diff --git a/libraries/cmake/source/thrift/CMakeLists.txt b/libraries/cmake/source/thrift/CMakeLists.txt
+index 0389d0507..a4c3d55ec 100644
+--- a/libraries/cmake/source/thrift/CMakeLists.txt
++++ b/libraries/cmake/source/thrift/CMakeLists.txt
+@@ -82,12 +82,6 @@ function(thriftMain)
+     set(forced_include_file_flag "--include")
+   endif()
+ 
+-  # C++17 dropped support for random_shuffle. Add it back with a
+-  # custom header
+-  target_compile_options(thirdparty_thrift PRIVATE
+-    "${forced_include_file_flag}${CMAKE_CURRENT_SOURCE_DIR}/patches/random_shuffle.h"
+-  )
+-
+   target_compile_definitions(thirdparty_thrift PUBLIC
+     THRIFT_STATIC_DEFINE
+   )
+diff --git a/osquery/core/shutdown.cpp b/osquery/core/shutdown.cpp
+index 3cb863d9b..7f93210f6 100644
+--- a/osquery/core/shutdown.cpp
++++ b/osquery/core/shutdown.cpp
+@@ -11,6 +11,7 @@
+ #include <osquery/logger/data_logger.h>
+ 
+ #include <atomic>
++#include <condition_variable>
+ #include <mutex>
+ #include <string>
+ 
+diff --git a/osquery/tables/networking/CMakeLists.txt b/osquery/tables/networking/CMakeLists.txt
+index 70b7079ee..7a42d068a 100644
+--- a/osquery/tables/networking/CMakeLists.txt
++++ b/osquery/tables/networking/CMakeLists.txt
+@@ -30,6 +30,10 @@ function(generateOsqueryTablesNetworking)
+       posix/interfaces.cpp
+       posix/utils.cpp
+     )
++
++    list(APPEND platform_deps
++      resolv
++    )
+   endif()
+ 
+   if(DEFINED PLATFORM_LINUX)
+diff --git a/osquery/tables/system/linux/sysctl_utils.cpp b/osquery/tables/system/linux/sysctl_utils.cpp
+index 1ff3e0b00..b66ecc79e 100644
+--- a/osquery/tables/system/linux/sysctl_utils.cpp
++++ b/osquery/tables/system/linux/sysctl_utils.cpp
+@@ -7,8 +7,6 @@
+  * SPDX-License-Identifier: (Apache-2.0 OR GPL-2.0-only)
+  */
+ 
+-#include <sys/sysctl.h>
+-
+ #include <boost/algorithm/string/trim.hpp>
+ 
+ #include <osquery/core/tables.h>
+@@ -73,10 +71,8 @@ void genControlInfo(int* oid,
+   // Get control size
+   size_t response_size = CTL_MAX_VALUE;
+   char response[CTL_MAX_VALUE + 1] = {0};
+-  if (sysctl(oid, oid_size, response, &response_size, 0, 0) != 0) {
+-    // Cannot request MIB data.
+-    return;
+-  }
++  // Cannot request MIB data.
++  return;
+ 
+   // Data is output, but no way to determine type (long, int, string, struct).
+   Row r;
+diff --git a/osquery/tables/system/posix/sysctl_utils.h b/osquery/tables/system/posix/sysctl_utils.h
+index e119f8a9e..0d4a399e4 100644
+--- a/osquery/tables/system/posix/sysctl_utils.h
++++ b/osquery/tables/system/posix/sysctl_utils.h
+@@ -9,8 +9,6 @@
+ 
+ #pragma once
+ 
+-#include <sys/sysctl.h>
+-
+ #include <osquery/core/tables.h>
+ 
+ namespace osquery {
+@@ -18,6 +16,8 @@ namespace tables {
+ 
+ #define CTL_MAX_VALUE 128
+ 
++#define CTL_MAXNAME	12
++
+ #ifndef CTL_DEBUG_MAXID
+ #define CTL_DEBUG_MAXID (CTL_MAXNAME * 2)
+ #endif
+diff --git a/tools/deployment/linux_packaging/rpm/osqueryd.service b/tools/deployment/linux_packaging/rpm/osqueryd.service
+index 6aa42752f..7bb3b3dc9 100644
+--- a/tools/deployment/linux_packaging/rpm/osqueryd.service
++++ b/tools/deployment/linux_packaging/rpm/osqueryd.service
+@@ -7,7 +7,7 @@ TimeoutStartSec=0
+ EnvironmentFile=/etc/sysconfig/osqueryd
+ ExecStartPre=/bin/sh -c "if [ ! -f $FLAG_FILE ]; then touch $FLAG_FILE; fi"
+ ExecStartPre=/bin/sh -c "if [ -f $LOCAL_PIDFILE ]; then mv $LOCAL_PIDFILE $PIDFILE; fi"
+-ExecStart=/opt/osquery/bin/osqueryd \
++ExecStart=/usr/bin/osqueryd \
+   --flagfile $FLAG_FILE \
+   --config_path $CONFIG_FILE
+ Restart=on-failure



More information about the arch-commits mailing list