mirror of
https://github.com/valitydev/osquery-1.git
synced 2024-11-07 18:08:53 +00:00
Change user_name, group_name to username, groupname
This commit is contained in:
parent
44b170cb3b
commit
12a5daa225
@ -19,8 +19,8 @@ namespace osquery {
|
||||
namespace tables {
|
||||
|
||||
// Macros for safe sign-extension
|
||||
#define STRING_FROM_UCHAR(x) boost::lexical_cast<std::string>((uint16_t)x);
|
||||
#define STRING_FROM_UINT32(x) boost::lexical_cast<std::string>((uint64_t)x);
|
||||
#define INTEGER_FROM_UCHAR(x) INTEGER((uint16_t)x);
|
||||
#define BIGINT_FROM_UINT32(x) BIGINT((uint64_t)x);
|
||||
|
||||
void genAddressesFromAddr(const struct ifaddrs *addr, QueryData &results) {
|
||||
std::string dest_address;
|
||||
@ -52,16 +52,16 @@ void genDetailsFromAddr(const struct ifaddrs *addr, QueryData &results) {
|
||||
r["mac"] = macAsString(addr);
|
||||
|
||||
ifd = (struct if_data *)addr->ifa_data;
|
||||
r["type"] = STRING_FROM_UCHAR(ifd->ifi_type);
|
||||
r["mtu"] = STRING_FROM_UINT32(ifd->ifi_mtu);
|
||||
r["metric"] = STRING_FROM_UINT32(ifd->ifi_metric);
|
||||
r["ipackets"] = STRING_FROM_UINT32(ifd->ifi_ipackets);
|
||||
r["opackets"] = STRING_FROM_UINT32(ifd->ifi_opackets);
|
||||
r["ibytes"] = STRING_FROM_UINT32(ifd->ifi_ibytes);
|
||||
r["obytes"] = STRING_FROM_UINT32(ifd->ifi_obytes);
|
||||
r["ierrors"] = STRING_FROM_UINT32(ifd->ifi_ierrors);
|
||||
r["oerrors"] = STRING_FROM_UINT32(ifd->ifi_oerrors);
|
||||
r["last_change"] = STRING_FROM_UINT32(ifd->ifi_lastchange.tv_sec);
|
||||
r["type"] = INTEGER_FROM_UCHAR(ifd->ifi_type);
|
||||
r["mtu"] = BIGINT_FROM_UINT32(ifd->ifi_mtu);
|
||||
r["metric"] = BIGINT_FROM_UINT32(ifd->ifi_metric);
|
||||
r["ipackets"] = BIGINT_FROM_UINT32(ifd->ifi_ipackets);
|
||||
r["opackets"] = BIGINT_FROM_UINT32(ifd->ifi_opackets);
|
||||
r["ibytes"] = BIGINT_FROM_UINT32(ifd->ifi_ibytes);
|
||||
r["obytes"] = BIGINT_FROM_UINT32(ifd->ifi_obytes);
|
||||
r["ierrors"] = BIGINT_FROM_UINT32(ifd->ifi_ierrors);
|
||||
r["oerrors"] = BIGINT_FROM_UINT32(ifd->ifi_oerrors);
|
||||
r["last_change"] = BIGINT_FROM_UINT32(ifd->ifi_lastchange.tv_sec);
|
||||
results.push_back(r);
|
||||
}
|
||||
|
||||
|
@ -3,14 +3,14 @@ schema([
|
||||
Column("interface", TEXT),
|
||||
Column("mac", TEXT),
|
||||
Column("type", INTEGER),
|
||||
Column("mtu", TEXT),
|
||||
Column("metric", TEXT),
|
||||
Column("ipackets", TEXT),
|
||||
Column("opackets", TEXT),
|
||||
Column("ibytes", TEXT),
|
||||
Column("obytes", TEXT),
|
||||
Column("ierrors", TEXT),
|
||||
Column("oerrors", TEXT),
|
||||
Column("last_change", TEXT),
|
||||
Column("mtu", INTEGER),
|
||||
Column("metric", INTEGER),
|
||||
Column("ipackets", BIGINT),
|
||||
Column("opackets", BIGINT),
|
||||
Column("ibytes", BIGINT),
|
||||
Column("obytes", BIGINT),
|
||||
Column("ierrors", BIGINT),
|
||||
Column("oerrors", BIGINT),
|
||||
Column("last_change", BIGINT),
|
||||
])
|
||||
implementation("interfaces@genInterfaceDetails")
|
||||
|
@ -7,8 +7,8 @@ schema([
|
||||
Column("keep_alive", TEXT),
|
||||
Column("on_demand", TEXT),
|
||||
Column("disabled", TEXT),
|
||||
Column("user_name", TEXT),
|
||||
Column("group_name", TEXT),
|
||||
Column("username", TEXT),
|
||||
Column("groupname", TEXT),
|
||||
Column("stdout_path", TEXT),
|
||||
Column("stderr_path", TEXT),
|
||||
Column("start_interval", TEXT),
|
||||
|
@ -38,8 +38,8 @@ const std::map<std::string, std::string> kLaunchdTopLevelStringKeys = {
|
||||
{"StartOnMount", "start_on_mount"},
|
||||
{"OnDemand", "on_demand"},
|
||||
{"Disabled", "disabled"},
|
||||
{"UserName", "user_name"},
|
||||
{"GroupName", "group_name"},
|
||||
{"UserName", "username"},
|
||||
{"GroupName", "groupname"},
|
||||
{"RootDirectory", "root_directory"},
|
||||
{"WorkingDirectory", "working_directory"},
|
||||
{"ProcessType", "process_type"},
|
||||
|
Loading…
Reference in New Issue
Block a user