Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 May 2015 14:48:39 +0000 (UTC)
From:      Ryan Steinmetz <zi@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r386686 - in head/sysutils/osquery: . files
Message-ID:  <201505181448.t4IEmdLj039412@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: zi
Date: Mon May 18 14:48:38 2015
New Revision: 386686
URL: https://svnweb.freebsd.org/changeset/ports/386686

Log:
  - Add mounts table support
  - Bump PORTREVISION

Added:
  head/sysutils/osquery/files/patch-osquery_tables_system_freebsd_mounts.cpp   (contents, props changed)
Modified:
  head/sysutils/osquery/Makefile
  head/sysutils/osquery/files/patch-osquery_tables_specs_blacklist

Modified: head/sysutils/osquery/Makefile
==============================================================================
--- head/sysutils/osquery/Makefile	Mon May 18 14:20:48 2015	(r386685)
+++ head/sysutils/osquery/Makefile	Mon May 18 14:48:38 2015	(r386686)
@@ -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

Modified: head/sysutils/osquery/files/patch-osquery_tables_specs_blacklist
==============================================================================
--- head/sysutils/osquery/files/patch-osquery_tables_specs_blacklist	Mon May 18 14:20:48 2015	(r386685)
+++ head/sysutils/osquery/files/patch-osquery_tables_specs_blacklist	Mon May 18 14:48:38 2015	(r386686)
@@ -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

Added: head/sysutils/osquery/files/patch-osquery_tables_system_freebsd_mounts.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/osquery/files/patch-osquery_tables_system_freebsd_mounts.cpp	Mon May 18 14:48:38 2015	(r386686)
@@ -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;
++}
++}
++}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201505181448.t4IEmdLj039412>