Skip to content

Commit 683ed8c

Browse files
Malte Krausjan-cerny
authored andcommitted
make the 'block_size' property dependent on the OVAL version
1 parent 38a4dd6 commit 683ed8c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,14 @@ static int collect_item(probe_ctx *ctx, oval_schema_version_t over, struct mnten
219219
"total_space", OVAL_DATATYPE_INTEGER, (int64_t)stvfs.f_blocks,
220220
"space_used", OVAL_DATATYPE_INTEGER, (int64_t)(stvfs.f_blocks - stvfs.f_bfree),
221221
"space_left", OVAL_DATATYPE_INTEGER, (int64_t)stvfs.f_bfree,
222-
"block_size", OVAL_DATATYPE_INTEGER, (int64_t)stvfs.f_frsize,
223222
NULL);
224223

224+
if (oval_schema_version_cmp(over, OVAL_SCHEMA_VERSION(5.11.2)) >= 0) {
225+
SEXP_t *block_size = SEXP_number_newi_64(stvfs.f_frsize);
226+
probe_item_ent_add(item, "block_size", NULL, block_size);
227+
SEXP_free(block_size);
228+
}
229+
225230
#if defined(HAVE_BLKID_GET_TAG_VALUE)
226231
/*
227232
* If the partition doesn't have an UUID assigned, set the uuid entity status to

0 commit comments

Comments
 (0)