|
|
fa2dd6 |
From 7d31c404ab6c90d19c378aaefdd70baf1a62f142 Mon Sep 17 00:00:00 2001
|
|
|
fa2dd6 |
From: =?UTF-8?q?Jan=20=C4=8Cern=C3=BD?= <jcerny@redhat.com>
|
|
|
fa2dd6 |
Date: Mon, 18 Mar 2019 16:35:45 +0100
|
|
|
fa2dd6 |
Subject: [PATCH] Don't ignore file behaviors if filepath is specified
|
|
|
fa2dd6 |
|
|
|
fa2dd6 |
The effect of the code removed by this patch is that the
|
|
|
fa2dd6 |
max_depth, recurse, recurse_direction and recurse_file_system
|
|
|
fa2dd6 |
attributes of the behaviors element are completely ignored
|
|
|
fa2dd6 |
and reset to their default values if filepath element is specified
|
|
|
fa2dd6 |
in the textfilecontent54_object. This is against OVAL specification
|
|
|
fa2dd6 |
and it is inconsistent with file probe, from where a similar
|
|
|
fa2dd6 |
code has been removed in 93d5f1416f232d6fa21fe8f2ad771d003749ea7b.
|
|
|
fa2dd6 |
---
|
|
|
fa2dd6 |
.../probes/independent/textfilecontent54.c | 31 -------------------
|
|
|
fa2dd6 |
1 file changed, 31 deletions(-)
|
|
|
fa2dd6 |
|
|
|
fa2dd6 |
diff --git a/src/OVAL/probes/independent/textfilecontent54.c b/src/OVAL/probes/independent/textfilecontent54.c
|
|
|
fa2dd6 |
index fc0f944e5..5f5890e15 100644
|
|
|
fa2dd6 |
--- a/src/OVAL/probes/independent/textfilecontent54.c
|
|
|
fa2dd6 |
+++ b/src/OVAL/probes/independent/textfilecontent54.c
|
|
|
fa2dd6 |
@@ -415,37 +415,6 @@ int probe_main(probe_ctx *ctx, void *arg)
|
|
|
fa2dd6 |
m_val = "1";
|
|
|
fa2dd6 |
*/
|
|
|
fa2dd6 |
|
|
|
fa2dd6 |
- /* reset filebehavior attributes if 'filepath' entity is used */
|
|
|
fa2dd6 |
- if (filepath_ent != NULL && bh_ent != NULL) {
|
|
|
fa2dd6 |
- SEXP_t *r1, *r2, *r3;
|
|
|
fa2dd6 |
- r1 = r2 = r3 = NULL;
|
|
|
fa2dd6 |
- if (probe_ent_attrexists(bh_ent, "ignore_case")) {
|
|
|
fa2dd6 |
- r1 = probe_ent_getattrval(bh_ent, "ignore_case");
|
|
|
fa2dd6 |
- }
|
|
|
fa2dd6 |
- if (probe_ent_attrexists(bh_ent, "multiline")) {
|
|
|
fa2dd6 |
- r2 = probe_ent_getattrval(bh_ent, "multiline");
|
|
|
fa2dd6 |
- }
|
|
|
fa2dd6 |
- if (probe_ent_attrexists(bh_ent, "singleline")) {
|
|
|
fa2dd6 |
- r3 = probe_ent_getattrval(bh_ent, "singleline");
|
|
|
fa2dd6 |
- }
|
|
|
fa2dd6 |
- r0 = SEXP_list_new(NULL);
|
|
|
fa2dd6 |
- SEXP_free(bh_ent);
|
|
|
fa2dd6 |
- bh_ent = probe_ent_creat1("behaviors", r0, NULL);
|
|
|
fa2dd6 |
- SEXP_free(r0);
|
|
|
fa2dd6 |
- if (r1) {
|
|
|
fa2dd6 |
- probe_ent_attr_add(bh_ent, "ignore_case", r1);
|
|
|
fa2dd6 |
- SEXP_free(r1);
|
|
|
fa2dd6 |
- }
|
|
|
fa2dd6 |
- if (r2) {
|
|
|
fa2dd6 |
- probe_ent_attr_add(bh_ent, "multiline", r2);
|
|
|
fa2dd6 |
- SEXP_free(r2);
|
|
|
fa2dd6 |
- }
|
|
|
fa2dd6 |
- if (r3) {
|
|
|
fa2dd6 |
- probe_ent_attr_add(bh_ent, "singleline", r3);
|
|
|
fa2dd6 |
- SEXP_free(r3);
|
|
|
fa2dd6 |
- }
|
|
|
fa2dd6 |
- }
|
|
|
fa2dd6 |
-
|
|
|
fa2dd6 |
probe_tfc54behaviors_canonicalize(&bh_ent);
|
|
|
fa2dd6 |
|
|
|
fa2dd6 |
pfd.instance_ent = inst_ent;
|