osquery-1/osquery/tables/system/darwin/osx_version.mm
2014-09-05 10:58:58 -07:00

34 lines
705 B
Plaintext

// Copyright 2004-present Facebook. All Rights Reserved.
#include "osquery/database/results.h"
#include <string>
#include <boost/lexical_cast.hpp>
#import "osquery/core/darwin/NSProcessInfo+PECocoaBackports.h"
using namespace osquery::db;
namespace osquery {
namespace tables {
QueryData genOSXVersion() {
QueryData results;
@autoreleasepool {
NSOperatingSystemVersion v =
[[NSProcessInfo processInfo] operatingSystemVersion];
Row r;
r["major"] = boost::lexical_cast<std::string>(v.majorVersion);
r["minor"] = boost::lexical_cast<std::string>(v.minorVersion);
r["patch"] = boost::lexical_cast<std::string>(v.patchVersion);
results.push_back(r);
}
return results;
}
}
}