Epoch in rpm_packages table (#5248)

Summary:
code for issue: #5202
Pull Request resolved: https://github.com/facebook/osquery/pull/5248

Differential Revision: D13677333

Pulled By: fmanco

fbshipit-source-id: e245c3733bb73a1d4d6ab61e007c1cf274c29e59
This commit is contained in:
micheal-o 2019-01-15 16:49:32 -08:00 committed by Facebook Github Bot
parent f5645b95b5
commit 6fe7b4cbc2
2 changed files with 2 additions and 0 deletions

View File

@ -149,6 +149,7 @@ QueryData genRpmPackages(QueryContext& context) {
r["size"] = getRpmAttribute(header, RPMTAG_SIZE, td);
r["sha1"] = getRpmAttribute(header, RPMTAG_SHA1HEADER, td);
r["arch"] = getRpmAttribute(header, RPMTAG_ARCH, td);
r["epoch"] = INTEGER(getRpmAttribute(header, RPMTAG_EPOCH, td));
rpmtdFree(td);
results.push_back(r);

View File

@ -8,6 +8,7 @@ schema([
Column("size", BIGINT, "Package size in bytes"),
Column("sha1", TEXT, "SHA1 hash of the package contents"),
Column("arch", TEXT, "Architecture(s) supported"),
Column("epoch", INTEGER, "Package epoch value"),
])
attributes(cacheable=True)
implementation("@genRpmPackages")