Skip to content

Commit 61d2a73

Browse files
committed
Fix missing filepaths in rpminfo items
When the queried RPM package has null epoch (or "(none)" as returned by "rpm -q --qf '%{EPOCH}\n'" command), the rpminfo_item produced by the probe didn't contain any filepath element. To use the null epoch as a parameter of rpmdbSetIteratorRE, the "(none)" string should be replaced by "0".
1 parent e121009 commit 61d2a73

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/OVAL/probes/unix/linux/rpminfo.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,8 @@ static int collect_rpm_files(SEXP_t *item, const struct rpminfo_rep *rep) {
339339
ret = -1;
340340
goto cleanup;
341341
}
342-
if (rpmdbSetIteratorRE(ts, RPMTAG_EPOCH, RPMMIRE_STRCMP, rep->epoch) != 0) {
342+
char *epoch_override = oscap_streq(rep->epoch, "(none)") ? "0" : rep->epoch;
343+
if (rpmdbSetIteratorRE(ts, RPMTAG_EPOCH, RPMMIRE_STRCMP, epoch_override) != 0) {
343344
ret = -1;
344345
goto cleanup;
345346
}

0 commit comments

Comments
 (0)