aboutsummaryrefslogtreecommitdiff
path: root/sysutils/osquery
diff options
context:
space:
mode:
authorRyan Steinmetz <zi@FreeBSD.org>2015-05-18 14:48:38 +0000
committerRyan Steinmetz <zi@FreeBSD.org>2015-05-18 14:48:38 +0000
commit075cae3557ff63d29464b58d723e8d81630153b6 (patch)
tree7230352f429d9c3bff0100f05a8e000e942308e8 /sysutils/osquery
parent0b29c5f9bf90798b9307d751e79a44e6df062810 (diff)
downloadports-075cae3557ff63d29464b58d723e8d81630153b6.tar.gz
ports-075cae3557ff63d29464b58d723e8d81630153b6.zip
Notes
Diffstat (limited to 'sysutils/osquery')
-rw-r--r--sysutils/osquery/Makefile2
-rw-r--r--sysutils/osquery/files/patch-osquery_tables_specs_blacklist2
-rw-r--r--sysutils/osquery/files/patch-osquery_tables_system_freebsd_mounts.cpp57
3 files changed, 59 insertions, 2 deletions
diff --git a/sysutils/osquery/Makefile b/sysutils/osquery/Makefile
index 162f86909a74..474eee43d0eb 100644
--- a/sysutils/osquery/Makefile
+++ b/sysutils/osquery/Makefile
@@ -3,7 +3,7 @@
PORTNAME= osquery
PORTVERSION= 1.4.5
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= sysutils
MASTER_SITES= GH:ghc \
https://codeload.github.com/${PORTNAME}/third-party/tar.gz/${PORTVERSION}?dummy=/:gh
diff --git a/sysutils/osquery/files/patch-osquery_tables_specs_blacklist b/sysutils/osquery/files/patch-osquery_tables_specs_blacklist
index 29c889dc99e1..0a460d26673a 100644
--- a/sysutils/osquery/files/patch-osquery_tables_specs_blacklist
+++ b/sysutils/osquery/files/patch-osquery_tables_specs_blacklist
@@ -20,7 +20,7 @@
+freebsd:kernel_info
+freebsd:last
+#freebsd:listening_ports
-+freebsd:mounts
++#freebsd:mounts
+freebsd:opera_extensions
+freebsd:os_version
+freebsd:passwd_changes
diff --git a/sysutils/osquery/files/patch-osquery_tables_system_freebsd_mounts.cpp b/sysutils/osquery/files/patch-osquery_tables_system_freebsd_mounts.cpp
new file mode 100644
index 000000000000..0fd2328095ed
--- /dev/null
+++ b/sysutils/osquery/files/patch-osquery_tables_system_freebsd_mounts.cpp
@@ -0,0 +1,57 @@
+--- osquery/tables/system/freebsd/mounts.cpp.orig 2015-05-18 14:14:18 UTC
++++ osquery/tables/system/freebsd/mounts.cpp
+@@ -0,0 +1,54 @@
++/*
++ * Copyright (c) 2014, Facebook, Inc.
++ * All rights reserved.
++ *
++ * This source code is licensed under the BSD-style license found in the
++ * LICENSE file in the root directory of this source tree. An additional grant
++ * of patent rights can be found in the PATENTS file in the same directory.
++ *
++ */
++
++#include <stdio.h>
++#include <sys/mount.h>
++
++#include <osquery/tables.h>
++
++namespace osquery {
++namespace tables {
++
++QueryData genMounts(QueryContext& context) {
++ QueryData results;
++
++ struct statfs *mnt;
++ int mnts = 0;
++ int i;
++ char real_path[PATH_MAX];
++
++ mnts = getmntinfo(&mnt, MNT_WAIT);
++ if (mnts == 0) {
++ // Failed to get mount information.
++ return results;
++ }
++
++ for (i = 0; i < mnts; i++) {
++ Row r;
++ r["path"] = TEXT(mnt[i].f_mntonname);
++ r["device"] = TEXT(mnt[i].f_mntfromname);
++ r["device_alias"] = std::string(realpath(mnt[i].f_mntfromname, real_path)
++ ? real_path
++ : mnt[i].f_mntfromname);
++ r["type"] = TEXT(mnt[i].f_fstypename);
++ r["flags"] = INTEGER(mnt[i].f_flags);
++ r["blocks"] = BIGINT(mnt[i].f_blocks);
++ r["blocks_free"] = BIGINT(mnt[i].f_bfree);
++ r["blocks_available"] = BIGINT(mnt[i].f_bavail);
++ r["blocks_size"] = BIGINT(mnt[i].f_bsize);
++ r["inodes"] = BIGINT(mnt[i].f_files);
++ r["inodes_free"] = BIGINT(mnt[i].f_ffree);
++ r["owner"] = INTEGER(mnt[i].f_owner);
++ results.push_back(r);
++ }
++ return results;
++}
++}
++}