From owner-svn-ports-all@FreeBSD.ORG Mon May 18 14:48:40 2015 Return-Path: Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 470F5B14; Mon, 18 May 2015 14:48:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 354E611FB; Mon, 18 May 2015 14:48:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4IEme0V039418; Mon, 18 May 2015 14:48:40 GMT (envelope-from zi@FreeBSD.org) Received: (from zi@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4IEmdLj039412; Mon, 18 May 2015 14:48:39 GMT (envelope-from zi@FreeBSD.org) Message-Id: <201505181448.t4IEmdLj039412@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: zi set sender to zi@FreeBSD.org using -f From: Ryan Steinmetz Date: Mon, 18 May 2015 14:48:39 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r386686 - in head/sysutils/osquery: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2015 14:48:40 -0000 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 ++#include ++ ++#include ++ ++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; ++} ++} ++}